package-image: keep MT6797 firmware blobs by default

This commit is contained in:
Luxferre committed 2026-11-28 11:19:38 +02:00
1 parent 29314ca9e6
commit 561dc2633b
4 files changed
+34 -9

No files matched your search

+24 -1
View File
@@ -927,11 +927,34 @@ def test_release_zip_packager():
sanitized_img = os.path.join(rel_dir, "images", "geminux-rootfs.img")
assert subprocess.run(["e2fsck", "-fn", sanitized_img], capture_output=True).returncode == 0
fw_mod = flash_mtk.load_firmware_module()
assert fw_mod.debugfs_ls(sanitized_img, "lib/firmware/mediatek/mt6797") == []
fw_entries = set(fw_mod.debugfs_ls(sanitized_img, "lib/firmware/mediatek/mt6797"))
assert {"WIFI_RAM_CODE_6797", "MANIFEST.sha256"}.issubset(fw_entries), (
f"Default package-image.sh must keep MT6797 firmware blobs; got {sorted(fw_entries)}"
)
assert [n for n, _m in pkg_mod._debugfs_ls_details(sanitized_img, "etc/ssh") if n.startswith("ssh_host_")] == []
assert "sshd_config" in fw_mod.debugfs_ls(sanitized_img, "etc/ssh")
assert not fw_mod._debugfs_path_exists(sanitized_img, "/root/.ssh/authorized_keys")
assert not fw_mod._debugfs_path_exists(sanitized_img, "/home/user/.ssh/authorized_keys")
stripped_zip = os.path.join(tmp, "geminux-0.1.0-helio-gemini-x27-stripped.zip")
sres = subprocess.run(
[
os.path.join(BASE_DIR, "package-image.sh"),
"--images-dir", img_dir,
"--output", stripped_zip,
"--version", "0.1.0",
"--codename", "helio",
"--strip-firmware",
],
capture_output=True, text=True, check=False,
)
assert sres.returncode == 0, f"package-image.sh --strip-firmware failed:\n{sres.stdout}\n{sres.stderr}"
strip_dir = os.path.join(tmp, "extracted-stripped")
os.makedirs(strip_dir, exist_ok=True)
subprocess.run(["unzip", "-q", stripped_zip, "-d", strip_dir], check=True)
stripped_img = os.path.join(strip_dir, top, "images", "geminux-rootfs.img")
assert subprocess.run(["e2fsck", "-fn", stripped_img], capture_output=True).returncode == 0
assert fw_mod.debugfs_ls(stripped_img, "lib/firmware/mediatek/mt6797") == []
print("[PASS] Release ZIP packager (sanitized rootfs, FLASH-INSTRUCTIONS.txt, SHA256SUMS, runnable flasher) verified")