代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/dracut 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0df65c3c001fb5656838274b172c247c41dc0442 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Thu, 4 Apr 2019 17:12:07 +0200
Subject: [PATCH] iscsiroot: remove bashisms
According to the dracut README, module code to be run in
the initrd must be POSIX-compliant. Replace remaining
bashisms (as reported by checkbashisms) with POSIX compliant
code.
The use of "type" is not strictly POSIX compliant, but it's
all over the place in dracut code. dash supports it, anyway.
---
modules.d/95iscsi/iscsiroot.sh | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index e8e0b4b8..4ab0b6a0 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -54,11 +54,11 @@ handle_firmware()
if ! iscsiadm -m fw; then
warn "iscsiadm: Could not get list of targets from firmware."
else
- ifaces=( $(echo /sys/firmware/ibft/ethernet*) )
+ ifaces=$(set -- /sys/firmware/ibft/ethernet*; echo $#)
retry=$(cat /tmp/session-retry)
- if [ $retry -lt ${#ifaces[*]} ]; then
- let retry++
+ if [ $retry -lt $ifaces ]; then
+ retry=$((retry+1))
echo $retry > /tmp/session-retry
return 1
else
@@ -88,6 +88,7 @@ handle_netroot()
local iscsi_iface_name iscsi_netdev_name
local iscsi_param param
local p found
+ local login_retry_max_seen=
# override conf settings by command line options
arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
@@ -103,7 +104,9 @@ handle_netroot()
arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
for p in $(getargs rd.iscsi.param -d iscsi_param); do
- iscsi_param="$iscsi_param $p"
+ [ "${p%=*}" = node.session.initial_login_retry_max ] && \
+ login_retry_max_seen=yes
+ iscsi_param="$iscsi_param $p"
done
# this sets iscsi_target_name and possibly overwrites most
@@ -116,15 +119,12 @@ handle_netroot()
fi
#limit iscsistart login retries
- case "$iscsi_param" in
- *node.session.initial_login_retry_max*) ;;
- *)
- retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max)
- if [ $retries -gt 0 ]; then
- iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries"
- fi
- ;;
- esac
+ if [ "$login_retry_max_seen" != yes ]; then
+ retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max)
+ if [ $retries -gt 0 ]; then
+ iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries"
+ fi
+ fi
# XXX is this needed?
getarg ro && iscsirw=ro
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。