a251c6358e19247ae2e682b96ec2160e94274553 — Conrad Hoffmann 29 days ago a8ddf38
archlinux: fix initramfs generation

The preset that mkinitcpio is called with is only generated by the hook
that is being disabled, so the initramfs cannot be generated.

Instead, re-install linux before disabling the hook, causing it to be
called once, generating both the preset file as well as running
mkinitcpio for us.
1 files changed, 7 insertions(+), 4 deletions(-)

M images/archlinux/genimg
M images/archlinux/genimg => images/archlinux/genimg +7 -4
@@ 63,9 63,6 @@ cp pacman.conf $root/etc

reflector --protocol https --latest 30 --sort rate --save $root/etc/pacman.d/mirrorlist

mkdir -p $root/etc/pacman.d/hooks/
ln -s /dev/null $root/etc/pacman.d/hooks/90-mkinitcpio-install.hook

run_root pacman-key --init
run_root pacman-key --populate archlinux
run_root pacman -Sy

@@ 85,7 82,13 @@ EOF
run_root systemctl enable systemd-networkd.service
run_root systemctl enable systemd-timesyncd.service

run_root mkinitcpio -p linux
# Triggers the hook that generates linux.preset and runs mkinitcpio, too
run_root pacman -S linux

# Make sure the hook never runs again, it's result will never be used and it
# just causes delays.
mkdir -p $root/etc/pacman.d/hooks/
ln -s /dev/null $root/etc/pacman.d/hooks/90-mkinitcpio-install.hook

run_root groupadd sudo
run_root useradd -mG sudo,kvm build