From ae895e8ad8b7aa72ea47677a554409250dd44656 Mon Sep 17 00:00:00 2001 From: craig Date: Sat, 3 Oct 2009 15:44:28 +0200 Subject: [PATCH] Build iSCSI as module from the kernel, userspace from open-iscsi --- gen_compile.sh | 23 ++++++++++++----------- gen_configkernel.sh | 9 ++++++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index 1c28519..7bab9e1 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -632,19 +632,20 @@ compile_iscsi() { [ ! -d "${ISCSI_DIR}" ] && gen_die "ISCSI directory ${ISCSI_DIR} invalid" print_info 1 'iSCSI: >> Compiling...' - cd "${TEMP}/${ISCSI_DIR}/utils/fwparam_ibft" - MAKE=${UTILS_MAKE} compile_generic "" "" - cd "${TEMP}/${ISCSI_DIR}/usr" - MAKE=${UTILS_MAKE} compile_generic "" "" - cd "${TEMP}/${ISCSI_DIR}/kernel" + cd "${TEMP}/${ISCSI_DIR}" - # Find out target kernel Version, make modules for that version - RELEASE=$(head -n 4 ${CMD_KERNEL_DIR}/Makefile | sed -r -e 's/^VERSION = (.*)/\1./g' -e 's/PATCHLEVEL = (.*)/\1./g' -e 's/SUBLEVEL = (.*)/\1/g' -e 's/EXTRAVERSION = (.*)/\1/g' | tr -d '\n') - KERNELRELEASE=${RELEASE} MAKE=${UTILS_MAKE} compile_generic "" "" - - # copy kernel modules to initramfs + # Only build userspace + 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/${RELEASE}/kernel/drivers/scsi/" - cp *.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/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/${RELEASE}/kernel/drivers/scsi/" + fi + done cd "${TEMP}/initramfs-iscsi-temp/" print_info 1 'iscsistart: >> Copying to cache...' diff --git a/gen_configkernel.sh b/gen_configkernel.sh index ebc6fde..8c00f8d 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -101,13 +101,16 @@ config_kernel() { sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g' fi - # Make sure the iscsi modules are off if --iscsi + # Make sure iSCSI modules are enabled in the kernel, if --iscsi # CONFIG_SCSI_ISCSI_ATTRS # CONFIG_ISCSI_TCP if isTrue ${CMD_ISCSI} then - sed -i ${KERNEL_DIR}/.config -e 's/^CONFIG_SCSI_ISCSI_ATTRS=\(.*\)/\# CONFIG_SCSI_ISCSI_ATTRS is not set/g' - sed -i ${KERNEL_DIR}/.config -e 's/^CONFIG_ISCSI_TCP=\(.*\)/\# CONFIG_ISCSI_TCP is not set/g' + sed -i ${KERNEL_DIR}/.config -e 's/\# CONFIG_ISCSI_TCP is not set/CONFIG_ISCSI_TCP=m/g' + sed -i ${KERNEL_DIR}/.config -e 's/\# CONFIG_SCSI_ISCSI_ATTRS is not set/CONFIG_SCSI_ISCSI_ATTRS=m/g' + + sed -i ${KERNEL_DIR}/.config -e 's/CONFIG_ISCSI_TCP=y/CONFIG_ISCSI_TCP=m/g' + sed -i ${KERNEL_DIR}/.config -e 's/CONFIG_SCSI_ISCSI_ATTRS=y/CONFIG_SCSI_ISCSI_ATTRS=m/g' fi if isTrue ${SPLASH}