From 9159626cff6d162999685bfc38abce8851fe4dec Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Mon, 31 Aug 2026 12:05:41 -0400 Subject: [PATCH] Fix archiso initcpio hook: use run_hook+mount_handler override run_latehook fires after mkinitcpio already attempts to mount root= (empty), which fails. Switch to run_hook() setting mount_handler=archiso_mount_handler so mkinitcpio calls our handler instead of the default block-device mount. Co-Authored-By: Claude Sonnet 4.6 --- .../airootfs/usr/lib/initcpio/hooks/archiso | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso b/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso index 10e77c0..f2f3970 100644 --- a/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso +++ b/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso @@ -1,7 +1,7 @@ #!/usr/bin/ash -# Live-boot hook: find ISO by UUID, mount squashfs, set up overlay on /new_root. -run_latehook() { +archiso_mount_handler() { + local _new_root="$1" local _uuid _basedir _dev _img _uuid="$(getarg archisosearchuuid=)" @@ -13,7 +13,6 @@ run_latehook() { return 1 fi - # Wait up to 30 s for a block device with the ISO UUID to appear local _waited=0 while [ "${_waited}" -lt 30 ]; do _dev="$(blkid -l -o device -t UUID="${_uuid}" 2>/dev/null)" @@ -41,15 +40,17 @@ run_latehook() { mkdir -p /run/archiso/airootfs mount -r -t squashfs "${_img}" /run/archiso/airootfs || { echo "archiso: squashfs mount failed"; return 1; } - # RAM-backed writable overlay layer mkdir -p /run/archiso/overlay mount -t tmpfs tmpfs -o mode=0755 /run/archiso/overlay mkdir -p /run/archiso/overlay/upper /run/archiso/overlay/work - mkdir -p /new_root mount -t overlay overlay \ -o lowerdir=/run/archiso/airootfs,upperdir=/run/archiso/overlay/upper,workdir=/run/archiso/overlay/work \ - /new_root || { echo "archiso: overlay mount failed"; return 1; } + "${_new_root}" || { echo "archiso: overlay mount failed"; return 1; } - echo "archiso: live root mounted on /new_root" + echo "archiso: live root mounted on ${_new_root}" +} + +run_hook() { + mount_handler="archiso_mount_handler" }