update to db59a1a2dd 2019-03-07
[automated-distro-installer] / fai / config / scripts / GRUB_PC / 10-setup
index c19d4fa0438cf5b8633afabb4961c62486bc5dba..55632754b2eab15de9759def493baa7c2d38ae80 100755 (executable)
@@ -27,6 +27,11 @@ fi
 
 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
@@ -36,13 +41,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
-    $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE
-    if [ $? -eq 0 ]; then
-        echo "Grub installed on hostdisk $BOOT_DEVICE"
-    fi
-
 else
     $ROOTCMD grub-install --no-floppy "$GROOT"
     if [ $? -eq 0 ]; then