zdev/dracut: add shellcheck annotations for recently added code

The annotations and the one non-functional code change in
zdev/dracut/95zdev-kdump/module-setup.sh check() clear all shellcheck
reports.

complements
73c46a3056 ("zdev/dracut: fix kdump by only activating required devices")

Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2023-07-24 17:10:24 +02:00
committed by Jan Höppner
parent 231c02cdeb
commit 1266f86444
3 changed files with 10 additions and 5 deletions
+7 -5
View File
@@ -16,9 +16,10 @@ check() {
local _arch=${DRACUT_ARCH:-$(uname -m)}
# Ensure that we're running on s390
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
[ "$_arch" = "s390" ] || [ "$_arch" = "s390x" ] || return 1
source "$moddir/../95zdev/zdev-lib.sh"
# shellcheck source=/dev/null
source "${moddir:?}/../95zdev/zdev-lib.sh"
# Ensure this module is only included when building kdump initrd
is_kdump || return 1
@@ -60,7 +61,7 @@ install() {
# many zFCP LUNs
inst_dir /etc/modprobe.d
chzdev zfcp --type "allow_lun_scan=0" --persistent \
--base "/etc=$initdir/etc" --yes --quiet --no-root-update \
--base "/etc=${initdir:?}/etc" --yes --quiet --no-root-update \
--force >/dev/null
# drop /etc/zfcp.conf from dracut module 95zfcp
echo "rd.zfcp.conf=0" > "$initdir/etc/cmdline.d/00-no-zfcp-conf.conf"
@@ -89,13 +90,14 @@ install() {
# these are purely generated udev rules so we have to glob expand
# within $initdir and strip the $initdir prefix for mark_hostonly
local -a _array
# shellcheck disable=SC2155
local _nullglob=$(shopt -p nullglob)
shopt -u nullglob
readarray -t _array < \
<(ls -1 $initdir/etc/udev/rules.d/41-*.rules 2> /dev/null)
<(ls -1 "$initdir"/etc/udev/rules.d/41-*.rules 2> /dev/null)
[[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
readarray -t _array < \
<(ls -1 $initdir/etc/modprobe.d/s390x-*.conf 2> /dev/null)
<(ls -1 "$initdir"/etc/modprobe.d/s390x-*.conf 2> /dev/null)
[[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
$_nullglob
+1
View File
@@ -19,6 +19,7 @@ check() {
# Ensure that we're running on s390
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
# shellcheck disable=SC2154 source=/dev/null
source "$moddir/zdev-lib.sh"
# Leave kdump device configuration to module zdev-kdump to
+2
View File
@@ -14,10 +14,12 @@ is_kdump() {
# https://src.fedoraproject.org/rpms/kexec-tools/c/4eedcae5e1540690a3761857fe2e692774c44960
# https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/mkdumprd
# https://src.fedoraproject.org/rpms/kexec-tools/blob/rawhide/f/dracut-module-setup.sh
# shellcheck disable=SC2154
if [[ $hostonly && "$hostonly_mode" == "strict" && -n "$IN_KDUMP" ]]; then
return 0
fi
# https://github.com/openSUSE/kdump/blob/master/dracut/module-setup.sh
# shellcheck disable=SC2154
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules " == *\ kdump\ * ]]; then
return 0
fi