[Fai-commit] r6681 - trunk/bin

Thomas Lange lange at alioth.debian.org
Mon Oct 10 13:12:14 UTC 2011


Author: lange
Date: 2011-10-10 13:12:13 +0000 (Mon, 10 Oct 2011)
New Revision: 6681

Modified:
   trunk/bin/make-fai-nfsroot
Log:
code cleanup


Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2011-10-09 20:56:40 UTC (rev 6680)
+++ trunk/bin/make-fai-nfsroot	2011-10-10 13:12:13 UTC (rev 6681)
@@ -136,8 +136,12 @@
 oldnfsroot=$NFSROOT
 NFSROOT="$NFSROOT/live/filesystem.dir"
 ROOTCMD="chroot $NFSROOT"
-
 export DEBIAN_FRONTEND=noninteractive
+
+usexz=0
+if [ -x "$(which xz)" ]; then
+    usexz=1
+fi
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 bad_exit() {
 
@@ -241,7 +245,7 @@
     ainsl     $NFSROOT/etc/hosts "$NFSROOT_ETC_HOSTS"
 
     # add entries for all network devices
-local ips=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
+    local ips=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
     for eth in $ips; do
 	getent hosts $eth >> etc/hosts || true
     done
@@ -249,6 +253,7 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 create_base() {
 
+    [ ! -x "$(which debootstrap)" ] && die 1 "Can't find debootstrap command. Aborting."
     call_debootstrap $FAI_DEBOOTSTRAP
     $ROOTCMD apt-get clean
     rm -f $NFSROOT/etc/resolv.conf $NFSROOT/etc/hostname $NFSROOT/etc/udev/rules.d/70-persistent-net.rules
@@ -455,12 +460,6 @@
 trap 'echo "Aborting";umount_dirs' EXIT
 trap "bad_exit" ERR
 
-# repeat message, so it will appear in the log file
-[ "$verbose" ] && echo "Using configuration files from $cfdir" > /var/log/fai/make-fai-nfsroot.log
-
-{
-
-
 # remove all kernels from nfsroot
 [ -n "$kremove" ] && {
     echo "Removing all kernels from NFSROOT."
@@ -483,6 +482,10 @@
     exit 0
 }
 
+# repeat message, so it will appear in the log file
+[ "$verbose" ] && echo "Using configuration files from $cfdir" > /var/log/fai/make-fai-nfsroot.log
+
+{
 echo "Creating FAI nfsroot in $NFSROOT."
 echo "This may take a long time."
 
@@ -505,16 +508,7 @@
     nice rm -rf $oldnfsroot/.will-now-be-deleted & 
 fi
 
-# Create a new nfsroot
-[ ! -x "$(which debootstrap)" ] && die 1 "Can't find debootstrap command. Aborting."
-
-usexz=0
-if [ -x "$(which xz)" ]; then
-    usexz=1
-fi
-
 create_nfsroot
-kernel_install
 run_hooks
 check_nfsroot
 umount_dirs




More information about the Fai-commit mailing list