X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_PC%2F10-setup;h=a78df0cb408dfa5b8b6b18773bfa7fbc80c7bb4e;hb=3d9cc96092cdc8aa05bc95cf83c07bb1af692013;hp=160dfa2e35fd05333a5b98a895b90e826818aa72;hpb=da61a304a10de72288782a9d872769fe44576f50;p=automated-distro-installer diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup index 160dfa2..a78df0c 100755 --- a/fai/config/scripts/GRUB_PC/10-setup +++ b/fai/config/scripts/GRUB_PC/10-setup @@ -3,6 +3,7 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code +set -x set -a # do not set up grub during dirinstall @@ -25,8 +26,13 @@ if [ $FAI_ACTION != "install" ]; then exit $error fi -$ROOTCMD grub-mkdevicemap --no-floppy +GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE) +# handle /boot in lvm-on-md +_bdev=$(readlink -f $BOOT_DEVICE) +if [ "${_bdev%%-*}" = "/dev/dm" ]; then + BOOT_DEVICE=$( lvs --noheadings -o devices $BOOT_DEVICE | sed -e 's/^*\([^(]*\)(.*$/\1/' ) +fi # Check if RAID is used for the boot device if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then @@ -37,17 +43,6 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then echo Install grub on /dev/$device $ROOTCMD grub-install --no-floppy "/dev/$device" done - -elif [[ $GROOT =~ 'hostdisk' ]]; then - cat > $target/boot/grub/device.map <