[Fai-commit] r5460 - in trunk: bin debian doc lib man

Thomas Lange lange at alioth.debian.org
Mon Jul 20 11:12:37 UTC 2009


Author: lange
Date: 2009-07-20 11:12:37 +0000 (Mon, 20 Jul 2009)
New Revision: 5460

Modified:
   trunk/bin/fai-class
   trunk/debian/changelog
   trunk/doc/fai-guide.sgml
   trunk/lib/subroutines-linux
   trunk/man/fai-class.1
Log:
* fai-class: do not remove additional-classes when in debug mode,
  use the comma separated list of $ADDCLASSES for classes (closes: 497548)
* fai-class.1: add ADDCLASS feature

Modified: trunk/bin/fai-class
===================================================================
--- trunk/bin/fai-class	2009-07-20 10:35:59 UTC (rev 5459)
+++ trunk/bin/fai-class	2009-07-20 11:12:37 UTC (rev 5460)
@@ -199,6 +199,8 @@
 	grep -v "^#" $HOSTNAME | addclass
 fi
 
+echo ${ADDCLASSES//,/ } | addclass
+
 # now add the hostname (the only class in lowercase) and LAST to
 # the list of classes
 echo $HOSTNAME LAST | addclass

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-07-20 10:35:59 UTC (rev 5459)
+++ trunk/debian/changelog	2009-07-20 11:12:37 UTC (rev 5460)
@@ -30,7 +30,9 @@
   * fai, fai.8: add option -s/--cspace to specify the config space URL
   * disk_config/*: add nosuid and nodev to some partitions
   * menu.lst/postinst: add /g to perl substitution command
-  * fai-class: do not remove additional-classes when in debug mode
+  * fai-class: do not remove additional-classes when in debug mode,
+    use the comma separated list of $ADDCLASSES for classes (closes: 497548)
+  * fai-class.1: add ADDCLASS feature
   
   [ Michael Tautschnig ]
   * setup-storage/Parser.pm: Set the boot flag on partition mounted at /, if

Modified: trunk/doc/fai-guide.sgml
===================================================================
--- trunk/doc/fai-guide.sgml	2009-07-20 10:35:59 UTC (rev 5459)
+++ trunk/doc/fai-guide.sgml	2009-07-20 11:12:37 UTC (rev 5460)
@@ -1438,7 +1438,8 @@
      <tag>defclass</tag> <item><p>Calls <manref name="fai-class"
       section="1"> to define classes using scripts and
       files in <file>$FAI/class</file> and classes from
-      <file>/tmp/fai/additional-classes</file>.</p> </item>
+      <file>/tmp/fai/additional-classes</file> and the variable
+      <var>ADDCLASSES</var>.</p> </item>
 
      <tag>defvar</tag> <item><p>Sources all files
       <file>$FAI/class/*.var</file> for every defined class. If a hook
@@ -2926,22 +2927,9 @@
 <p>
 
 <p> How can I define classes on the kernel command line?
-<p> All key-values pairs on the kernel command line are
-defined as normal shell variables in FAI. Therefore I would add
-following definition to the kernel:
+<p> Read the man page of <manref name="fai-class" section="8">
 
-<example>
-myclasses=MYA,MYB,MYC
-</example>
 
-Then you can use the variable <var>myclasses</var> in a script inside
-the subdirectory <tt>class/</tt>. There you should echo the list of
-your own classes using following command: 
-
-<example>
-echo ${myclasses//,/ }
-</example>
-
 <sect id=difai>Using FAI after an Installation with the Debian-Installer<p>
 On <httpsite>www.layer-acht.org</httpsite><httppath>/fai</httppath> you 
 will find an example how to fully automatically install a system using the Debian 

Modified: trunk/lib/subroutines-linux
===================================================================
--- trunk/lib/subroutines-linux	2009-07-20 10:35:59 UTC (rev 5459)
+++ trunk/lib/subroutines-linux	2009-07-20 11:12:37 UTC (rev 5460)
@@ -41,6 +41,14 @@
     echo -n "Kernel parameters: "; cat /proc/cmdline
     for word in $(cat /proc/cmdline) ; do
 	case $word in
+	    FAI_CLASSES=*)
+                eval "$word"
+		for class in ${FAI_CLASSES//,/ }; do
+		    echo $class >>/tmp/l
+		done
+		unset FAI_CLASSES
+		;;
+
 	    [a-zA-Z]*=*)
 		eval "export $word"
 		;;

Modified: trunk/man/fai-class.1
===================================================================
--- trunk/man/fai-class.1	2009-07-20 10:35:59 UTC (rev 5459)
+++ trunk/man/fai-class.1	2009-07-20 11:12:37 UTC (rev 5460)
@@ -11,7 +11,7 @@
 .\" .br        insert line break
 .\" .sp <n>    insert n+1 empty lines
 .\" for manpage-specific macros, see man(7)
-.TH "fai-class" "1" "15 September 2008" "FAI 2.5" ""
+.TH "fai-class" "1" "20 July 2009" "FAI 3.3" ""
 .SH "NAME"
 fai\-class \- define classes using files and scripts.
 .SH "SYNOPSIS"
@@ -41,9 +41,13 @@
 of the classes from low to high. First, the class DEFAULT is
 defined. Then all scripts are executed to define classes. After that,
 the classes from the file $LOGDIR/additional\-classes are added. Then,
-all classes in the file with the hostname are added. Finally, the
-class with the hostname and LAST are defined.
+all classes in the file with the hostname are added. Then classes
+defined by the variable ADDCLASSES are used. This variable must be a
+comma separated list of classes. You can define this variable on the
+kernel command line. 
 
+Finally, the class with the hostname and LAST are defined.
+
 It's important that each line in a file containg a class name ends
 with a newline. If the newline is missing on the last line of a file,
 this class can't be added.
@@ -131,6 +135,12 @@
 .sp
 .fi 
 .PP 
+.br 
+You can define classes on the kernel command line by appening this to
+the kernel:
+
+   ADDCLASSES=CLASS1,CLASSX,CLASS3
+
 .SH "NOTES"
 All class names should be written in uppercase letters (execpt the
 class of the hostname). Do not use a dash, use an underscore. Only




More information about the Fai-commit mailing list