feat: add WCN3990 Wi-Fi bringup service, battery protection, and bringup automation
Offline project checks / check (push) Canceled after 0s
Offline project checks / check (push) Canceled after 0s
- Add phone-dsp.openrc to initialize Hexagon DSP, rmtfs, pd-mapper, and ath10k_snoc - Update phone-battery-guard threshold to 80% with power supply node fallbacks - Enhance phone-cellular-setup with battery gate checks, RF locks, and unit tests - Include bringup, flashing, and inspection automation scripts for platina - Update candidate IPA v2.6 patches and package locks
This commit is contained in:
Executable
+111
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Trigger sysrq reboot, wait for fresh telnet, and verify the patched IPA module.
|
||||
"""
|
||||
import time
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
TARGET_IP = "172.16.42.1"
|
||||
TARGET_PORT = 23
|
||||
|
||||
def log(msg):
|
||||
print(f"[{time.strftime('%H:%M:%S')}] {msg}", flush=True)
|
||||
|
||||
def telnet_cmd(cmd, wait_time=2.0, verbose=True):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.settimeout(5.0)
|
||||
s.connect((TARGET_IP, TARGET_PORT))
|
||||
time.sleep(0.5)
|
||||
try:
|
||||
s.recv(4096)
|
||||
except socket.timeout:
|
||||
pass
|
||||
if verbose:
|
||||
log(f"TELNET CMD: {cmd}")
|
||||
s.sendall((cmd + "\n").encode("utf-8"))
|
||||
time.sleep(wait_time)
|
||||
output = b""
|
||||
while True:
|
||||
try:
|
||||
chunk = s.recv(4096)
|
||||
if not chunk:
|
||||
break
|
||||
output += chunk
|
||||
except socket.timeout:
|
||||
break
|
||||
s.close()
|
||||
res = output.decode("utf-8", errors="replace")
|
||||
if verbose:
|
||||
log(f"OUTPUT:\n{res.strip()}")
|
||||
return res
|
||||
|
||||
def main():
|
||||
log("Sending sysrq b emergency reset to phone...")
|
||||
try:
|
||||
s = socket.socket()
|
||||
s.settimeout(3.0)
|
||||
s.connect((TARGET_IP, TARGET_PORT))
|
||||
s.sendall(b"echo b > /proc/sysrq-trigger\n")
|
||||
time.sleep(0.5)
|
||||
s.close()
|
||||
except Exception as e:
|
||||
log(f"Reset sent ({e})")
|
||||
|
||||
log("Waiting for phone to reboot into fresh debug shell...")
|
||||
time.sleep(5)
|
||||
start = time.time()
|
||||
while time.time() - start < 60:
|
||||
s = socket.socket()
|
||||
s.settimeout(1.0)
|
||||
try:
|
||||
s.connect((TARGET_IP, TARGET_PORT))
|
||||
s.close()
|
||||
log("Telnet port 23 is OPEN!")
|
||||
time.sleep(2)
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
time.sleep(1)
|
||||
else:
|
||||
raise TimeoutError("Timed out waiting for telnet")
|
||||
|
||||
# 1. Check uptime & uname
|
||||
telnet_cmd("uname -a; uptime")
|
||||
|
||||
# 2. Mount eMMC and bind modules
|
||||
telnet_cmd("mkdir -p /mnt && mount /dev/mmcblk1p79 /mnt && echo MOUNT_OK")
|
||||
telnet_cmd("mount --bind /mnt/lib/modules /lib/modules && echo BIND_OK")
|
||||
|
||||
# 3. Verify sha256 of ipa.ko.zst
|
||||
telnet_cmd("sha256sum /lib/modules/7.2.12-sdm660/kernel/drivers/net/ipa/ipa.ko.zst")
|
||||
|
||||
# 4. Modprobe IPA
|
||||
log("Loading patched IPA module...")
|
||||
telnet_cmd("modprobe -v ipa; dmesg | tail -n 25")
|
||||
|
||||
# 5. Check netdev
|
||||
telnet_cmd("ip link show rmnet_ipa0")
|
||||
|
||||
# 6. Wait 65s for runtime suspend autosuspend test
|
||||
log("Waiting 65s for autosuspend verification (testing runtime PM fix)...")
|
||||
for sec in range(1, 14):
|
||||
time.sleep(5)
|
||||
print(f".{sec*5}s", end="", flush=True)
|
||||
print()
|
||||
|
||||
# 7. Check dmesg for any oops or errors
|
||||
log("Checking dmesg for crashes...")
|
||||
res = telnet_cmd("dmesg | tail -n 35")
|
||||
|
||||
if "Unable to handle kernel NULL pointer dereference" in res or "Oops:" in res:
|
||||
log("FAILURE: Kernel oops detected!")
|
||||
return 1
|
||||
|
||||
log("SUCCESS: 0 crashes detected after 65s idle timeout!")
|
||||
log("IPA runtime autosuspend fix is 100% VERIFIED!")
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user