Author: glen
Date: Mon Mar 16 12:38:48 2009
New Revision: 10215

Modified:
   geninitrd/trunk/mod-lvm.sh
Log:
- shorter lvm version detect

Modified: geninitrd/trunk/mod-lvm.sh
==============================================================================
--- geninitrd/trunk/mod-lvm.sh  (original)
+++ geninitrd/trunk/mod-lvm.sh  Mon Mar 16 12:38:48 2009
@@ -15,6 +15,10 @@
 
 VGVOLUMES=""
 
+# LVM version. Autodetected if not set.
+# Values: 1|2
+LVMTOOLSVERSION=
+
 if [ -x /sbin/lvm ]; then
        USE_LVM=yes
 else
@@ -73,7 +77,7 @@
        fi
 
        if [ -z "$LVMTOOLSVERSION" ]; then
-               LVMTOOLSVERSION=$(/sbin/initrd-lvm vgchange --version 
2>/dev/null|head -n 1|awk '{gsub("vgchange: Logical Volume Manager ",NIL); 
gsub("LVM version:     ",NIL); gsub(/\..*/,NIL); print $1}')
+               LVMTOOLSVERSION=$(LC_ALL=C /sbin/initrd-lvm vgchange --version 
2>/dev/null | awk '/LVM version:/{if ($3 >= 2) print "2"}')
                if [ -z "$LVMTOOLSVERSION" ]; then
                        die "Can't determine LVM tools version. Please set 
LVMTOOLSVERSION and rerun $PROGRAM."
                fi
@@ -101,7 +105,7 @@
                find_module "-lvm"
                find_module "-lvm-mod"
        else
-               die "LVM version $LVMTOOLSVERSION is not supported yet."
+               die "LVM version $LVMTOOLSVERSION is not supported."
        fi
 
        debug "LVM v$LVMTOOLSVERSION enabled"
_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to