gen_compile: use MDADM from system

cleanup-cruft
Fabio Erculiani 12 years ago
parent 7e73673abe
commit 874707d0f7

@ -14,11 +14,6 @@ BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}"
BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}"
BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}"
MDADM_VER="${MDADM_VER:-VERSION_MDADM}"
MDADM_DIR="${MDADM_DIR:-mdadm-${MDADM_VER}}"
MDADM_SRCTAR="${MDADM_SRCTAR:-${DISTDIR}/mdadm-${MDADM_VER}.tar.bz2}"
MDADM_BINCACHE="${MDADM_BINCACHE:-%%CACHE%%/mdadm-${MDADM_VER}-%%ARCH%%.tar.bz2}"
ISCSI_VER="${ISCSI_VER:-VERSION_ISCSI}"
ISCSI_DIR="${ISCSI_DIR:-open-iscsi-${ISCSI_VER}}"
ISCSI_SRCTAR="${ISCSI_SRCTAR:-${DISTDIR}/open-iscsi-${ISCSI_VER}.tar.gz}"

@ -440,45 +440,6 @@ compile_busybox() {
fi
}
compile_mdadm() {
if [ -f "${MDADM_BINCACHE}" ]
then
print_info 1 ' MDADM: Using cache'
else
[ -f "${MDADM_SRCTAR}" ] ||
gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
cd "${TEMP}"
rm -rf "${MDADM_DIR}" > /dev/null
/bin/tar -jxpf "${MDADM_SRCTAR}" ||
gen_die 'Could not extract MDADM source tarball!'
[ -d "${MDADM_DIR}" ] ||
gen_die "MDADM directory ${MDADM_DIR} is invalid!"
cd "${MDADM_DIR}"
apply_patches mdadm ${MDADM_VER}
sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
print_info 1 'mdadm: >> Compiling...'
compile_generic 'mdadm mdmon' utils
mkdir -p "${TEMP}/mdadm/sbin"
install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
install -m 0755 -s mdmon "${TEMP}/mdadm/sbin/mdmon"
print_info 1 ' >> Copying to bincache...'
cd "${TEMP}/mdadm"
${UTILS_CROSS_COMPILE}strip "sbin/mdadm" "sbin/mdmon" ||
gen_die 'Could not strip mdadm binaries!'
/bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm sbin/mdmon ||
gen_die 'Could not create binary cache'
cd "${TEMP}"
rm -rf "${MDADM_DIR}" mdadm
fi
}
compile_fuse() {
if [ ! -f "${FUSE_BINCACHE}" ]
then

@ -144,7 +144,6 @@ determine_real_args() {
CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
MDADM_BINCACHE=`cache_replace "${MDADM_BINCACHE}"`
ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
FUSE_BINCACHE=`cache_replace "${FUSE_BINCACHE}"`
@ -154,7 +153,6 @@ determine_real_args() {
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`
MDADM_BINCACHE=`arch_replace "${MDADM_BINCACHE}"`
ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
FUSE_BINCACHE=`arch_replace "${FUSE_BINCACHE}"`

@ -357,13 +357,16 @@ append_mdadm(){
cd ${TEMP}
mkdir -p "${TEMP}/initramfs-mdadm-temp/etc/"
mkdir -p "${TEMP}/initramfs-mdadm-temp/sbin/"
if [ "${MDADM}" = '1' ]
then
copy_binaries "${TEMP}/initramfs-mdadm-temp" \
/sbin/mdadm /sbin/mdmon /sbin/mdassemble
if [ -n "${MDADM_CONFIG}" ]
then
if [ -f "${MDADM_CONFIG}" ]
then
cp -a "${MDADM_CONFIG}" "${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \
cp -a "${MDADM_CONFIG}" \
"${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \
|| gen_die "Could not copy mdadm.conf!"
else
gen_die 'sl${MDADM_CONFIG} does not exist!'
@ -372,19 +375,6 @@ append_mdadm(){
print_info 1 ' MDADM: Skipping inclusion of mdadm.conf'
fi
if [ -e '/sbin/mdadm' ] && LC_ALL="C" ldd /sbin/mdadm | grep -q 'not a dynamic executable' \
&& [ -e '/sbin/mdmon' ] && LC_ALL="C" ldd /sbin/mdmon | grep -q 'not a dynamic executable'
then
print_info 1 ' MDADM: Adding support (using local static binaries /sbin/mdadm and /sbin/mdmon)...'
cp /sbin/mdadm /sbin/mdmon "${TEMP}/initramfs-mdadm-temp/sbin/" ||
gen_die 'Could not copy over mdadm!'
else
print_info 1 ' MDADM: Adding support (compiling binaries)...'
compile_mdadm
/bin/tar -jxpf "${MDADM_BINCACHE}" -C "${TEMP}/initramfs-mdadm-temp" ||
gen_die "Could not extract mdadm binary cache!";
fi
fi
cd "${TEMP}/initramfs-mdadm-temp/"
log_future_cpio_content
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \

@ -1,26 +0,0 @@
From 5296bc73a66e9eee31ba79d26aa02543205a7a26 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Tue, 30 Aug 2011 14:38:14 +0200
Subject: [PATCH] Replace "-z now" by "-Wl,-z,now" to fix compilation with GCC
4.4.5 on Alpha (bug #331653)
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index e2c65a5..0cc9a87 100644
--- a/Makefile
+++ b/Makefile
@@ -167,7 +167,7 @@ mdmon.O2 : $(MON_SRCS) mdadm.h mdmon.h
# use '-z now' to guarantee no dynamic linker interactions with the monitor thread
mdmon : $(MON_OBJS)
- $(CC) $(LDFLAGS) $(MON_LDFLAGS) -z now -o mdmon $(MON_OBJS) $(LDLIBS)
+ $(CC) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS)
msg.o: msg.c msg.h
test_stripe : restripe.c mdadm.h
--
1.7.6.1
Loading…
Cancel
Save