[readonly/geninitrd: 460/1068] - unify some more internal variables

draenog draenog at pld-linux.org
Sat Nov 2 19:51:03 CET 2013


commit df738638e3fbf7fbea14c52c95b893958799871c
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Oct 24 18:09:16 2007 +0000

    - unify some more internal variables
    
    svn-id: @8856

 geninitrd | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 9a59d98..0fbf79b 100755
--- a/geninitrd
+++ b/geninitrd
@@ -62,7 +62,9 @@ dmraid_devices=''
 # if we should init NFS at boot
 have_nfs=no
 # if we should init LVM at boot
-have_lvm="no"
+have_lvm=no
+# if we should init md (softraid) at boot
+have_md=no
 # if we should init dm-multipath at boot
 have_multipath=no
 
@@ -291,7 +293,9 @@ inst_d() {
 	done
 }
 
-find_modules_softraid() {
+find_modules_md() {
+	local found raidlevel
+
 	if [ -f /etc/mdadm.conf ]; then
 		debug "Finding RAID details using mdadm for rootdev=$1"
 		eval `/sbin/mdadm -v --examine --scan --config=/etc/mdadm.conf | awk -v rootdev="$1" '
@@ -323,17 +327,17 @@ find_modules_softraid() {
 		}
 
 		END {
-			print "raidfound=" found;
+			print "have_md=" found;
 			print "raidlevel=" raidlevel;
 			print "dev_list=\"" dev_list "\"";
 		}'`
 	fi
 
-	if [ "$raidfound" != "yes" -a -f /etc/raidtab ]; then
+	if [ "$have_md" != "yes" -a -f /etc/raidtab ]; then
 		die "raidtools are not longer supported. Please migrate to mdadm setup!"
 	fi
 
-	if is_yes "$raidfound" ; then
+	if is_yes "$have_md" ; then
 		case "$raidlevel" in
 		[01]|10)
 			findmodule "raid$raidlevel"
@@ -545,7 +549,7 @@ find_modules_for_device() {
 	fi
 
 	if [[ "$devpath" == /dev/md/* ]]; then
-		find_modules_softraid "$devpath"
+		find_modules_md "$devpath"
 		return
 	fi
 
@@ -1357,7 +1361,7 @@ initrd_gen_devices() {
 EOF
 }
 
-initrd_gen_softraid() {
+initrd_gen_md() {
 	debug "Setting up mdadm..."
 
 	if [ ! -x /sbin/mdadm -o ! -x /sbin/initrd-mdassemble ]; then
@@ -1467,7 +1471,7 @@ initrd_gen_lvm() {
 		inst_d /dev/mapper
 		mknod $MNTIMAGE/dev/mapper/control c 10 63
 		for device in $PVDEVICES; do
-			# if LVM on RAID then device might be copied already in gen_softraid
+			# if LVM on RAID then device might be copied already in gen_md
 			[ -e "$MNTIMAGE/dev/$(basename $device)" ] && continue
 			inst $device /dev
 		done
@@ -1488,7 +1492,7 @@ initrd_gen_lvm() {
 		echo "}" >> "$MNTIMAGE/etc/lvm.conf"
 		echo "devices {" >> "$MNTIMAGE/etc/lvm.conf"
 		echo "	sysfs_scan=0" >> "$MNTIMAGE/etc/lvm.conf"
-		if is_yes "$raidfound"; then
+		if is_yes "$have_md"; then
 			echo "	md_component_detection = 1" >> "$MNTIMAGE/etc/lvm.conf"
 		fi
 		if [ "$dmraid_devices" ] || is_yes "$have_multipath"; then
@@ -1578,8 +1582,8 @@ fi
 
 if is_yes "$have_nfs"; then
 	initrd_gen_nfs
-elif is_yes "$USERAIDSTART" && is_yes "$raidfound"; then
-	initrd_gen_softraid
+elif is_yes "$USERAIDSTART" && is_yes "$have_md"; then
+	initrd_gen_md
 	if is_yes "$have_lvm"; then
 		initrd_gen_lvm
 	else
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list