X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_PC%2F10-setup;h=160dfa2e35fd05333a5b98a895b90e826818aa72;hb=7386cdbee20dd73095264e2ad0ead433f97ac946;hp=c945daf93ba16899476ea4c7335028e6b7648c99;hpb=3bd65f0ca635f1349626c2393a4dd8a50df64f54;p=automated-distro-installer diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup index c945daf..160dfa2 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 @@ -21,21 +26,36 @@ if [ $FAI_ACTION != "install" ]; then 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 + GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE) 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 "/dev/$device" done -else - $ROOTCMD grub-install --no-floppy "$GROOT" + +elif [[ $GROOT =~ 'hostdisk' ]]; then + cat > $target/boot/grub/device.map <