From fd3eddf06990a617a2f90b0a699947ab3faf2cc2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 10 Sep 2015 13:25:13 +0200 Subject: [PATCH] iscsi/iscsiroot.sh: handle iscsi_firmware in online and timeout queue The return code of iscsi_firmware is broken, so set the marker unconditionally. --- modules.d/95iscsi/iscsiroot.sh | 43 +++++++++++++++------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh index 424d2166..ea1bead7 100755 --- a/modules.d/95iscsi/iscsiroot.sh +++ b/modules.d/95iscsi/iscsiroot.sh @@ -45,29 +45,23 @@ fi handle_firmware() { - if ! [ -e /tmp/iscsistarted-firmware ]; then - if ! iscsistart -f; then - warn "iscistart: Could not get list of targets from firmware." - return 1 - fi + if ! iscsistart -f; then + warn "iscistart: Could not get list of targets from firmware." + return 1 + fi - for p in $(getargs rd.iscsi.param -d iscsi_param); do - iscsi_param="$iscsi_param --param $p" - done + for p in $(getargs rd.iscsi.param -d iscsi_param); do + iscsi_param="$iscsi_param --param $p" + done - if ! iscsistart -b $iscsi_param; then - warn "'iscsistart -b $iscsi_param' failed" - fi + if ! iscsistart -b $iscsi_param; then + warn "'iscsistart -b $iscsi_param' failed with return code $?" + fi - if [ -d /sys/class/iscsi_session ]; then - echo 'started' > "/tmp/iscsistarted-iscsi:" - echo 'started' > "/tmp/iscsistarted-firmware" - else - return 1 - fi + echo 'started' > "/tmp/iscsistarted-iscsi:" + echo 'started' > "/tmp/iscsistarted-firmware" - need_shutdown - fi + need_shutdown return 0 } @@ -238,15 +232,16 @@ if [ "$netif" = "timeout" ] && all_ifaces_setup; then sleep 2 fi -if [ "$netif" = "online" ]; then - if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then +if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then + if [ "$netif" = "timeout" ] || [ "$netif" = "online" ]; then handle_firmware ret=$? fi -else +fi + +if ! [ "$netif" = "online" ]; then # loop over all netroot parameter - nroot=$(getarg netroot) - if [ $? -eq 0 ] && [ "$nroot" != "dhcp" ]; then + if nroot=$(getarg netroot) && [ "$nroot" != "dhcp" ]; then for nroot in $(getargs netroot); do [ "${nroot%%:*}" = "iscsi" ] || continue nroot="${nroot##iscsi:}"