From 629f16537ec899eed680f4459ad3e79ec5444c3f Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Mon, 27 Jul 2026 08:36:15 -0400 Subject: [PATCH] Fix archiso hook path: search rather than assume repo layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hooks are NOT at initcpio/hooks/archiso in the archiso git repo root (that path doesn't exist). Remove the broken install lines from Dockerfile and instead add a find diagnostic during build to reveal the actual paths. entrypoint: use find to locate the hooks dynamically under /usr/share/archiso (the releng airootfs copy) instead of hardcoding a path — bail with a clear error listing if nothing is found. Co-Authored-By: Claude Sonnet 4.6 --- iso/docker/Dockerfile.arm64 | 8 ++++---- iso/docker/entrypoint-arm64.sh | 32 ++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/iso/docker/Dockerfile.arm64 b/iso/docker/Dockerfile.arm64 index 1a08006..e9213e6 100644 --- a/iso/docker/Dockerfile.arm64 +++ b/iso/docker/Dockerfile.arm64 @@ -61,12 +61,12 @@ RUN pacman -Syu --noconfirm && \ # 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 && \ + echo "=== archiso hook locations ===" && \ + find /tmp/archiso -name "archiso" -not -path "*/\.git/*" | sort && \ 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 ab6d5a8..309b98f 100755 --- a/iso/docker/entrypoint-arm64.sh +++ b/iso/docker/entrypoint-arm64.sh @@ -146,15 +146,31 @@ rm -f "$PROFILE/packages.x86_64" # ── 3. airootfs overlay — files that land in the live system ───────── AIROOTFS="$PROFILE/airootfs" -# 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/. +# The archiso mkinitcpio hooks must be in the airootfs chroot so mkinitcpio +# can build a working initramfs. ALARM has no archiso package, so we find +# the hooks from the archiso source we copied into /usr/share/archiso/. 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" + +_find_hook() { + # Try releng airootfs first, then any other location under /usr/share/archiso + local name="$1" + local found + found=$(find /usr/share/archiso -path "*/initcpio/${name}/archiso" | head -1) + echo "${found}" +} + +_hook_runtime=$(_find_hook "hooks") +_hook_install=$(_find_hook "install") + +if [[ -n "$_hook_runtime" && -n "$_hook_install" ]]; then + install -m755 "$_hook_runtime" "$AIROOTFS/usr/lib/initcpio/hooks/archiso" + install -m755 "$_hook_install" "$AIROOTFS/usr/lib/initcpio/install/archiso" + echo ">>> Official archiso mkinitcpio hooks installed (from $_hook_runtime)" +else + echo "ERROR: archiso mkinitcpio hooks not found under /usr/share/archiso — listing:" + find /usr/share/archiso -name "archiso" 2>/dev/null | sort + exit 1 +fi mkdir -p "$AIROOTFS/etc/mkinitcpio.conf.d" cat > "$AIROOTFS/etc/mkinitcpio.conf.d/archiso.conf" <<'MKCONF'