aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcraig <craig@haquarter.de>2008-11-21 22:46:36 +0100
committercraig <craig@haquarter.de>2009-06-28 20:37:33 +0200
commitcac66e09707752906215511e69ef1141d56bd2c4 (patch)
treef414f837483a702ada87001cea5fad12487f9c82 /gen_compile.sh
parentApply fix to deference links for gentoo bug #269603 (diff)
downloadgenkernel-cac66e09707752906215511e69ef1141d56bd2c4.tar.gz
genkernel-cac66e09707752906215511e69ef1141d56bd2c4.tar.bz2
genkernel-cac66e09707752906215511e69ef1141d56bd2c4.zip
iSCSI patch for genkernel
Diffstat (limited to 'gen_compile.sh')
-rwxr-xr-xgen_compile.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/gen_compile.sh b/gen_compile.sh
index 3379b61..6256662 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -619,3 +619,45 @@ compile_unionfs_fuse() {
rm -rf "${UNIONFS_FUSE_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}/utils/fwparam_ibft"
+ MAKE=${UTILS_MAKE} compile_generic "" ""
+ cd "${TEMP}/${ISCSI_DIR}/usr"
+ MAKE=${UTILS_MAKE} compile_generic "" ""
+ cd "${TEMP}/${ISCSI_DIR}/kernel"
+
+ # 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
+ mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
+ cp *.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
+
+ 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
+}
+