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

draenog draenog at pld-linux.org
Sat Nov 2 19:50:57 CET 2013


commit 69b1e9352d68828aeadb47b6ffee67f79fdf4f55
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Oct 24 18:03:04 2007 +0000

    - unify some internal variables
    
    svn-id: @8855

 geninitrd | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index 1052376..9a59d98 100755
--- a/geninitrd
+++ b/geninitrd
@@ -27,8 +27,6 @@ USEMDADMSTATIC="no"
 USEINSMODSTATIC="no"
 USE_SUSPEND="yes"
 USE_TUXONICE="yes"
-uselvm="no"
-usenfs="no"
 # it should be safe to remove scsi_mod from here, but I'm not sure...
 PRESCSIMODS="-scsi_mod unknown -sd_mod"
 PREIDEMODS="-ide-core unknown -ide-detect -ide-disk"
@@ -61,8 +59,12 @@ tmpfs_dev=no
 proc_partitions=no
 # dmraid component devices of rootfs is on dmraid
 dmraid_devices=''
+# if we should init NFS at boot
+have_nfs=no
+# if we should init LVM at boot
+have_lvm="no"
 # if we should init dm-multipath at boot
-use_multipath=no
+have_multipath=no
 
 if [ -f /etc/udev/udev.conf -a -x /sbin/initrd-udevd ]; then
 	USE_UDEV="yes"
@@ -536,7 +538,7 @@ find_modules_for_device() {
 		done
 		findmodule "-ipv4"
 		findmodule "nfs"
-		usenfs="yes"
+		have_nfs=yes
 		echo >&2 "Remember to use \`root=/dev/ram0 init=/linuxrc' when starting kernel"
 		echo >&2 "or you will have problems like init(xx) being child process of swapper(1)."
 		return
@@ -555,7 +557,7 @@ find_modules_for_device() {
 		local info=$(multipath -l $id)
 		if [ "$info" ]; then
 			debug "have multipath"
-			use_multipath=yes
+			have_multipath=yes
 			local dev phydevs=$(echo "$info" | awk '$2 ~ /^[0-9]+:[0-9]+:[0-9]+:[0-9]+$/{printf("/dev/%s\n", $3)}')
 			for dev in $phydevs; do
 				find_modules_for_device $dev
@@ -694,7 +696,7 @@ find_modules_for_device() {
 			die "LVM version $LVMTOOLSVERSION is not supported yet."
 		fi
 		debug "LVM $LVMTOOLSVERSION enabled"
-		uselvm="yes"
+		have_lvm=yes
 		return
 	fi
 }
@@ -1489,7 +1491,7 @@ initrd_gen_lvm() {
 		if is_yes "$raidfound"; then
 			echo "	md_component_detection = 1" >> "$MNTIMAGE/etc/lvm.conf"
 		fi
-		if [ "$dmraid_devices" ] || is_yes "$use_multipath"; then
+		if [ "$dmraid_devices" ] || is_yes "$have_multipath"; then
 			echo '	types = [ "device-mapper", 254 ]' >> "$MNTIMAGE/etc/lvm.conf"
 		fi
 		if [ "$dmraid_devices" ]; then
@@ -1570,20 +1572,20 @@ if [ "$dmraid_devices" ]; then
 	initrd_gen_dmraid
 fi
 
-if [ "$use_multipath" ]; then
+if [ "$have_multipath" ]; then
 	initrd_gen_multipath
 fi
 
-if is_yes "$usenfs" ; then
+if is_yes "$have_nfs"; then
 	initrd_gen_nfs
 elif is_yes "$USERAIDSTART" && is_yes "$raidfound"; then
 	initrd_gen_softraid
-	if is_yes "$uselvm"; then
+	if is_yes "$have_lvm"; then
 		initrd_gen_lvm
 	else
 		initrd_gen_procdata
 	fi
-elif is_yes "$uselvm"; then
+elif is_yes "$have_lvm"; then
 	initrd_gen_lvm
 else
 	initrd_gen_procdata
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list