aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2012-02-14 08:31:46 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2012-02-14 08:31:46 +0000
commit265363f79df5a545dc47547dbee76972b387e9b7 (patch)
tree6e338c5370203e99a9f425337681e7b4f63ccf1a /gen_compile.sh
parentMore UTILS_CROSS_COMPILE prefix on strip calls. (diff)
downloadgenkernel-265363f79df5a545dc47547dbee76972b387e9b7.tar.gz
genkernel-265363f79df5a545dc47547dbee76972b387e9b7.tar.bz2
genkernel-265363f79df5a545dc47547dbee76972b387e9b7.zip
Fix dmraid building with LVM/device-mapper
dmraid is entirely broken if you try to use the system static LVM/device-mapper. Instead, always build our own LVM2 for the initramfs, using DESTDIR for cleaner install. Dead code paths for old LVM2 build not removed yet until more users have tested. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'gen_compile.sh')
-rwxr-xr-xgen_compile.sh39
1 files changed, 21 insertions, 18 deletions
diff --git a/gen_compile.sh b/gen_compile.sh
index bc93be8d..646e0efd 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -406,7 +406,7 @@ compile_busybox() {
/bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
gen_die 'Could not extract busybox source tarball!'
[ -d "${BUSYBOX_DIR}" ] ||
- gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
+ gen_die "Busybox directory ${BUSYBOX_DIR} is invalid!"
cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
cd "${BUSYBOX_DIR}"
@@ -441,19 +441,20 @@ compile_lvm() {
/bin/tar -zxpf ${LVM_SRCTAR} ||
gen_die 'Could not extract LVM source tarball!'
[ -d "${LVM_DIR}" ] ||
- gen_die 'LVM directory ${LVM_DIR} is invalid!'
+ gen_die "LVM directory ${LVM_DIR} is invalid!"
cd "${LVM_DIR}"
apply_patches lvm ${LVM_VER}
print_info 1 'lvm: >> Configuring...'
CFLAGS="-fPIC" \
- ./configure --enable-static_link --prefix=${TEMP}/lvm \
+ ./configure --enable-static_link --prefix=/ \
--with-lvm1=internal --with-clvmd=none --with-cluster=none \
--disable-readline --disable-selinux --with-mirrors=internal \
- --with-snapshots=internal --with-pool=internal >> ${LOGFILE} 2>&1 || \
+ --with-snapshots=internal --with-pool=internal \
+ >> ${LOGFILE} 2>&1 || \
gen_die 'Configure of lvm failed!'
print_info 1 'lvm: >> Compiling...'
- compile_generic '' utils
- compile_generic 'install' utils
+ compile_generic '' utils
+ compile_generic "install DESTDIR=${TEMP}/lvm/" utils
cd "${TEMP}/lvm"
print_info 1 ' >> Copying to bincache...'
@@ -462,11 +463,11 @@ compile_lvm() {
# See bug 382555
${UTILS_CROSS_COMPILE}strip "sbin/dmsetup.static" ||
gen_die 'Could not strip dmsetup.static'
- /bin/tar -cjf "${LVM_BINCACHE}" sbin/lvm.static sbin/dmsetup.static ||
+ /bin/tar -cjf "${LVM_BINCACHE}" . ||
gen_die 'Could not create binary cache'
cd "${TEMP}"
- rm -rf "${TEMP}/device-mapper" > /dev/null
+ rm -rf "${TEMP}/lvm" > /dev/null
rm -rf "${LVM_DIR}" lvm
fi
}
@@ -483,7 +484,7 @@ compile_mdadm() {
/bin/tar -jxpf "${MDADM_SRCTAR}" ||
gen_die 'Could not extract MDADM source tarball!'
[ -d "${MDADM_DIR}" ] ||
- gen_die 'MDADM directory ${MDADM_DIR} is invalid!'
+ gen_die "MDADM directory ${MDADM_DIR} is invalid!"
cd "${MDADM_DIR}"
apply_patches mdadm ${MDADM_VER}
@@ -521,24 +522,26 @@ compile_dmraid() {
/bin/tar -jxpf ${DMRAID_SRCTAR} ||
gen_die 'Could not extract DMRAID source tarball!'
[ -d "${DMRAID_DIR}" ] ||
- gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
- rm -rf "${TEMP}/device-mapper" > /dev/null
- /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
- gen_die "Could not extract device-mapper binary cache!";
+ gen_die "DMRAID directory ${DMRAID_DIR} is invalid!"
+ rm -rf "${TEMP}/lvm" > /dev/null
+ mkdir -p "${TEMP}/lvm"
+ /bin/tar -jxpf "${LVM_BINCACHE}" -C "${TEMP}/lvm" ||
+ gen_die "Could not extract LVM2 binary cache!";
cd "${DMRAID_DIR}"
apply_patches dmraid ${DMRAID_VER}
print_info 1 'dmraid: >> Configuring...'
- LDFLAGS="-L${TEMP}/device-mapper/lib" \
- CFLAGS="-I${TEMP}/device-mapper/include" \
- CPPFLAGS="-I${TEMP}/device-mapper/include" \
+ LDFLAGS="-L${TEMP}/lvm/lib" \
+ CFLAGS="-I${TEMP}/lvm/include" \
+ CPPFLAGS="-I${TEMP}/lvm/include" \
+ LIBS="-ldevmapper" \
./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
gen_die 'Configure of dmraid failed!'
# We dont necessarily have selinux installed yet... look into
# selinux global support in the future.
- sed -i tools/Makefile -e "s|DMRAIDLIBS += -lselinux||g"
+ sed -i tools/Makefile -e "/DMRAID_LIBS +=/s|-lselinux||g"
###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
mkdir -p "${TEMP}/dmraid"
print_info 1 'dmraid: >> Compiling...'
@@ -553,7 +556,7 @@ compile_dmraid() {
gen_die 'Could not create binary cache'
cd "${TEMP}"
- rm -rf "${TEMP}/device-mapper" > /dev/null
+ rm -rf "${TEMP}/lvm" > /dev/null
rm -rf "${DMRAID_DIR}" dmraid
fi
}