install mount script if iscsistart succeeded and add iscsi udev rule
parent
1c709728ec
commit
c094baa0fb
|
@ -122,7 +122,10 @@ echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi
|
||||||
|
|
||||||
# FIXME $iscsi_protocol??
|
# FIXME $iscsi_protocol??
|
||||||
|
|
||||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh
|
if [ -n "${root%%block:*}" ]; then
|
||||||
|
# if root is not specified try to mount the whole iSCSI LUN
|
||||||
|
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||||
|
fi
|
||||||
|
|
||||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||||
|
@ -132,6 +135,12 @@ iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||||
${iscsi_in_username+-U $iscsi_in_username} \
|
${iscsi_in_username+-U $iscsi_in_username} \
|
||||||
${iscsi_in_password+-W $iscsi_in_password} || exit 1
|
${iscsi_in_password+-W $iscsi_in_password} || exit 1
|
||||||
|
|
||||||
|
# install mount script
|
||||||
|
if [ -n "${root%%block:*}" ]; then
|
||||||
|
# if root is not specified try to mount the whole iSCSI LUN
|
||||||
|
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh
|
||||||
|
fi
|
||||||
|
|
||||||
# now we have a root filesystem somewhere in /dev/sda*
|
# now we have a root filesystem somewhere in /dev/sda*
|
||||||
# let the normal block handler handle root=
|
# let the normal block handler handle root=
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue