chiark / gitweb /
path_id: remove broken example
[elogind.git] / extras / path_id / path_id
index 44754cdedd23888e1051d9992c42cee16b269c43..a7d650bf423b62b46cfd188d3b31c9814d370c53 100644 (file)
 #      This program is free software; you can redistribute it and/or modify it
 #      under the terms of the GNU General Public License as published by the
 #      Free Software Foundation version 2 of the License.
-#
-# to be called from a udev rule to return the name for a symlink
-#      DEVPATH=<devpath>; path_id
-#      path_id <devpath>
-
-# examples for all block devices on a system:
-#      for i in `find /sys/class/block`; do DEVPATH="`echo $i | sed -e 's@^/sys\|/dev@@g'`"; path_id; done
 
 SYSFS=/sys
 RESULT=1
@@ -332,6 +325,7 @@ handle_iscsi() {
        local iscsi_session_dir
        local iscsi_session iscsi_session_path
        local iscsi_connection iscsi_connection_path
+       local iscsi_scsi_lun
        # iSCSI device
        iscsi_session_dir="${DEV%%/target*}"
        iscsi_session="${iscsi_session_dir##*/}"
@@ -378,7 +372,8 @@ handle_iscsi() {
        if [ -e "${iscsi_connection_path}/persistent_port" ] ; then
            read iscsi_port < ${iscsi_connection_path}/persistent_port
        fi
-       d="ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}"
+       iscsi_scsi_lun="${DEV##*:}"
+       d="ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${iscsi_scsi_lun}"
        RESULT=0
 }