fix(cio_ignore): shellcheck for modules.d/81cio_ignore

master
Harald Hoyer 2021-03-26 10:29:18 +01:00 committed by Harald Hoyer
parent 640458bbf6
commit abc9879c9d
3 changed files with 6 additions and 4 deletions

View File

View File

@ -14,7 +14,7 @@ cmdline() {
local cio_accept

if [ -e /boot/zipl/active_devices.txt ]; then
while read dev etc; do
while read -r dev _; do
[ "$dev" = "#" -o "$dev" = "" ] && continue
if [ -z "$cio_accept" ]; then
cio_accept="$dev"
@ -31,7 +31,8 @@ cmdline() {
# called by dracut
install() {
if [[ $hostonly_cmdline == "yes" ]]; then
local _cio_accept=$(cmdline)
local _cio_accept
_cio_accept=$(cmdline)
[[ $_cio_accept ]] && printf "%s\n" "$_cio_accept" >> "${initdir}/etc/cmdline.d/01cio_accept.conf"
fi


View File

@ -5,17 +5,18 @@
CIO_IGNORE=$(getarg cio_ignore)
CIO_ACCEPT=$(getarg rd.cio_accept)

if [ -z $CIO_IGNORE ]; then
if [ -z "$CIO_IGNORE" ]; then
info "cio_ignored disabled on commandline"
return
fi
if [ -n "$CIO_ACCEPT" ]; then
OLDIFS="$IFS"
IFS=,
# shellcheck disable=SC2086
set -- $CIO_ACCEPT
while (($# > 0)); do
info "Enabling device $1"
cio_ignore --remove $1
cio_ignore --remove "$1"
shift
done
IFS="$OLDIFS"