update to db59a1a2dd 2019-03-07
[automated-distro-installer] / fai / config / scripts / GRUB_PC / 10-setup
index c945daf93ba16899476ea4c7335028e6b7648c99..55632754b2eab15de9759def493baa7c2d38ae80 100755 (executable)
@@ -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,9 +25,14 @@ 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
     raiddev=${BOOT_DEVICE#/dev/}