Build iSCSI as module from the kernel, userspace from open-iscsi
authorcraig <craig@haquarter.de>
Sat, 3 Oct 2009 13:44:28 +0000 (15:44 +0200)
committercraig <craig@haquarter.de>
Sat, 3 Oct 2009 13:44:28 +0000 (15:44 +0200)
gen_compile.sh
gen_configkernel.sh

index 1c2851999015b7edd15801c4f036011c6bdfbca3..7bab9e1cfc4c1e5585db7e3864d34e103051d8fd 100755 (executable)
@@ -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...'
index ebc6fdeef9d3685147573ab826212551c619aa43..8c00f8d5e158ee319351226cb69dc25d851adedc 100755 (executable)
@@ -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}