Improve naming of bootflags, added support for: port, target portal, username, passwo...
authorcraig <craig@haquarter.de>
Sat, 3 Oct 2009 11:23:24 +0000 (13:23 +0200)
committercraig <craig@haquarter.de>
Sat, 3 Oct 2009 11:23:24 +0000 (13:23 +0200)
TODO
defaults/initrd.scripts
defaults/linuxrc
gen_initramfs.sh
genkernel

diff --git a/TODO b/TODO
index afa1b5cfae1b8ab83b52e3c4fd4d5a47b7dad594..20bc119282e5719493bc4921e25330daef662af3 100644 (file)
--- 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
index 76c5c9b0e3d682d76f860b8dae41d6bf4c5b9dfe..c5246d5f57c8358a396bb15bde9ea6126ca8590d 100755 (executable)
@@ -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
 }
 
 
index d50d95a2a05f3286671bf4f9cad42e91e263af1b..8ff1b6d0a0c9aa8a45628c196b1fd34dbfed5d4a 100755 (executable)
@@ -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
index 30731a4792cbe8002c58d8038a489d9e7a1284c2..d8a363d346eb2ed5a6b686efa3c2842982f96cae 100755 (executable)
@@ -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/"
index 767fe534fcba37e818685f4b47d1e94f7ace6a6f..d8374c46d2055f541b4d7c9c0f8b4b6b4a436966 100755 (executable)
--- 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=<additional options>"'
-       [ "${ISCSI}" -eq '1' ] && print_info 1 'add "iscsi_i=<initiator name> iscsi_t=<target name> iscsi_a=<target ip>" for iscsi support'
+       [ "${ISCSI}" -eq '1' ] && print_info 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support'
 fi
 
 [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}