commit:     6d610cf9afd929e4c973780e1d37746ebf3d15ff
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 14 00:55:25 2014 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Apr 14 00:59:30 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=6d610cf9

LVM install fixes.

Clean up LVM install to work with non-root and handle errors.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

---
 gen_compile.sh   | 7 +++++--
 gen_initramfs.sh | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gen_compile.sh b/gen_compile.sh
index a90977f..9b5df01 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -468,8 +468,11 @@ compile_lvm() {
                                >> ${LOGFILE} 2>&1 || \
                                gen_die 'Configure of lvm failed!'
                print_info 1 'lvm: >> Compiling...'
-               compile_generic '' utils
-               compile_generic "install DESTDIR=${TEMP}/lvm/" utils
+               compile_generic '' utils || gen_die "failed to build LVM"
+               mkdir -p "${TEMP}/lvm/sbin"
+               compile_generic "install DESTDIR=${TEMP}/lvm/" utils || gen_die 
"failed to install LVM"
+               # Upstream does u-w on files, and this breaks stuff.
+               chmod -R u+w "${TEMP}/lvm/"
 
                cd "${TEMP}/lvm"
                print_info 1 '      >> Copying to bincache...'

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 26bcdf6..5ac9ac1 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -349,7 +349,7 @@ append_lvm(){
                fi
        else
                print_info 1 '          LVM: Adding support (compiling 
binaries)...'
-               compile_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 ||

Reply via email to