Author: glen
Date: Wed Oct 24 20:09:16 2007
New Revision: 8856

Modified:
   geninitrd/trunk/geninitrd
Log:
- unify some more internal variables

Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd   (original)
+++ geninitrd/trunk/geninitrd   Wed Oct 24 20:09:16 2007
@@ -62,7 +62,9 @@
 # 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 @@
        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 @@
                }
 
                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 @@
        fi
 
        if [[ "$devpath" == /dev/md/* ]]; then
-               find_modules_softraid "$devpath"
+               find_modules_md "$devpath"
                return
        fi
 
@@ -1357,7 +1361,7 @@
 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 @@
                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 @@
                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 @@
 
 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
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to