From 49a86cc303c84ee0b2979f7bd4ba3ada3be4023a Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Mon, 26 May 2025 16:25:08 +0200 Subject: [PATCH] initfs: fix ls and init chroot We don't always have an initramfs-extra anymore, implement the deviceinfo check for this. Also ensure we init the chroot before trying to use it. Signed-off-by: Casey Connolly --- pmb/chroot/initfs.py | 6 ++++-- pmb/parse/deviceinfo.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pmb/chroot/initfs.py b/pmb/chroot/initfs.py index 5899caa2..887d6e0a 100644 --- a/pmb/chroot/initfs.py +++ b/pmb/chroot/initfs.py @@ -90,6 +90,7 @@ def frontend(args: PmbArgs) -> None: # Find the appropriate kernel flavor context = get_context() chroot = Chroot.rootfs(context.config.device) + pmb.chroot.init(chroot) flavor = pmb.chroot.other.kernel_flavor_installed(chroot) # Handle initfs actions @@ -104,8 +105,9 @@ def frontend(args: PmbArgs) -> None: elif action == "ls": logging.info("*** initramfs ***") ls(flavor, chroot) - logging.info("*** initramfs-extra ***") - ls(flavor, chroot, True) + if pmb.parse.deviceinfo().create_initfs_extra: + logging.info("*** initramfs-extra ***") + ls(flavor, chroot, True) # Handle hook actions elif action == "hook_ls": diff --git a/pmb/parse/deviceinfo.py b/pmb/parse/deviceinfo.py index 1b864d81..7f71d5c3 100644 --- a/pmb/parse/deviceinfo.py +++ b/pmb/parse/deviceinfo.py @@ -114,6 +114,7 @@ class Deviceinfo: dev_touchscreen: str | None = "" dev_touchscreen_calibration: str | None = "" append_dtb: str | None = "" + create_initfs_extra: str | None # bootloader flash_method: str = ""