Fix ARM64 boot: install official archiso mkinitcpio hooks into airootfs

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 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-07-27 08:34:02 -04:00
1 parent 22b311790e
commit 00c4914b7b
2 files changed
+17 -9

No files matched your search

+8 -4
View File
@@ -56,13 +56,17 @@ RUN pacman -Syu --noconfirm && \
&& pacman -Scc --noconfirm && pacman -Scc --noconfirm
# Install archiso from upstream source (not packaged for aarch64 in ALARM). # Install archiso from upstream source (not packaged for aarch64 in ALARM).
# Manually copy the three things mkarchiso needs — skip 'make install' because # Manually copy what mkarchiso needs — skip 'make install' (requires rst2man).
# it tries to build man pages with rst2man which isn't available. # 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 && \ 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/archiso/mkarchiso /usr/bin/mkarchiso && \
install -Dm755 /tmp/archiso/scripts/run_archiso.sh /usr/bin/run_archiso && \ install -Dm755 /tmp/archiso/scripts/run_archiso.sh /usr/bin/run_archiso && \
install -d /usr/share/archiso && \ install -d /usr/share/archiso && \
cp -a /tmp/archiso/configs /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 rm -rf /tmp/archiso
# Pre-download linux-aarch64 and create a local pacman repo so mkarchiso # Pre-download linux-aarch64 and create a local pacman repo so mkarchiso
+9 -5
View File
@@ -146,11 +146,15 @@ rm -f "$PROFILE/packages.x86_64"
# ── 3. airootfs overlay — files that land in the live system ───────── # ── 3. airootfs overlay — files that land in the live system ─────────
AIROOTFS="$PROFILE/airootfs" AIROOTFS="$PROFILE/airootfs"
# The releng profile already ships official archiso mkinitcpio hooks at # The archiso mkinitcpio hooks live in initcpio/ of the archiso git repo,
# $PROFILE/airootfs/usr/lib/initcpio/{hooks,install}/archiso. # NOT in configs/releng/airootfs/ — so they aren't picked up by the releng
# Do NOT overwrite them — the official hooks handle uname -m arch detection, # profile copy above. The ISO airootfs chroot has no archiso package either
# correct squashfs paths, all required modules/binaries, and mount_handler # (ALARM doesn't package it), so the hooks must be placed here explicitly.
# wiring. Our simplified custom hooks were causing "sbin/init not found". # 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" mkdir -p "$AIROOTFS/etc/mkinitcpio.conf.d"
cat > "$AIROOTFS/etc/mkinitcpio.conf.d/archiso.conf" <<'MKCONF' cat > "$AIROOTFS/etc/mkinitcpio.conf.d/archiso.conf" <<'MKCONF'