commit:     ed52f905b67f4dc25ec99ae63b68240efb710958
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  5 18:49:44 2016 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Tue Jan  5 18:49:44 2016 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ed52f905

lvm should not be moved

moving lvm from sbin to bin breaks the symlinks and makes using the
debug shell much harder.  Patch suggested by TomWij and independantly
recreated by Zero_Chaos and ryao.  bug #448156

 defaults/initrd.scripts | 8 ++++----
 gen_initramfs.sh        | 7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 2612574..1bab361 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -985,15 +985,15 @@ startVolumes() {
 
        if [ "${USE_LVM_NORMAL}" = '1' ]
        then
-               if [ -x '/bin/lvm' ]
+               if [ -x '/sbin/lvm' ]
                then
                        for dev in ${RAID_DEVICES}
                        do
                                setup_md_device "${dev}"
                        done
 
-                       # This is needed for /bin/lvm to accept the following 
logic
-                       lvm_commands="#! /bin/lvm"
+                       # This is needed for /sbin/lvm to accept the following 
logic
+                       lvm_commands="#! /sbin/lvm"
 
                        # If there is a cahe, update it. Unbreak at least 
dmcrypt
                        [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} 
\nvgscan"
@@ -1008,7 +1008,7 @@ startVolumes() {
 
                        # And finally execute it all (/proc/... needed if lvm 
is compiled without readline)
                        good_msg "Scanning for and activating Volume Groups"
-                       printf "%b\n" "${lvm_commands}" | /bin/lvm 
/proc/self/fd/0
+                       printf "%b\n" "${lvm_commands}" | /sbin/lvm 
/proc/self/fd/0
                else
                        bad_msg "vgscan or vgchange not found: skipping LVM 
volume group activation!"
                fi

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 8fed1eb..9c9dfec 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -339,11 +339,12 @@ append_lvm(){
        fi
        cd ${TEMP}
        mkdir -p "${TEMP}/initramfs-lvm-temp/bin/"
+       mkdir -p "${TEMP}/initramfs-lvm-temp/sbin/"
        mkdir -p "${TEMP}/initramfs-lvm-temp/etc/lvm/"
        if false && [ -e '/sbin/lvm.static' ]
        then
                print_info 1 '          LVM: Adding support (using local static 
binary /sbin/lvm.static)...'
-               cp /sbin/lvm.static "${TEMP}/initramfs-lvm-temp/bin/lvm" ||
+               cp /sbin/lvm.static "${TEMP}/initramfs-lvm-temp/sbin/lvm" ||
                        gen_die 'Could not copy over lvm!'
                # See bug 382555
                if [ -e '/sbin/dmsetup.static' ]
@@ -353,7 +354,7 @@ append_lvm(){
        elif false && [ -e '/sbin/lvm' ] && LC_ALL="C" ldd /sbin/lvm|grep -q 
'not a dynamic executable'
        then
                print_info 1 '          LVM: Adding support (using local static 
binary /sbin/lvm)...'
-               cp /sbin/lvm "${TEMP}/initramfs-lvm-temp/bin/lvm" ||
+               cp /sbin/lvm "${TEMP}/initramfs-lvm-temp/sbin/lvm" ||
                        gen_die 'Could not copy over lvm!'
                # See bug 382555
                if [ -e '/sbin/dmsetup' ] && LC_ALL="C" ldd /sbin/dmsetup | 
grep -q 'not a dynamic executable'
@@ -365,7 +366,7 @@ append_lvm(){
                compile_lvm || gen_die "Could not compile LVM"
                /bin/tar -jxpf "${LVM_BINCACHE}" -C 
"${TEMP}/initramfs-lvm-temp" ||
                        gen_die "Could not extract lvm binary cache!";
-               mv ${TEMP}/initramfs-lvm-temp/sbin/lvm.static 
${TEMP}/initramfs-lvm-temp/bin/lvm ||
+               mv ${TEMP}/initramfs-lvm-temp/sbin/lvm.static 
${TEMP}/initramfs-lvm-temp/sbin/lvm ||
                        gen_die 'LVM error: Could not move lvm.static to lvm!'
                # See bug 382555
                mv ${TEMP}/initramfs-lvm-temp/sbin/dmsetup.static 
${TEMP}/initramfs-lvm-temp/bin/dmsetup ||

Reply via email to