[Fai-commit] r4573 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Thu Sep 13 22:08:12 UTC 2007


Author: lange
Date: 2007-09-13 22:08:12 +0000 (Thu, 13 Sep 2007)
New Revision: 4573

Modified:
   trunk/bin/make-fai-nfsroot
Log:
add support for running hooks, (closes: #342467)


Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2007-09-13 13:20:01 UTC (rev 4572)
+++ trunk/bin/make-fai-nfsroot	2007-09-13 22:08:12 UTC (rev 4573)
@@ -427,6 +427,20 @@
     	esac
     done
 }
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+run_hooks() {
+
+    local file
+    if [ -z "$FAI_HOOK_DIR" ]; then
+	return
+    fi
+    if [ -d "$FAI_HOOK_DIR"  ]; then
+        echo "Running hooks..."
+        for file in `ls $FAI_HOOK_DIR/* 2>/dev/null`; do
+            . $file
+        done
+    fi
+}
 # - - - - - - - - - - - - - - - - - - - - - - - - - -
 # main routine
 
@@ -447,7 +461,11 @@
     fi
     LC_ALL=C add_packages_nfsroot
     kernel_install
-    exit
+    run_hooks
+    umount_dirs
+    trap "true" EXIT
+    echo "make-fai-nfsroot finished $merror."
+    exit 0
 }
 
 echo "Creating FAI nfsroot in $NFSROOT."
@@ -478,7 +496,7 @@
 call_with_stamp create_nfsroot
 
 kernel_install
-
+run_hooks
 umount_dirs
 trap "true" EXIT
 echo "make-fai-nfsroot finished $merror."




More information about the Fai-commit mailing list