[Fai-commit] r6182 - trunk/bin
Thomas Lange
lange at alioth.debian.org
Fri Nov 5 14:38:45 UTC 2010
Author: lange
Date: 2010-11-05 14:38:38 +0000 (Fri, 05 Nov 2010)
New Revision: 6182
Modified:
trunk/bin/fai-cd
Log:
write MBR when using grub2 (closes: #597479)
Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd 2010-11-05 11:27:03 UTC (rev 6181)
+++ trunk/bin/fai-cd 2010-11-05 14:38:38 UTC (rev 6182)
@@ -242,6 +242,8 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - -
mkusb(){
+ local device
+
[ $makeusb -eq 0 ] && return
# TODO: If usbdir is a device (matches /dev/) mount it
@@ -257,7 +259,10 @@
fi
echo $isoversion > $usbdir/.FAI-CD-VERSION
- # now make the USB device bootable
+
+ if [ "$grub_version" -eq 1 ]; then
+
+ # now make the USB device bootable (grub1)
rootpartition=$(find_fai_data)
usbdev=$(echo $rootpartition | sed -e 's/,[[:digit:]]//')
echo "Root partition is $rootpartition, device is: $usbdev"
@@ -267,6 +272,14 @@
else
echo "Device could not be detemined. Installing grub will be skipped."
fi
+
+ elif [ "$grub_version" -eq 2 ]; then
+ # detect device of mounted usb stick, grub2
+ device=$(grub-probe -tdrive $usbdir | perl -ane 'm#(/dev/\w+),# && print "$1\n"')
+ echo "Installing grub2 to $device."
+ # this call seems to remove file and copies them again onto the stick
+ grub-install --no-floppy --root-directory=$usbdir $device
+ fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - -
create_iso() {
More information about the Fai-commit
mailing list