From 00c4914b7b9a4afdab47fc5a138e710e8e2c2e0d Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Mon, 27 Jul 2026 08:34:02 -0400 Subject: [PATCH] Fix ARM64 boot: install official archiso mkinitcpio hooks into airootfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The archiso mkinitcpio hooks live in initcpio/ at the repo root, not in configs/releng/airootfs/ — so they were never in the ISO airootfs chroot. ALARM has no archiso package either, so the chroot's mkinitcpio found no archiso hook, built an initramfs without mount_handler logic, and the default handler fired at boot with empty root= → "Failed to mount ''". Dockerfile.arm64: preserve the official hooks from initcpio/ into /usr/share/archiso/initcpio/ instead of deleting them with the repo. entrypoint-arm64.sh: explicitly install the official hooks into the airootfs overlay so the chroot mkinitcpio finds them when building the initramfs. The official hooks use uname -m for arch detection and include all required modules/binaries for squashfs live boot. Co-Authored-By: Claude Sonnet 4.6 --- iso/docker/Dockerfile.arm64 | 12 ++++++++---- iso/docker/entrypoint-arm64.sh | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/iso/docker/Dockerfile.arm64 b/iso/docker/Dockerfile.arm64 index f5305ca..1a08006 100644 --- a/iso/docker/Dockerfile.arm64 +++ b/iso/docker/Dockerfile.arm64 @@ -56,13 +56,17 @@ RUN pacman -Syu --noconfirm && \ && pacman -Scc --noconfirm # Install archiso from upstream source (not packaged for aarch64 in ALARM). -# Manually copy the three things mkarchiso needs — skip 'make install' because -# it tries to build man pages with rst2man which isn't available. +# Manually copy what mkarchiso needs — skip 'make install' (requires rst2man). +# Also preserve the mkinitcpio hooks from initcpio/ so the entrypoint can +# install them into the ISO airootfs (the chroot has no archiso package, so +# the hooks must come from the airootfs overlay for mkinitcpio to use them). RUN git clone --depth=1 https://gitlab.archlinux.org/archlinux/archiso.git /tmp/archiso && \ - install -Dm755 /tmp/archiso/archiso/mkarchiso /usr/bin/mkarchiso && \ - install -Dm755 /tmp/archiso/scripts/run_archiso.sh /usr/bin/run_archiso && \ + install -Dm755 /tmp/archiso/archiso/mkarchiso /usr/bin/mkarchiso && \ + install -Dm755 /tmp/archiso/scripts/run_archiso.sh /usr/bin/run_archiso && \ install -d /usr/share/archiso && \ cp -a /tmp/archiso/configs /usr/share/archiso/ && \ + install -Dm644 /tmp/archiso/initcpio/hooks/archiso /usr/share/archiso/initcpio/hooks/archiso && \ + install -Dm644 /tmp/archiso/initcpio/install/archiso /usr/share/archiso/initcpio/install/archiso && \ rm -rf /tmp/archiso # Pre-download linux-aarch64 and create a local pacman repo so mkarchiso diff --git a/iso/docker/entrypoint-arm64.sh b/iso/docker/entrypoint-arm64.sh index 0a0a23c..ab6d5a8 100755 --- a/iso/docker/entrypoint-arm64.sh +++ b/iso/docker/entrypoint-arm64.sh @@ -146,11 +146,15 @@ rm -f "$PROFILE/packages.x86_64" # ── 3. airootfs overlay — files that land in the live system ───────── AIROOTFS="$PROFILE/airootfs" -# The releng profile already ships official archiso mkinitcpio hooks at -# $PROFILE/airootfs/usr/lib/initcpio/{hooks,install}/archiso. -# Do NOT overwrite them — the official hooks handle uname -m arch detection, -# correct squashfs paths, all required modules/binaries, and mount_handler -# wiring. Our simplified custom hooks were causing "sbin/init not found". +# The archiso mkinitcpio hooks live in initcpio/ of the archiso git repo, +# NOT in configs/releng/airootfs/ — so they aren't picked up by the releng +# profile copy above. The ISO airootfs chroot has no archiso package either +# (ALARM doesn't package it), so the hooks must be placed here explicitly. +# The Dockerfile preserved the official hooks at /usr/share/archiso/initcpio/. +mkdir -p "$AIROOTFS/usr/lib/initcpio/hooks" "$AIROOTFS/usr/lib/initcpio/install" +install -m755 /usr/share/archiso/initcpio/hooks/archiso "$AIROOTFS/usr/lib/initcpio/hooks/archiso" +install -m755 /usr/share/archiso/initcpio/install/archiso "$AIROOTFS/usr/lib/initcpio/install/archiso" +echo ">>> Official archiso mkinitcpio hooks installed into airootfs" mkdir -p "$AIROOTFS/etc/mkinitcpio.conf.d" cat > "$AIROOTFS/etc/mkinitcpio.conf.d/archiso.conf" <<'MKCONF'