Use iscsistart from system, don't compile it

cleanup-cruft
Fabio Erculiani 12 years ago
parent 45c54977bd
commit 5d8c6d3873

@ -754,7 +754,6 @@ startVolumes() {
} }
startiscsi() { startiscsi() {
if [ ! -n "${ISCSI_NOIBFT}" ] if [ ! -n "${ISCSI_NOIBFT}" ]
then then
good_msg "Activating iSCSI via iBFT" good_msg "Activating iSCSI via iBFT"
@ -771,7 +770,6 @@ startiscsi() {
else else
ADDITIONAL="${ADDITIONAL} -g 1" ADDITIONAL="${ADDITIONAL} -g 1"
fi fi
if [ "${ISCSI_PORT}" ] if [ "${ISCSI_PORT}" ]
then then
ADDITIONAL="${ADDITIONAL} -p ${ISCSI_PORT}" ADDITIONAL="${ADDITIONAL} -p ${ISCSI_PORT}"
@ -802,14 +800,15 @@ startiscsi() {
ADDITIONAL="${ADDITIONAL} -d ${ISCSI_DEBUG}" ADDITIONAL="${ADDITIONAL} -d ${ISCSI_DEBUG}"
fi 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 sleep 1
fi fi
} }
# Open a LUKS device # 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 # It is either the root or a swap, other devices are supported in the scripts provided with sys-fs/cryptsetup-luks
# $1 - root/swap # $1 - root/swap

@ -372,7 +372,7 @@ sdelay
cd / cd /
# Start iSCSI # Start iSCSI
if [ -e /bin/iscsistart ] if [ -e /usr/sbin/iscsistart ]
then then
startiscsi startiscsi
fi fi

@ -13,8 +13,3 @@ BUSYBOX_VER="${BUSYBOX_VER:-VERSION_BUSYBOX}"
BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}" BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}"
BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}" BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}"
BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}" 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}"

@ -402,53 +402,3 @@ compile_busybox() {
rm -rf "${BUSYBOX_DIR}" > /dev/null rm -rf "${BUSYBOX_DIR}" > /dev/null
fi 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
}

@ -141,13 +141,11 @@ determine_real_args() {
CACHE_DIR=`arch_replace "${CACHE_DIR}"` CACHE_DIR=`arch_replace "${CACHE_DIR}"`
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"` BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"` BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"` BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`
ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"` BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
if [ -n "${CMD_BOOTLOADER}" ] if [ -n "${CMD_BOOTLOADER}" ]

@ -242,19 +242,18 @@ append_iscsi(){
then then
rm -r "${TEMP}/initramfs-iscsi-temp/" rm -r "${TEMP}/initramfs-iscsi-temp/"
fi fi
print_info 1 'iSCSI: Adding support (compiling binaries)...' print_info 1 'iSCSI: Adding support (copying binaries from system)...'
compile_iscsi
cd ${TEMP} mkdir -p "${TEMP}/initramfs-iscsi-temp/usr/sbin/"
mkdir -p "${TEMP}/initramfs-iscsi-temp/bin/"
/bin/bzip2 -dc "${ISCSI_BINCACHE}" > "${TEMP}/initramfs-iscsi-temp/bin/iscsistart" || copy_binaries /usr/sbin/iscsistart
gen_die "Could not extract iscsi binary cache!"
chmod a+x "${TEMP}/initramfs-iscsi-temp/bin/iscsistart" cd "${TEMP}/initramfs-iscsi-temp"
cd "${TEMP}/initramfs-iscsi-temp/"
log_future_cpio_content log_future_cpio_content
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
|| gen_die "compressing iscsi cpio" || gen_die "compressing iscsi cpio"
cd "${TEMP}" cd "${TEMP}"
rm -rf "${TEMP}/initramfs-iscsi-temp" > /dev/null rm -r "${TEMP}/initramfs-iscsi-temp/"
} }
append_lvm(){ append_lvm(){

@ -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
Loading…
Cancel
Save