From ebe45dc3dfb80b41ea57767f87060268ecdba2af Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Feb 2022 19:26:55 +0100 Subject: [PATCH] alpine: enhance uefi support --- alpine-install-on-disk.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/alpine-install-on-disk.sh b/alpine-install-on-disk.sh index 43e0e05..a135c6b 100755 --- a/alpine-install-on-disk.sh +++ b/alpine-install-on-disk.sh @@ -138,10 +138,22 @@ EOF # Setup bootloader -run_root apk add grub-bios +run_root apk add grub-bios grub-efi echo 'GRUB_CMDLINE_LINUX_DEFAULT="quiet rootfstype=ext4"' >> ${rootfs_tmpdir}/etc/default/grub run_root grub-mkconfig -o /boot/grub/grub.cfg -run_root grub-install --target=i386-pc ${DISK} + +case "$BOOT_VIA" in + bios) + run_root grub-install --target=i386-pc ${DISK} + ;; + efi) + run_root grub-install --efi-directory=/boot --no-nvram + run_root mkdir /boot/EFI/boot + run_root cp /boot/EFI/alpine/grubx64.efi /boot/EFI/boot/bootx64.efi + run_root cp /boot/grub/grub.cfg /boot/EFI/boot/ + ;; +esac + # Cleanup run_root rm -f /etc/resolv.conf