[ ! -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...'
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}