[readonly/geninitrd: 428/1068] - add dm-mirror module for dmraid setups - generate /dev nodes from /proc/partitions also for dmraid

draenog draenog at pld-linux.org
Sat Nov 2 19:48:20 CET 2013


commit 8bd582f166ad6ba404322617b6c7a0b1d1a32261
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Oct 5 15:26:59 2007 +0000

    - add dm-mirror module for dmraid setups
    - generate /dev nodes from /proc/partitions also for dmraid
    
    svn-id: @8785

 geninitrd | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 808aff8..2fffaf2 100755
--- a/geninitrd
+++ b/geninitrd
@@ -55,8 +55,11 @@ FB_SPLASH=no
 # PLD loads the modules needed to mount and boot
 PROBESTATICMODULES=no
 
-# is /dev on tmpfs. internal variable
-tmpfs_dev=
+# internal variables
+# is /dev on tmpfs
+tmpfs_dev=no
+# is /proc/devices entries already created
+proc_partitions=no
 
 if [ -f /etc/udev/udev.conf -a -x /sbin/initrd-udevd ]; then
 	USE_UDEV="yes"
@@ -587,6 +590,10 @@ find_modules_for() {
 		debug "LVM $LVMTOOLSVERSION enabled"
 		uselvm="yes"
 	fi
+
+	if is_yes "$USE_DMRAID"; then
+		findmodule "dm-mirror"
+	fi
 }
 
 firmware_install_module_pre() {
@@ -1151,7 +1158,6 @@ initrd_gen_dmraid() {
 		die "/sbin/dmraid-initrd is missing missing!"
 	fi
 
-
 	# always make /dev on tmpfs
 	initrd_gen_tmpfs_dev
 
@@ -1175,9 +1181,15 @@ EOF
 EOF
 }
 
-# generates /dev nodes based on /proc/partitions information
-# needs /proc mounted
+# Generates /dev nodes based on /proc/partitions information.
+# Needs /proc mounted.
+# Can be called multiple times.
 initrd_gen_devices() {
+	if is_yes "$proc_partitions"; then
+		return
+	fi
+	proc_partitions=yes
+
 	cat <<-'EOF' >> "$s"
 	: 'Making device nodes'
 	# ignore first two lines, header, empty line and process rest
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/147754ca159d40ca5eb541074dc043d8cbd92090



More information about the pld-cvs-commit mailing list