X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_EFI%2F10-setup;fp=fai%2Fconfig%2Fscripts%2FGRUB_EFI%2F10-setup;h=24054e1727baf63a56c6c3cf87b853e432354cb1;hp=7dd92d4f000ebc8a44569cc4b7be5c11d66fb98a;hb=723056c40d38694c14d9bcb6b4a3108f7054a2a1;hpb=94a151efd665eb0214c2c85604b81377fb346de8 diff --git a/fai/config/scripts/GRUB_EFI/10-setup b/fai/config/scripts/GRUB_EFI/10-setup index 7dd92d4..24054e1 100755 --- a/fai/config/scripts/GRUB_EFI/10-setup +++ b/fai/config/scripts/GRUB_EFI/10-setup @@ -11,6 +11,11 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code # installation into the removable media paths as well as the standard # debian path. +# do only execute for Debian and similar distros +if ! ifclass DEBIAN ; then + exit 0 +fi + set -a # do not set up grub during dirinstall @@ -41,28 +46,35 @@ if [ "${_bdev%%-*}" = "/dev/dm" ]; then BOOT_DEVICE=$( lvs --noheadings -o devices $BOOT_DEVICE | sed -e 's/^*\([^(]*\)(.*$/\1/' ) fi +opts="--no-floppy --target=x86_64-efi --modules=part_gpt" + # Check if RAID is used for the boot device if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then raiddev=${BOOT_DEVICE#/dev/} # install grub on all members of RAID for device in $(LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat); do echo Install grub on /dev/$device - $ROOTCMD grub-install --no-floppy --force-extra-removable "/dev/$device" + $ROOTCMD grub-install $opts --force-extra-removable "/dev/$device" done elif [[ $BOOT_DEVICE =~ '/dev/loop' ]]; then # do not update vmram when using a loop device - $ROOTCMD grub-install --no-floppy --force-extra-removable --modules=part_gpt --no-nvram $BOOT_DEVICE + $ROOTCMD grub-install $opts --force-extra-removable --no-nvram $BOOT_DEVICE if [ $? -eq 0 ]; then echo "Grub installed on hostdisk $BOOT_DEVICE" fi else - $ROOTCMD grub-install --no-floppy --modules=part_gpt "$GROOT" + $ROOTCMD grub-install $opts "$GROOT" if [ $? -eq 0 ]; then echo "Grub installed on $BOOT_DEVICE = $GROOT" fi fi $ROOTCMD update-grub +if [[ $BOOT_DEVICE =~ '/dev/loop' ]]; then + : +else + efibootmgr -v +fi exit $error