Skip to content

Commit

Permalink
move first grub-install into else part
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Jul 11, 2014
1 parent 95cbcfd commit c1f90d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/simple/scripts/GRUB_PC/10-setup
Expand Up @@ -16,20 +16,15 @@ if [ $FAI_ACTION != "install" ]; then
exit $error
fi

$ROOTCMD grub-mkdevicemap --no-floppy
GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
$ROOTCMD grub-install --no-floppy "$GROOT"
if [ $? -eq 0 ]; then
echo "Grub installed on $BOOT_DEVICE = $GROOT"
fi

# check if mdadm has been forgotten
if grep -q active /proc/mdstat 2>/dev/null; then
if [ ! -d $target/etc/mdadm ]; then
echo WARNING: Found Software RAID, but mdadm was not installed
fi
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
Expand All @@ -39,6 +34,11 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
echo Install grub on /dev/$device
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
else
$ROOTCMD grub-install --no-floppy "$GROOT"
if [ $? -eq 0 ]; then
echo "Grub installed on $BOOT_DEVICE = $GROOT"
fi
fi

exit $error

0 comments on commit c1f90d1

Please sign in to comment.