various fixes, improve flidas
[automated-distro-installer] / fai / config / scripts / GRUB_PC / 10-setup
index 160dfa2e35fd05333a5b98a895b90e826818aa72..00829e110a7ecc3acff8ab60f789c4a9c3e9481c 100755 (executable)
@@ -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,7 +26,7 @@ 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
@@ -39,15 +40,12 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
     done
 
 elif [[ $GROOT =~ 'hostdisk' ]]; then
-    cat > $target/boot/grub/device.map <<EOF
-(hd0)   $BOOT_DEVICE
-EOF
-    $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE
-    if [ $? -eq 0 ]; then
-        echo "Grub installed on hostdisk $BOOT_DEVICE"
-    fi
-    rm $target/boot/grub/device.map
-
+    for dev in $BOOT_DEVICE; do
+        $ROOTCMD grub-install --no-floppy --modules=part_msdos $dev
+        if [ $? -eq 0 ]; then
+            echo "Grub installed on hostdisk $BOOT_DEVICE"
+        fi
+    done
 else
     for dev in $BOOT_DEVICE; do
         GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)