fix testing ramdisk copy: boots fine, no panic

This commit is contained in:
Lakr
2026-03-04 18:14:37 +08:00
parent 11e6fc8eaa
commit ec2a071fa4
3 changed files with 8 additions and 11 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ help:
@echo "Ramdisk:"
@echo " make ramdisk_build Build signed SSH ramdisk"
@echo " make ramdisk_send Send ramdisk to device"
@echo " make testing_ramdisk_build Build boot chain only (no rootfs, kernel will panic)"
@echo " make testing_ramdisk_build Build boot chain only (no SSH, no CFW)"
@echo " make testing_ramdisk_send Send testing boot chain to device"
@echo ""
@echo "CFW:"
+4 -7
View File
@@ -3,11 +3,8 @@
testing_ramdisk_build.py — Build a minimal signed boot chain for testing.
Packs firmware components (iBSS, iBEC, SPTM, DeviceTree, SEP, TXM,
kernelcache) and an empty ramdisk into signed IMG4 files. No trustcache.
The kernel is expected to boot and then panic (no rootfs). This is useful
for verifying that patched boot-chain components (iBSS/iBEC/LLB/iBoot/TXM/
kernelcache) work correctly.
kernelcache) with the stock ramdisk into signed IMG4 files. No SSH
tools or CFW — just the base boot chain for quick patch verification.
Usage:
python3 testing_ramdisk_build.py [vm_directory]
@@ -151,7 +148,7 @@ def main():
shutil.rmtree(d)
os.makedirs(d)
print(f"[*] Testing ramdisk — boot chain only (no rootfs, kernel will panic)")
print(f"[*] Testing ramdisk — boot chain only (no SSH, no CFW)")
print(f"[*] VM directory: {vm_dir}")
print(f"[*] Restore directory: {restore_dir}")
print(f"[*] SHSH blob: {shsh_path}")
@@ -354,7 +351,7 @@ def main():
print(f"\n{'=' * 60}")
print(f" Testing ramdisk build complete!")
print(f" Output: {output_dir}/")
print(f" Note: kernel will panic after boot (no rootfs — expected)")
print(f" Note: boot chain only — no SSH, no CFW")
print(f"{'=' * 60}")
for f in sorted(os.listdir(output_dir)):
size = os.path.getsize(os.path.join(output_dir, f))
+3 -3
View File
@@ -5,7 +5,7 @@
#
# Expects device in DFU mode. Loads iBSS/iBEC, then boots with
# SPTM, TXM, trustcache, ramdisk, device tree, SEP, and kernel.
# Kernel will panic after boot (no rootfs — expected).
# Boot chain only — no SSH, no CFW.
set -euo pipefail
IRECOVERY="${IRECOVERY:-irecovery}"
@@ -18,7 +18,7 @@ if [[ ! -d "$RAMDISK_DIR" ]]; then
fi
echo "[*] Sending testing boot chain from $RAMDISK_DIR ..."
echo " (no rootfs — kernel will panic after boot)"
echo " (boot chain only — no SSH, no CFW)"
# 1. Load iBSS + iBEC (DFU → recovery)
echo " [1/8] Loading iBSS..."
@@ -66,4 +66,4 @@ echo " [*] Booting kernel..."
"$IRECOVERY" -f "$RAMDISK_DIR/krnl.img4"
"$IRECOVERY" -c bootx
echo "[+] Boot sequence sent. Kernel should boot and then panic (no rootfs)."
echo "[+] Boot sequence sent."