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

diff --git a/modules.d/90dmraid/.shchkdir b/modules.d/90dmraid/.shchkdir
new file mode 100644 (file)
index 0000000..e69de29
index 812e0362530bbebee41c465f2d4058f3652757a0..d10f42aa8d0eaf0d2637131ee84baa59568109b1 100755 (executable)
@@ -2,19 +2,15 @@
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
 
-dev="$1"
 devenc=$(str_replace "$1" '/' '\2f')
 
-[ -e /tmp/dmraid.$devenc ] && exit 0
+[ -e /tmp/dmraid."$devenc" ] && exit 0
 
-> /tmp/dmraid.$devenc
+: > /tmp/dmraid."$devenc"
 
 DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
 
 if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
-
-    DM_CLEANUP="no"
-
     # run dmraid if udev has settled
     info "Scanning for dmraid devices $DM_RAIDS"
     SETS=$(dmraid -c -s)
@@ -24,7 +20,7 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
     fi
 
     info "Found dmraid sets:"
-    echo $SETS | vinfo
+    echo "$SETS" | vinfo
 
     if [ -n "$DM_RAIDS" ]; then
         # only activate specified DM RAIDS
@@ -47,5 +43,4 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
     fi
 
     need_shutdown
-
 fi
index 260af184f304b20c830aa60885506427c5068d10..482ae96acdf0e18c962b1b64e0e0d2a300754962 100755 (executable)
@@ -2,7 +2,9 @@
 
 # called by dracut
 check() {
-    local _rootdev
+    local holder
+    local dev
+
     # if we don't have dmraid installed on the host system, no point
     # in trying to support it in the initramfs.
     require_binaries dmraid || return 1
@@ -35,11 +37,11 @@ depends() {
 
 # called by dracut
 cmdline() {
-    local _activated
-    declare -A _activated
+    local dev
+    local -A _activated
 
     for dev in "${!host_fs_types[@]}"; do
-        local holder DEVPATH DM_NAME majmin
+        local holder DEVPATH DM_NAME
         [[ ${host_fs_types[$dev]} != *_raid_member ]] && continue
 
         DEVPATH=$(get_devpath_block "$dev")
@@ -62,16 +64,16 @@ cmdline() {
 
 # called by dracut
 install() {
-    local _i
+    local _raidconf
 
     if [[ $hostonly_cmdline == "yes" ]]; then
-        local _raidconf=$(cmdline)
+        _raidconf=$(cmdline)
         [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
     fi
 
     inst_multiple dmraid
     inst_multiple -o kpartx
-    inst $(command -v partx) /sbin/partx
+    inst "$(command -v partx)" /sbin/partx
 
     inst "$moddir/dmraid.sh" /sbin/dmraid_scan