[Fai-commit] r6752 - in trunk: bin man

Michael Prokop mika at alioth.debian.org
Sun Oct 23 08:33:29 UTC 2011


Author: mika
Date: 2011-10-23 08:33:28 +0000 (Sun, 23 Oct 2011)
New Revision: 6752

Modified:
   trunk/bin/make-fai-nfsroot
   trunk/man/make-fai-nfsroot.8
Log:
make-fai-nfsroot: do not overwrite existing nfsroot by default, use option -f to force overwriting

Team reviewed via beamer at FAI developer workshop, Oct 2011.

Acked-by: Thomas Lange

From: Michael Prokop <mika at grml.org>

Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2011-10-22 23:45:19 UTC (rev 6751)
+++ trunk/bin/make-fai-nfsroot	2011-10-23 08:33:28 UTC (rev 6752)
@@ -85,9 +85,10 @@
 sshpreserve=0
 adjust=0
 generic=0
+force=0
 
 # option e currently does nothing
-while getopts aghervC:B:f:kKpU opt ; do
+while getopts aghervC:B:fkKpU opt ; do
     case "$opt" in
         a) adjust=1 ;;
         g) generic=1 ;;
@@ -96,7 +97,7 @@
         v) verbose=1 ; v=-v ;;
         U) die 1 "Option -U is not supported any more." ;;
         r) die 1 "Option -r is not supported any more." ;;
-        f) die 1 "Option -f is not supported any more. Use option -C instead" ;;
+        f) force=1 ;;
         k) kinstall=1 ;;
         K) kremove=1;;
         h) usage ;;
@@ -526,6 +527,16 @@
 [ "$verbose" ] && echo "Using configuration files from $cfdir" > /var/log/fai/make-fai-nfsroot.log
 
 {
+if [ -d $NFSROOT ] && [ "$force" -ne 1 ] ; then
+    echo "-----------------------------------------------------------------"
+    echo "Error: $NFSROOT exists already." >&2
+    echo "Neither force nor update option present, exiting." >&2
+    echo "-----------------------------------------------------------------"
+    echo "NOTE: Use -f option to force overwriting an existing nfsroot."
+    echo "      Use -k option to update/install packages defined in NFSROOT config."
+    exit 1
+fi
+
 echo "Creating FAI nfsroot in $NFSROOT."
 echo "This may take a long time."
 

Modified: trunk/man/make-fai-nfsroot.8
===================================================================
--- trunk/man/make-fai-nfsroot.8	2011-10-22 23:45:19 UTC (rev 6751)
+++ trunk/man/make-fai-nfsroot.8	2011-10-23 08:33:28 UTC (rev 6752)
@@ -46,8 +46,12 @@
 Use CFDIR as configuration directory. Default is /etc/fai. You can
 also set the environment variable FAI_ETC_DIR.
 .TP
-.B \-f config_file
-Not supported any more. Use option \-C instead.
+.B \-f
+Force overwriting an existing nfsroot. By default make-fai-nfsroot aborts
+if the configuration variable NFSROOT points to a directory which already
+exists. To force overwriting (and therefore rebuilding) the existing nfsroot
+use this option. This option is supported starting with FAI 4.0.
+Note: To update and therefore preserve an existing nfsroot see option \-k.
 .TP
 .B \-K
 Remove all kernels from NFSROOT. This is the same as calling aptitude




More information about the Fai-commit mailing list