X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_PC%2F10-setup;h=47b3ba49195db9c0978482e5e6350f5e71368ffb;hb=175cf089388948672b5b4b6f9a8cf5a96a7015f2;hp=88b557ea694876147a48fdfceef7ec3f4f743b40;hpb=1aa7c3f936508df692bf5f434a338855439fbec5;p=automated-distro-installer diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup index 88b557e..47b3ba4 100755 --- a/fai/config/scripts/GRUB_PC/10-setup +++ b/fai/config/scripts/GRUB_PC/10-setup @@ -4,6 +4,11 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code set -a + +# do not set up grub during dirinstall +if [ "$FAI_ACTION" = "dirinstall" ] ; then + exit 0 +fi # during softupdate use this file [ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh @@ -20,7 +25,8 @@ if [ $FAI_ACTION != "install" ]; then exit $error fi -$ROOTCMD grub-mkdevicemap --no-floppy +GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE) + # Check if RAID is used for the boot device if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then @@ -31,6 +37,13 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then echo Install grub on /dev/$device $ROOTCMD grub-install --no-floppy "/dev/$device" done + +elif [[ $GROOT =~ 'hostdisk' ]]; then + $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE + if [ $? -eq 0 ]; then + echo "Grub installed on hostdisk $BOOT_DEVICE" + fi + else for dev in $BOOT_DEVICE; do GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)