Skip to content

Commit

Permalink
special treatment if a disk image is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Jul 27, 2016
1 parent 15e8fb1 commit 4bb9ec4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/simple/scripts/GRUB_PC/10-setup
Expand Up @@ -23,6 +23,7 @@ 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
raiddev=${BOOT_DEVICE#/dev/}
Expand All @@ -31,6 +32,17 @@ 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 <<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

else
$ROOTCMD grub-install --no-floppy "$GROOT"
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit 4bb9ec4

Please sign in to comment.