]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck 0.8.0
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 2 Jan 2023 08:58:06 +0000 (09:58 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 4 Jan 2023 05:38:58 +0000 (05:38 +0000)
modules.d/01fips/fips.sh
modules.d/35network-legacy/parse-ip-opts.sh
modules.d/90mdraid/parse-md.sh
modules.d/95nfs/nfs-lib.sh

index c5e45e5e3fa7e812aaa442bd5591c0c437e9741b..e0caf36d663ab5bece1ecf864a27009f54e68b5a 100755 (executable)
@@ -143,7 +143,7 @@ do_fips() {
             BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
 
             BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
-            BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"
+            BOOT_IMAGE_PATH="${BOOT_IMAGE%"${BOOT_IMAGE_NAME}"}"
 
             if [ -z "$BOOT_IMAGE_NAME" ]; then
                 BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
index 6a90f2a1da8e0af2ac8fca3149fb00488dfbfec6..b01627b330a1be545eae5d33a57741193e688261 100755 (executable)
@@ -12,6 +12,9 @@
 # routing,dns,dhcp-options,etc.
 #
 
+# we really need to use `expr substr` with dash
+# shellcheck disable=SC2003 disable=SC2308
+
 command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then
index c75e5f70f8821f97fa25bbb98df360f5699fe1bb..4d3a6b27bd4b39fb5a46c5a0b5a33f6f1a66a2d8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # we really need to use `expr substr` with dash
-# shellcheck disable=SC2003
+# shellcheck disable=SC2003 disable=SC2308
 
 MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
 # normalize the uuid
index 15bc3a30f3425f7af4c2f1899f3ff410731ac4ec..f00067124e73382fd7ee6572d9f5d1f35ed188bb 100755 (executable)
@@ -36,7 +36,7 @@ nfsroot_to_var() {
     # strip nfs[4]:
     local arg="$*:"
     nfs="${arg%%:*}"
-    arg="${arg##$nfs:}"
+    arg="${arg##"$nfs":}"
 
     # check if we have a server
     if strstr "$arg" ':/'; then
@@ -47,7 +47,7 @@ nfsroot_to_var() {
     path="${arg%%:*}"
 
     # rest are options
-    options="${arg##$path}"
+    options="${arg##"$path"}"
     # strip leading ":"
     options="${options##:}"
     # strip  ":"