SVN: rc-scripts/trunk/rc.d: rc.shutdown rc.sysinit

glen glen at pld-linux.org
Mon Mar 16 12:34:31 CET 2009


Author: glen
Date: Mon Mar 16 12:34:31 2009
New Revision: 10214

Modified:
   rc-scripts/trunk/rc.d/rc.shutdown
   rc-scripts/trunk/rc.d/rc.sysinit
Log:
- shorter lvm version detect

Modified: rc-scripts/trunk/rc.d/rc.shutdown
==============================================================================
--- rc-scripts/trunk/rc.d/rc.shutdown	(original)
+++ rc-scripts/trunk/rc.d/rc.shutdown	Mon Mar 16 12:34:31 2009
@@ -107,8 +107,8 @@
 
 	run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
 
-	if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
-		lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1; exit}')
+	if is_yes "$EVMS_LVM" || [ -x /sbin/vgchange ]; then
+		lvmversion=$(LC_ALL=C /sbin/vgchange --version 2>/dev/null | awk '/LVM version:/{if ($3 >= 2) print "2"}')
 		if [ "$lvmversion" = "2" ] ; then
 			lvmignorelock="--ignorelockingfailure"
 		else

Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit	(original)
+++ rc-scripts/trunk/rc.d/rc.sysinit	Mon Mar 16 12:34:31 2009
@@ -638,7 +638,7 @@
 
 	# LVM (keep in sync with LVM starting after RAID run!)
 	if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
-		lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1; exit}')
+		lvmversion=$(LC_ALL=C /sbin/vgchange --version 2>/dev/null | awk '/LVM version:/{if ($3 >= 2) print "2"}')
 		if [ "$lvmversion" = "1" ] ; then
 			modprobe -s -k lvm-mod >/dev/null 2>&1
 			lvmignorelock=""


More information about the pld-cvs-commit mailing list