Changed LVM configuration detection to not error.
authorChris Gianelloni <wolf31o2@gentoo.org>
Mon, 26 Mar 2007 23:57:34 +0000 (23:57 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Mon, 26 Mar 2007 23:57:34 +0000 (23:57 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@499 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
gen_initramfs.sh
gen_initrd.sh

index fad389c29eb6608f837719d10b360a9b8fc56605..0f85aa2ac677fa1cc06dcb87bcc3c15ad5ca6b3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 2006-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  26 Mar 2007; Chris Gianelloni <wolf31o2@gentoo.org> gen_initramfs.sh,
+  gen_initrd.sh:
+  Changed LVM configuration detection to not error.
+
   26 Mar 2007; Chris Gianelloni <wolf31o2@gentoo.org> x86/kernel-config-2.6:
   Added joystick support to the default configuration for bug #171911.
 
index b18be8daa9f16baa73d42988993c79c9b294d114..7c74e7a76f51c6060afbcc48506c8cb7ceba57be 100644 (file)
@@ -221,10 +221,17 @@ append_lvm2(){
                mv ${TEMP}/initramfs-lvm2-temp/sbin/lvm.static ${TEMP}/initramfs-lvm2-temp/bin/lvm ||
                        gen_die 'LVM2 error: Could not move lvm.static to lvm!'
        fi
-       if [ `lvm dumpconfig` ]
+       if [ -x /sbin/lvm ]
        then
-               cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm2-temp/etc/lvm/" ||
+               lvm dumpconfig 2>&1 > /dev/null || gen_die 'Could not copy over lvm.conf!'
+               ret=$?
+               if [ ${ret} != 0 ]
+               then
+                       cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm2-temp/etc/lvm/" ||
+                               gen_die 'Could not copy over lvm.conf!'
+               else
                        gen_die 'Could not copy over lvm.conf!'
+               fi
        fi
        cd "${TEMP}/initramfs-lvm2-temp/"
        find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
index f8f4c8a095774613ab6e62c5699ec9f2cb8b7417..2d9eb9f6474da38bc5d515b75574d83298145007 100644 (file)
@@ -187,10 +187,17 @@ create_base_initrd_sys() {
                                gen_die "LVM2 error: Could not link ${i}!"
                done
                mkdir -p ${TEMP}/initrd-temp/etc/lvm
-               if [ `lvm dumpconfig` ]
+               if [ -x /sbin/lvm ]
                then
-                       cp /etc/lvm/lvm.conf "${TEMP}/initrd-temp/etc/lvm/" ||
+                       lvm dumpconfig 2>&1 > /dev/null || gen_die 'Could not copy over lvm.conf!'
+                       ret=$?
+                       if [ ${ret} != 0 ]
+                       then
+                               cp /etc/lvm/lvm.conf "${TEMP}/initramfs-lvm2-temp/etc/lvm/" ||
+                                       gen_die 'Could not copy over lvm.conf!'
+                       else
                                gen_die 'Could not copy over lvm.conf!'
+                       fi
                fi
        fi