]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix: ignore shellcheck SC2329 in addition to SC2317
authorBenjamin Drung <benjamin.drung@canonical.com>
Wed, 13 Aug 2025 10:33:12 +0000 (12:33 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 31 Aug 2025 13:55:56 +0000 (09:55 -0400)
Shellcheck <= 0.10 complains about SC2317 (info): Command appears to be
unreachable. Check usage (or ignore if invoked indirectly). Shellcheck
0.11 changes this complaint to SC2329 (info): This function is never
invoked. Check usage (or ignored if invoked indirectly).

So ignore shellcheck SC2329 in addition to SC2317 to make both
shellcheck versions happy.

dracut-logger.sh
lsinitrd.sh
modules.d/30convertfs/convertfs.sh
modules.d/70kernel-modules/module-setup.sh
modules.d/70multipath/module-setup.sh
modules.d/74fcoe-uefi/module-setup.sh
modules.d/74fcoe/module-setup.sh
modules.d/74iscsi/module-setup.sh
modules.d/74lunmask/module-setup.sh
modules.d/74nvmf/module-setup.sh
test/TEST-80-GETARG/test.sh

index 7c075f973c35f157a32252cebaa22c016958e815..5ee97c0489760f4f05ee3f3b5fac1d77887bcebc 100755 (executable)
@@ -179,40 +179,40 @@ dlog_init() {
 
     if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
         unset dtrace
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         dtrace() { :; }
     fi
 
     if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then
         unset ddebug
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         ddebug() { :; }
     fi
 
     if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then
         unset dinfo
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         dinfo() { :; }
     fi
 
     if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then
         unset dwarn
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         dwarn() { :; }
         unset dwarning
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         dwarning() { :; }
     fi
 
     if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then
         unset derror
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         derror() { :; }
     fi
 
     if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then
         unset dfatal
-        # shellcheck disable=SC2317  # exposed via API
+        # shellcheck disable=SC2317,SC2329  # exposed via API
         dfatal() { :; }
     fi
 
index 62dec58b4daa8a2293ca99387f6b453ec4f64e0a..7e1807f49ac39300ccf1b29e210ee6b450a46c4b 100755 (executable)
@@ -480,7 +480,7 @@ type "${CAT%% *}" > /dev/null 2>&1 || {
     exit 1
 }
 
-# shellcheck disable=SC2317  # assigned to CAT and $CAT called later
+# shellcheck disable=SC2317,SC2329  # assigned to CAT and $CAT called later
 skipcpio() {
     $SKIP "$@" | $ORIG_CAT
 }
@@ -493,7 +493,7 @@ fi
 if ((${#filenames[@]} > 1)); then
     TMPFILE="$TMPDIR/initrd.cpio"
     $CAT "$image" 2> /dev/null > "$TMPFILE"
-    # shellcheck disable=SC2317  # assigned to CAT and $CAT called later
+    # shellcheck disable=SC2317,SC2329  # assigned to CAT and $CAT called later
     pre_decompress() {
         cat "$TMPFILE"
     }
index 73587886afa4c6830b81ee4f7ef139777da5ed84..0b3b00dd2f4a003b5577f1a8e84e70564d9229a0 100755 (executable)
@@ -73,7 +73,7 @@ fi
 rm -f -- "$testfile"
 
 # clean up after ourselves no matter how we die.
-# shellcheck disable=SC2317  # called via EXIT trap
+# shellcheck disable=SC2317,SC2329  # called via EXIT trap
 cleanup() {
     echo "Something failed. Move back to the original state"
     for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64" \
index a34846ec8380f2c29e94d6727dfa2a23acf8dcaa..975a6f02c148697f8b63564b19c03c8a24bbbf43 100755 (executable)
@@ -5,7 +5,7 @@ installkernel() {
     local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_alloc_disk|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk'
     local -A _hostonly_drvs
 
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     record_block_dev_drv() {
 
         for _mod in $(get_dev_module /dev/block/"$1"); do
index 0b05e5af0f49da491f5df080275fa37c3c48e483..45c173aedbb735af79be95b346bf42a597e3e24d 100755 (executable)
@@ -69,7 +69,7 @@ install() {
     local -A _allow
     local config_dir
 
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     add_hostonly_mpath_conf() {
         if is_mpath "$1"; then
             local _dev
index 5a9aa8342ffb28fcd2aac59233849558662a18ee..ae4e011e4f7d78298ad735c12f35a5fea10b47ac 100755 (executable)
@@ -2,7 +2,7 @@
 
 # called by dracut
 check() {
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     is_fcoe() {
         block_is_fcoe "$1" || return 1
     }
index 9937a22c9c6aaa9a0da75f1943969816080e581e..2888545b9b0ae0873ddacc15915170ef8cd167ed 100755 (executable)
@@ -2,7 +2,7 @@
 
 # called by dracut
 check() {
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     is_fcoe() {
         block_is_fcoe "$1" || return 1
     }
index 4f786167bd1b336176eb9d2138ca6ef69a5852de..59e0cf65f42266d36cca27fb17758010f5c4359d 100755 (executable)
@@ -135,7 +135,7 @@ install_iscsiroot() {
 install_softiscsi() {
     [ -d /sys/firmware/ibft ] && return 0
 
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     is_softiscsi() {
         local _dev=$1
         local iscsi_dev
index 563891c9c9b34539583b775eae4786ffbc218651..d763f8621fe7f54aea4db049644504153d4ce7eb 100755 (executable)
@@ -4,7 +4,7 @@
 
 # called by dracut
 cmdline() {
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     get_lunmask() {
         local _dev=$1
         local _devpath _sdev _lun _rport _end_device _classdev _wwpn _sas_address
index e1c9cbe4899ab9d3515d634363cd64813c9d05c8..cf7c35ce253e65c15aa075a00fe2970e1198e2ab 100755 (executable)
@@ -7,7 +7,7 @@ check() {
     require_binaries nvme jq || return 1
     require_kernel_modules nvme_fabrics || return 1
 
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     is_nvmf() {
         local _dev=$1
         local trtype
@@ -79,7 +79,7 @@ cmdline() {
     local _hostnqn
     local _hostid
 
-    # shellcheck disable=SC2317  # called later by for_each_host_dev_and_slaves
+    # shellcheck disable=SC2317,SC2329  # called later by for_each_host_dev_and_slaves
     gen_nvmf_cmdline() {
         local _dev=$1
         local trtype
index 42349d497f24cd1595f6bbdeb9cfe7af8bb73d73..6bee7ce59e3a9795e5efad7edc8c5d343122a025 100755 (executable)
@@ -95,17 +95,17 @@ test_run() {
         . dracut-dev-lib.sh
         . dracut-lib.sh
 
-        # shellcheck disable=SC2317  # overwrites debug_off from dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # overwrites debug_off from dracut-lib.sh
         debug_off() {
             :
         }
 
-        # shellcheck disable=SC2317  # overwrites debug_on from dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # overwrites debug_on from dracut-lib.sh
         debug_on() {
             :
         }
 
-        # shellcheck disable=SC2317  # called later by getarg in dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # called later by getarg in dracut-lib.sh
         getcmdline() {
             echo "rd.break=cmdline rd.lvm rd.auto=0 rd.auto rd.retry=10"
         }
@@ -115,7 +115,7 @@ test_run() {
         getargbool 1 rd.lvm || ret=$((ret + 1))
         getargbool 0 rd.auto || ret=$((ret + 1))
 
-        # shellcheck disable=SC2317  # called later by getarg in dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # called later by getarg in dracut-lib.sh
         getcmdline() {
             echo "rd.break=cmdlined rd.lvm=0 rd.auto rd.auto=1 rd.auto=0"
         }
@@ -123,7 +123,7 @@ test_run() {
         getargbool 1 rd.lvm && ret=$((ret + 1))
         getargbool 0 rd.auto && ret=$((ret + 1))
 
-        # shellcheck disable=SC2317  # called later by getarg in dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # called later by getarg in dracut-lib.sh
         getcmdline() {
             echo "ip=a ip=b ip=dhcp6"
         }
@@ -135,7 +135,7 @@ test_run() {
             [[ ${args[$i]} == "${RESULT[$i]}" ]] || ret=$((ret + 1))
         done
 
-        # shellcheck disable=SC2317  # called later by getarg in dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # called later by getarg in dracut-lib.sh
         getcmdline() {
             echo "bridge bridge=val"
         }
@@ -146,7 +146,7 @@ test_run() {
             [[ ${args[$i]} == "${RESULT[$i]}" ]] || ret=$((ret + 1))
         done
 
-        # shellcheck disable=SC2317  # called later by getarg in dracut-lib.sh
+        # shellcheck disable=SC2317,SC2329  # called later by getarg in dracut-lib.sh
         getcmdline() {
             echo "rd.break rd.md.uuid=bf96e457:230c9ad4:1f3e59d6:745cf942 rd.md.uuid=bf96e457:230c9ad4:1f3e59d6:745cf943 rd.shell"
         }