[Fai-commit] r5265 - in trunk: bin debian

lange at alioth.debian.org lange at alioth.debian.org
Mon Feb 16 17:51:52 UTC 2009


Author: lange
Date: 2009-02-16 17:51:52 +0000 (Mon, 16 Feb 2009)
New Revision: 5265

Modified:
   trunk/bin/fai-cd
   trunk/debian/changelog
Log:
fai-cd: use a pipe when sending commands to grub

Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd	2009-02-16 13:03:27 UTC (rev 5264)
+++ trunk/bin/fai-cd	2009-02-16 17:51:52 UTC (rev 5265)
@@ -6,7 +6,7 @@
 # fai-cd -- make a fai CD, a bootable CD that performs the FAI
 #
 # This script is part of FAI (Fully Automatic Installation)
-# (c) 2004-2008 by Thomas Lange, lange at informatik.uni-koeln.de
+# (c) 2004-2009 by Thomas Lange, lange at informatik.uni-koeln.de
 # Universitaet zu Koeln
 #
 # based on a script called make-fai-bootcd by Niall Young <niall at holbytla.org>
@@ -30,7 +30,7 @@
 #*********************************************************************
 
 set -e 
-version="fai-cd 3.3.6, 10-sep-2008"
+version="fai-cd 3.3.7, 16-feb-2009"
 
 forceremoval=0;
 burn=0
@@ -146,15 +146,12 @@
 	echo $isoversion > $usbdir/.FAI-CD-VERSION
 
 	# now make the USB device bootable
-	rootpartition=$(find_fai_data | grep -A 1 'find /.FAI-CD-VERSION' | grep -v 'find /.FAI-CD-VERSION')
+	rootpartition=$(find_fai_data)
 	usbdev=$(echo $rootpartition | sed -e 's/,[[:digit:]]//')
 	echo "Root partition is $rootpartition, device is: $usbdev"
 	if [ -n "$rootpartition" -a -n "$usbdev" ]; then
 	    echo "Installing grub."
-	    grub --batch >/dev/null << EOM
-root $rootpartition
-setup $usbdev
-EOM
+	    echo -e "root $rootpartition\n setup $usbdev" | grub --batch >/dev/null
 	else
 	    echo "Device could not be detemined. Installing grub will be skipped."
 	fi
@@ -211,9 +208,8 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - -
 find_fai_data() {
 
-  grub --batch <<EOM
-find /.FAI-CD-VERSION
-EOM
+    # you must run this as root (otherwise you may get wrong device names
+    echo "find /.FAI-CD-VERSION" | grub --batch 2>/dev/null | grep '(hd'
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - -
 burniso() {

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-02-16 13:03:27 UTC (rev 5264)
+++ trunk/debian/changelog	2009-02-16 17:51:52 UTC (rev 5265)
@@ -2,6 +2,7 @@
 
   [ Thomas Lange ]
   * ainsl: add test if target file exists
+  * fai-cd: use a pipe when sending commands to grub
 
   [ Michael Tautschnig ]
   * setup-storage: Bumped version number to 1.0.4
@@ -52,7 +53,7 @@
     initialization of encrypted partitions configurable
   * setup-storage.8: Document new encryption possibilities
 
- -- Thomas Lange <lange at debian.org>  Mon, 16 Feb 2009 13:59:13 +0100
+ -- Thomas Lange <lange at debian.org>  Mon, 16 Feb 2009 18:51:36 +0100
 
 fai (3.2.16) unstable; urgency=high
 




More information about the Fai-commit mailing list