]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(cio_ignore): shellcheck for modules.d/81cio_ignore
authorHarald Hoyer <harald@redhat.com>
Fri, 26 Mar 2021 09:29:18 +0000 (10:29 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 29 Mar 2021 08:09:51 +0000 (10:09 +0200)
modules.d/81cio_ignore/.shchkdir [new file with mode: 0644]
modules.d/81cio_ignore/module-setup.sh
modules.d/81cio_ignore/parse-cio_accept.sh

diff --git a/modules.d/81cio_ignore/.shchkdir b/modules.d/81cio_ignore/.shchkdir
new file mode 100644 (file)
index 0000000..e69de29
index 3704ffd830d1d136e30c7d9d0cd2c2a3ba03d9da..a54fcb9bda55b47a55d6d8cf896d5c36f8cd2154 100755 (executable)
@@ -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
 
index 80dc6235f943d7dfc77475062b0293bfc4d97d09..d449be52573e145fead6d7972c20369f848c90ea 100755 (executable)
@@ -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"