From 97b4dc26e266100b4eba319712188e488712783e Mon Sep 17 00:00:00 2001 From: craig Date: Sat, 3 Oct 2009 13:23:24 +0200 Subject: [PATCH] Improve naming of bootflags, added support for: port, target portal, username, password, username_in, password_in, debug --- TODO | 1 - defaults/initrd.scripts | 47 ++++++++++++++++++++++++++++++++++++----- defaults/linuxrc | 41 ++++++++++++++++++++++++++--------- gen_initramfs.sh | 2 +- genkernel | 2 +- 5 files changed, 75 insertions(+), 18 deletions(-) diff --git a/TODO b/TODO index afa1b5c..20bc119 100644 --- a/TODO +++ b/TODO @@ -17,7 +17,6 @@ - Security Tokens (TPM, Smart Cards, etc) - Software - Block protocols over Ethernet/IP - - iSCSI - ATA over Ethernet - FCP over Ethernet - Infiniband over IP diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 76c5c9b..c5246d5 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -629,13 +629,50 @@ startVolumes() { } startiscsi() { - - if [ -n "${ISCSI_I}" ] && [ -n "${ISCSI_T}" ] && [ -n "${ISCSI_A}" ] + + if [ -n "${ISCSI_INITIATORNAME}" ] && [ -n "${ISCSI_TARGET}" ] && [ -n "${ISCSI_ADDRESS}" ] then - good_msg "Activating ISCSI" - iscsistart -i "${ISCSI_I}" -t "${ISCSI_T}" -g 1 -a ${ISCSI_A} - fi + good_msg "Activating iSCSI" + + if [ "${ISCSI_TGPT}" ] + then + ADDITIONAL="${ADDITIONAL} -g ${ISCSI_TGPT}" + else + ADDITIONAL="${ADDITIONAL} -g 1" + fi + + if [ "${ISCSI_PORT}" ] + then + ADDITIONAL="${ADDITIONAL} -p ${ISCSI_PORT}" + fi + + if [ "${ISCSI_USERNAME}" ] + then + ADDITIONAL="${ADDITIONAL} -u ${ISCSI_USERNAME}" + fi + if [ "${ISCSI_PASSWORD}" ] + then + ADDITIONAL="${ADDITIONAL} -w ${ISCSI_PASSWORD}" + fi + + if [ "${ISCSI_USERNAME_IN}" ] + then + ADDITIONAL="${ADDITIONAL} -U ${ISCSI_USERNAME_IN}" + fi + + if [ "${ISCSI_PASSWORD_IN}" ] + then + ADDITIONAL="${ADDITIONAL} -W ${ISCSI_PASSWORD_IN}" + fi + + if [ "${ISCSI_DEBUG}" ] + then + ADDITIONAL="${ADDITIONAL} -d ${ISCSI_DEBUG}" + fi + + iscsistart -i "${ISCSI_INITIATORNAME}" -t "${ISCSI_TARGET}" -a "${ISCSI_ADDRESS}" ${ADDITIONAL} + fi } diff --git a/defaults/linuxrc b/defaults/linuxrc index d50d95a..8ff1b6d 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -149,15 +149,36 @@ do nfsroot\=*) NFSROOT=`parse_opt "${x}"` ;; - # ISCSI - iscsi_i\=*) - ISCSI_I=`parse_opt "${x}"` + # iSCSI + iscsi_initiatorname\=*) + ISCSI_INITIATORNAME=`parse_opt "${x}"` ;; - iscsi_t\=*) - ISCSI_T=`parse_opt "${x}"` + iscsi_target\=*) + ISCSI_TARGET=`parse_opt "${x}"` ;; - iscsi_a\=*) - ISCSI_A=`parse_opt "${x}"` + iscsi_tgpt\=*) + ISCSI_TGPT=`parse_opt "${x}"` + ;; + iscsi_address\=*) + ISCSI_ADDRESS=`parse_opt "${x}"` + ;; + iscsi_port\=*) + ISCSI_PORT=`parse_opt "${x}"` + ;; + iscsi_username\=*) + ISCSI_USERNAME=`parse_opt "${x}"` + ;; + iscsi_password\=*) + ISCSI_PASSWORD=`parse_opt "${x}"` + ;; + iscsi_username_in\=*) + ISCSI_USERNAME_IN=`parse_opt "${x}"` + ;; + iscsi_password_in\=*) + ISCSI_PASSWORD_IN=`parse_opt "${x}"` + ;; + iscsi_debug\=*) + ISCSI_DEBUG=`parse_opt "${x}"` ;; # Crypto crypt_root\=*) @@ -268,15 +289,15 @@ sdelay # Start device manager start_dev_mgr +# Start iSCSI +startiscsi + # Setup md device nodes if they dont exist setup_md_device # Scan volumes startVolumes -# Start ISCSI -startiscsi - setup_keymap # Initialize LUKS root device except for livecd's diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 30731a4..d8a363d 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -204,7 +204,7 @@ append_iscsi(){ then rm -r "${TEMP}/initramfs-iscsi-temp/" fi - print_info 1 'ISCSI: Adding support (compiling binaries)...' + print_info 1 'iSCSI: Adding support (compiling binaries)...' compile_iscsi cd ${TEMP} mkdir -p "${TEMP}/initramfs-iscsi-temp/bin/" diff --git a/genkernel b/genkernel index 767fe53..d8374c4 100755 --- a/genkernel +++ b/genkernel @@ -348,7 +348,7 @@ then [ "${EVMS}" -eq '1' ] && print_info 1 'add "doevms" for evms support' [ "${DMRAID}" -eq '1' ] && print_info 1 'add "dodmraid" for dmraid support' [ "${DMRAID}" -eq '1' ] && print_info 1 ' or "dodmraid="' - [ "${ISCSI}" -eq '1' ] && print_info 1 'add "iscsi_i= iscsi_t= iscsi_a=" for iscsi support' + [ "${ISCSI}" -eq '1' ] && print_info 1 'add at least "iscsi_initiatorname= iscsi_target= and iscsi_address=" for iscsi support' fi [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR} -- 2.26.2