From 874707d0f7d69fb45f9900203385ebb58e69f6cb Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 26 Apr 2013 11:41:35 +0100 Subject: [PATCH] gen_compile: use MDADM from system --- defaults/software.sh | 5 --- gen_compile.sh | 39 --------------------- gen_determineargs.sh | 2 -- gen_initramfs.sh | 36 +++++++------------ patches/mdadm/3.1.4/mdadm-3.1.4-z-now.patch | 26 -------------- 5 files changed, 13 insertions(+), 95 deletions(-) delete mode 100644 patches/mdadm/3.1.4/mdadm-3.1.4-z-now.patch diff --git a/defaults/software.sh b/defaults/software.sh index dbae78e..f242b5b 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -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}" diff --git a/gen_compile.sh b/gen_compile.sh index e0d15be..c35e7ba 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -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 diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e5371ad..6d006a6 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -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}"` diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 8130970..a591a97 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -357,34 +357,24 @@ append_mdadm(){ cd ${TEMP} mkdir -p "${TEMP}/initramfs-mdadm-temp/etc/" mkdir -p "${TEMP}/initramfs-mdadm-temp/sbin/" - if [ "${MDADM}" = '1' ] - then - if [ -n "${MDADM_CONFIG}" ] - then - if [ -f "${MDADM_CONFIG}" ] - then - 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!' - fi - else - 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' + copy_binaries "${TEMP}/initramfs-mdadm-temp" \ + /sbin/mdadm /sbin/mdmon /sbin/mdassemble + + if [ -n "${MDADM_CONFIG}" ] + then + if [ -f "${MDADM_CONFIG}" ] 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!' + cp -a "${MDADM_CONFIG}" \ + "${TEMP}/initramfs-mdadm-temp/etc/mdadm.conf" \ + || gen_die "Could not copy mdadm.conf!" 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!"; + gen_die 'sl${MDADM_CONFIG} does not exist!' fi + else + print_info 1 ' MDADM: Skipping inclusion of mdadm.conf' fi + cd "${TEMP}/initramfs-mdadm-temp/" log_future_cpio_content find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ diff --git a/patches/mdadm/3.1.4/mdadm-3.1.4-z-now.patch b/patches/mdadm/3.1.4/mdadm-3.1.4-z-now.patch deleted file mode 100644 index 82b0b3e..0000000 --- a/patches/mdadm/3.1.4/mdadm-3.1.4-z-now.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5296bc73a66e9eee31ba79d26aa02543205a7a26 Mon Sep 17 00:00:00 2001 -From: Sebastian Pipping -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 -