[Fai-commit] r6771 - trunk/bin

Michael Prokop mika at alioth.debian.org
Mon Oct 24 12:36:34 UTC 2011


Author: mika
Date: 2011-10-24 12:36:33 +0000 (Mon, 24 Oct 2011)
New Revision: 6771

Modified:
   trunk/bin/make-fai-nfsroot
Log:
make-fai-nfsroot: do not error out if grep on mount output fails in umount_dirs()

Since we're running under 'set -e' the "mount | grep ..." will
cause the script to fail if grep doesn't match. It will error out
without noticing the user about it. So instead make sure the
'mkramdisk -u' is executed whenever the "mount | grep" matches,
otherwise continue with the rest of the umount_dirs() function.

From: Michael Prokop <mika at grml.org>

Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2011-10-24 12:36:28 UTC (rev 6770)
+++ trunk/bin/make-fai-nfsroot	2011-10-24 12:36:33 UTC (rev 6771)
@@ -449,9 +449,8 @@
     [ -d $NFSROOT/proc/self ] && die 1 "/proc still mounted inside the nfsroot."
     umount $NFSROOT/dev/pts 2> /dev/null || true
 
-    mount | grep -q "on $NFSROOT/var/lib/dpkg type tmpfs"
-    if [ $? -eq 0 ]; then
-	/usr/lib/fai/mkramdisk -u $NFSROOT/var/lib/dpkg
+    if mount | grep -q "on $NFSROOT/var/lib/dpkg type tmpfs" ; then
+        /usr/lib/fai/mkramdisk -u $NFSROOT/var/lib/dpkg
     fi
 
     if [ -n "$FAI_DEBMIRROR" ]; then




More information about the Fai-commit mailing list