[Pkg-uml-commit] r145 - in trunk/src/rootstrap: . modules

Mattia Dongili malattia at costa.debian.org
Fri Aug 18 21:01:38 UTC 2006


Author: malattia
Date: 2006-08-18 21:01:37 +0000 (Fri, 18 Aug 2006)
New Revision: 145

Modified:
   trunk/src/rootstrap/modules/uml
   trunk/src/rootstrap/rootstrap.conf
   trunk/src/rootstrap/rootstrap.sgml
Log:
Implement the option of mounting the hostfs to /lib/modules
and avoid copying kernel modules to guest image.
Document it properly.
Closes: #377035


Modified: trunk/src/rootstrap/modules/uml
===================================================================
--- trunk/src/rootstrap/modules/uml	2006-08-18 18:43:34 UTC (rev 144)
+++ trunk/src/rootstrap/modules/uml	2006-08-18 21:01:37 UTC (rev 145)
@@ -14,8 +14,30 @@
 tmpfs  	/tmp    tmpfs   defaults,size=768M 	0 0
 EOF
 
-# copy kernel modules
-if [ "$install_modules" = "yes" -a -d /usr/lib/uml/modules ]; then
-	mkdir -p $TARGET/lib/modules
-	cp -R /usr/lib/uml/modules/* $TARGET/lib/modules
+# kernel modules
+mkdir -p $TARGET/lib/modules
+
+[ -n "$kernel_modules" ] || kernel_modules=copy
+[ -n "$kernel_modules_dir" ] || kernel_modules_dir=/usr/lib/uml/modules
+
+if ! [ -d "$kernel_modules_dir" ] ; then
+	echo "ERROR: \"$kernel_modules_dir\" not found, skipping kernel modules."
+
+else
+	case "$kernel_modules" in
+		"copy")
+		cp -R $kernel_modules_dir/* $TARGET/lib/modules
+		;;
+
+		"hostfs")
+		echo "hostfs /lib/modules  hostfs  defaults,ro,$kernel_modules_dir 0 0" >> $TARGET/etc/fstab
+		;;
+
+		"none")
+		;;
+
+		*)
+		echo "ERROR: Unknown action for 'kernel_modules', skipping kernel modules."
+		;;
+	esac
 fi

Modified: trunk/src/rootstrap/rootstrap.conf
===================================================================
--- trunk/src/rootstrap/rootstrap.conf	2006-08-18 18:43:34 UTC (rev 144)
+++ trunk/src/rootstrap/rootstrap.conf	2006-08-18 21:01:37 UTC (rev 145)
@@ -128,4 +128,7 @@
 #flags=-n -s
 
 [uml]
-install_modules=yes
+kernel_modules=copy
+kernel_modules_dir=/usr/lib/uml/modules
+# deprecated option
+#install_modules=yes

Modified: trunk/src/rootstrap/rootstrap.sgml
===================================================================
--- trunk/src/rootstrap/rootstrap.sgml	2006-08-18 18:43:34 UTC (rev 144)
+++ trunk/src/rootstrap/rootstrap.sgml	2006-08-18 21:01:37 UTC (rev 145)
@@ -404,9 +404,46 @@
     <refsect2>
       <title>[uml]</title>
       <para>
-        Creates /etc/fstab and necessary device nodes.
+        Creates /etc/fstab and necessary device nodes, it eventually copies 
+	kernel modules into the target image.
 	It uses the <parameter>fstype</parameter> global parameter.
       </para>
+      <variablelist>
+        <varlistentry>
+          <term>kernel_modules</term>
+          <listitem>
+            <para>
+              How to deal with kernel modules for the guest Linux.
+	      It can be one of <parameter>none</parameter>,
+	      <parameter>hostfs</parameter> or 
+	      <parameter>copy</parameter>, defaults to the latter which copies
+	      the available modules in the target filesystem.
+            </para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>kernel_modules_dir</term>
+          <listitem>
+            <para>
+	      The directory where <parameter>kernel_modules</parameter>
+	      are located on the host filesystem. It defaults to
+	      /usr/lib/uml/modules
+            </para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>install_modules</term>
+          <listitem>
+            <para>
+	      This parameter is superseeded by
+	      <parameter>kernel_modules</parameter> and 
+	      <parameter>kernel_modules_dir</parameter>. It accepts a
+	      boolean value (true/false).
+            </para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+
     </refsect2>
 
     <refsect2>




More information about the Pkg-uml-commit mailing list