use iscsi-iname to generate the initiator name, if not specified

master
Harald Hoyer 2009-06-02 16:10:36 +02:00
parent 61537c7de6
commit 92bfa4c6e3
3 changed files with 3 additions and 12 deletions

View File

@ -7,5 +7,5 @@
#[ "$1" = "-h" ] && ! egrep -q '/ /dev/nbd[0-9]*' /proc/mounts && exit 1

# If our prerequisites are not met, fail anyways.
which iscsistart hostname >/dev/null 2>&1 || exit 1
which iscsistart hostname iscsi-iname >/dev/null 2>&1 || exit 1
exit 0

View File

@ -2,6 +2,7 @@

inst iscsistart
inst hostname
inst iscsi-iname
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
inst_hook netroot 90 "$moddir/iscsi-netroot.sh"
inst "$moddir/iscsiroot" "/sbin/iscsiroot"

View File

@ -87,17 +87,7 @@ else
fi

if [ -z $iscsi_initiator ]; then
[ -f /tmp/net.$netif.dhcpopts ] && . /tmp/net.$netif.dhcpopts
hostname=$new_host_name
[ -z "$hostname" ] && hostname=arpa.in-addr.$new_ip_address
OLDIFS="$IFS"
IFS=.
unset revname
for i in $hostname; do
revname=${i}${revname+.$revname}
done
IFS="$OLDIFS"
iscsi_initiator=iqn.2009-01.$revname
iscsi_initiator=$(iscsi-iname)
fi

echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi