fix(mkimg): fix re-generate initramfs

Signed-off-by: Coelacanthus <coelacanthus@outlook.com>
This commit is contained in:
Coelacanthus 2022-07-28 17:10:24 +08:00
parent 6791623ab7
commit e0ff416204
No known key found for this signature in database
GPG key ID: E35C89E45867AE35

View file

@ -87,7 +87,6 @@ sudo arch-chroot qcow2 pacman \
--noconfirm \
-Syu linux linux-firmware dracut dracut-hook
sudo arch-chroot qcow2 dracut --force --add "qemu qemu-net" --regenerate-all
sudo mkdir -p qcow2/boot/extlinux
cat << EOF | sudo tee qcow2/boot/extlinux/extlinux.conf
menu title Arch RISC-V QEMU Boot
@ -101,6 +100,10 @@ label linux
append earlyprintk rw root=/dev/vda1 rootwait rootfstype=ext4 LANG=en_US.UTF-8 console=ttyS0
EOF
msg "Re-generate initramfs for QEMU..."
local kver=$(sudo arch-chroot qcow2 pacman -Si linux | grep -Po '(?<=Version : ).*')
sudo arch-chroot qcow2 dracut --force --add "qemu qemu-net" /boot/initramfs-linux.img ${kver/.arch/-arch}
msg "Clean up..."
msg2 "Clean up pacman package cache..."
yes y | sudo pacman \