From c094baa0fb7081bb9e87b4f58f0531811786f091 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 13 Jul 2009 13:48:09 +0200 Subject: [PATCH] install mount script if iscsistart succeeded and add iscsi udev rule --- modules.d/95iscsi/iscsiroot | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules.d/95iscsi/iscsiroot b/modules.d/95iscsi/iscsiroot index b7e3cf83..5eff6250 100755 --- a/modules.d/95iscsi/iscsiroot +++ b/modules.d/95iscsi/iscsiroot @@ -122,7 +122,10 @@ echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi # 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 \ -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_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* # let the normal block handler handle root= exit 0