From 5d8c6d387304b98f91c783a7073a901bd62d3f8c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 5 May 2013 23:04:04 +0200 Subject: [PATCH] Use iscsistart from system, don't compile it --- defaults/initrd.scripts | 9 ++-- defaults/linuxrc | 2 +- defaults/software.sh | 5 -- gen_compile.sh | 50 ------------------- gen_determineargs.sh | 2 - gen_initramfs.sh | 17 +++---- ...-iscsi-2.0.872-omg-calling-configure.patch | 11 ---- 7 files changed, 13 insertions(+), 83 deletions(-) delete mode 100644 patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 27d4066..551bea3 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -754,7 +754,6 @@ startVolumes() { } startiscsi() { - if [ ! -n "${ISCSI_NOIBFT}" ] then good_msg "Activating iSCSI via iBFT" @@ -771,7 +770,6 @@ startiscsi() { else ADDITIONAL="${ADDITIONAL} -g 1" fi - if [ "${ISCSI_PORT}" ] then ADDITIONAL="${ADDITIONAL} -p ${ISCSI_PORT}" @@ -802,14 +800,15 @@ startiscsi() { ADDITIONAL="${ADDITIONAL} -d ${ISCSI_DEBUG}" fi - iscsistart -i "${ISCSI_INITIATORNAME}" -t "${ISCSI_TARGET}" -a "${ISCSI_ADDRESS}" ${ADDITIONAL} + iscsistart -i "${ISCSI_INITIATORNAME}" -t "${ISCSI_TARGET}" \ + -a "${ISCSI_ADDRESS}" ${ADDITIONAL} - # let iscsid settle - otherwise mounting the iSCSI-disk will fail (very rarely, though) + # let iscsid settle - otherwise mounting the iSCSI-disk + # will fail (very rarely, though) sleep 1 fi } - # Open a LUKS device # It is either the root or a swap, other devices are supported in the scripts provided with sys-fs/cryptsetup-luks # $1 - root/swap diff --git a/defaults/linuxrc b/defaults/linuxrc index 6b4d55c..ed40cb3 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -372,7 +372,7 @@ sdelay cd / # Start iSCSI -if [ -e /bin/iscsistart ] +if [ -e /usr/sbin/iscsistart ] then startiscsi fi diff --git a/defaults/software.sh b/defaults/software.sh index 4ca2217..c9faa73 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -13,8 +13,3 @@ BUSYBOX_VER="${BUSYBOX_VER:-VERSION_BUSYBOX}" 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}" - -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}" -ISCSI_BINCACHE="${ISCSI_BINCACHE:-%%CACHE%%/iscsi-${ISCSI_VER}-%%ARCH%%.bz2}" diff --git a/gen_compile.sh b/gen_compile.sh index a68aa52..f3e62e7 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -402,53 +402,3 @@ compile_busybox() { rm -rf "${BUSYBOX_DIR}" > /dev/null fi } - -compile_iscsi() { - if [ ! -f "${ISCSI_BINCACHE}" ] - then - [ ! -f "${ISCSI_SRCTAR}" ] && - gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" - cd "${TEMP}" - rm -rf "${ISCSI_DIR}" - tar -zxpf "${ISCSI_SRCTAR}" - [ ! -d "${ISCSI_DIR}" ] && - gen_die "ISCSI directory ${ISCSI_DIR} invalid" - print_info 1 'iSCSI: >> Compiling...' - cd "${TEMP}/${ISCSI_DIR}" - apply_patches iscsi ${ISCSI_VER} - - # Only build userspace - print_info 1 'iSCSI: >> Configuring userspace...' - cd utils/open-isns || gen_die 'Could not enter open-isns dir' - # we currently have a patch that changes configure.ac - # once given patch is dropped, drop autoconf too - autoconf || gen_die 'Could not tweak open-iscsi configuration' - ./configure --without-slp >> ${LOGFILE} 2>&1 || gen_die 'Could not configure userspace' - cd ../.. || gen_die 'wtf?' - MAKE=${UTILS_MAKE} compile_generic "user" "" - - # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel - mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${KV}/kernel/drivers/scsi/" - for modname in iscsi_tcp libiscsi scsi_transport_iscsi - do - if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ] - then - cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${KV}/kernel/drivers/scsi/" - fi - done - - cd "${TEMP}/initramfs-iscsi-temp/" - print_info 1 'iscsistart: >> Copying to cache...' - [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] || - gen_die 'iscsistart executable does not exist!' - strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" || - gen_die 'Could not strip iscsistart binary!' - bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" || - gen_die 'bzip2 compression of iscsistart failed!' - mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" || - gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?' - - cd "${TEMP}" - rm -rf "${ISCSI_DIR}" > /dev/null - fi -} diff --git a/gen_determineargs.sh b/gen_determineargs.sh index d9dc153..106c172 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -141,13 +141,11 @@ determine_real_args() { CACHE_DIR=`arch_replace "${CACHE_DIR}"` BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"` - ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"` BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"` - ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"` BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"` if [ -n "${CMD_BOOTLOADER}" ] diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 819f83c..dd0fccb 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -242,19 +242,18 @@ append_iscsi(){ then rm -r "${TEMP}/initramfs-iscsi-temp/" fi - print_info 1 'iSCSI: Adding support (compiling binaries)...' - compile_iscsi - cd ${TEMP} - mkdir -p "${TEMP}/initramfs-iscsi-temp/bin/" - /bin/bzip2 -dc "${ISCSI_BINCACHE}" > "${TEMP}/initramfs-iscsi-temp/bin/iscsistart" || - gen_die "Could not extract iscsi binary cache!" - chmod a+x "${TEMP}/initramfs-iscsi-temp/bin/iscsistart" - cd "${TEMP}/initramfs-iscsi-temp/" + print_info 1 'iSCSI: Adding support (copying binaries from system)...' + + mkdir -p "${TEMP}/initramfs-iscsi-temp/usr/sbin/" + + copy_binaries /usr/sbin/iscsistart + + cd "${TEMP}/initramfs-iscsi-temp" log_future_cpio_content find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ || gen_die "compressing iscsi cpio" cd "${TEMP}" - rm -rf "${TEMP}/initramfs-iscsi-temp" > /dev/null + rm -r "${TEMP}/initramfs-iscsi-temp/" } append_lvm(){ diff --git a/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch b/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch deleted file mode 100644 index 185f1ac..0000000 --- a/patches/iscsi/2.0-872/open-iscsi-2.0.872-omg-calling-configure.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- open-iscsi-2.0-872.orig/Makefile -+++ open-iscsi-2.0-872/Makefile -@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example - all: user kernel - - user: ; -- cd utils/open-isns; ./configure; $(MAKE) -+ cd utils/open-isns; $(MAKE) - $(MAKE) -C utils/sysdeps - $(MAKE) -C utils/fwparam_ibft - $(MAKE) -C usr