Fix archiso hook path: search rather than assume repo layout
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
00c4914b7b
commit
629f16537e
2 files changed
+28
-12
No files matched your search
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user