From: Antonio Alvarez Feijoo Date: Mon, 2 Jan 2023 08:58:06 +0000 (+0100) Subject: fix: shellcheck 0.8.0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88fe9205de49c12ed8eaac2ca227a72830750955;p=thirdparty%2Fdracut.git fix: shellcheck 0.8.0 --- diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh index c5e45e5e3..e0caf36d6 100755 --- a/modules.d/01fips/fips.sh +++ b/modules.d/01fips/fips.sh @@ -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}" diff --git a/modules.d/35network-legacy/parse-ip-opts.sh b/modules.d/35network-legacy/parse-ip-opts.sh index 6a90f2a1d..b01627b33 100755 --- a/modules.d/35network-legacy/parse-ip-opts.sh +++ b/modules.d/35network-legacy/parse-ip-opts.sh @@ -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 diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh index c75e5f70f..4d3a6b27b 100755 --- a/modules.d/90mdraid/parse-md.sh +++ b/modules.d/90mdraid/parse-md.sh @@ -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 diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh index 15bc3a30f..f00067124 100755 --- a/modules.d/95nfs/nfs-lib.sh +++ b/modules.d/95nfs/nfs-lib.sh @@ -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 ":"