aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dracut/90zfs
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dracut/90zfs')
-rw-r--r--contrib/dracut/90zfs/Makefile.am1
-rwxr-xr-xcontrib/dracut/90zfs/export-zfs.sh.in2
-rwxr-xr-xcontrib/dracut/90zfs/import-opts-generator.sh.in1
-rwxr-xr-xcontrib/dracut/90zfs/module-setup.sh.in6
-rwxr-xr-xcontrib/dracut/90zfs/parse-zfs.sh.in5
-rwxr-xr-xcontrib/dracut/90zfs/zfs-lib.sh.in12
6 files changed, 17 insertions, 10 deletions
diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am
index 3f7050300..d25a3d250 100644
--- a/contrib/dracut/90zfs/Makefile.am
+++ b/contrib/dracut/90zfs/Makefile.am
@@ -19,6 +19,7 @@ pkgdracut_DATA = \
zfs-rollback-bootfs.service
SUBSTFILES += $(pkgdracut_SCRIPTS) $(pkgdracut_DATA)
+SHELLCHECK_OPTS = --enable=all
# Provided by /bin/sleep, and, again, every implementation of that supports this
CHECKBASHISMS_IGNORE = -e 'sleep only takes one integer' -e 'sleep 0.'
diff --git a/contrib/dracut/90zfs/export-zfs.sh.in b/contrib/dracut/90zfs/export-zfs.sh.in
index 892650383..9ad72bd6f 100755
--- a/contrib/dracut/90zfs/export-zfs.sh.in
+++ b/contrib/dracut/90zfs/export-zfs.sh.in
@@ -20,7 +20,7 @@ _do_zpool_export() {
zpool list 2>&1 | vinfo
fi
- return ${ret}
+ return "${ret}"
}
if command -v zpool >/dev/null; then
diff --git a/contrib/dracut/90zfs/import-opts-generator.sh.in b/contrib/dracut/90zfs/import-opts-generator.sh.in
index 8bc8c9b35..1900676f3 100755
--- a/contrib/dracut/90zfs/import-opts-generator.sh.in
+++ b/contrib/dracut/90zfs/import-opts-generator.sh.in
@@ -2,4 +2,5 @@
. /lib/dracut-zfs-lib.sh
+# shellcheck disable=SC2154
echo ZPOOL_IMPORT_OPTS="$ZPOOL_IMPORT_OPTS"
diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
index c27f905bf..10f915b2e 100755
--- a/contrib/dracut/90zfs/module-setup.sh.in
+++ b/contrib/dracut/90zfs/module-setup.sh.in
@@ -61,9 +61,9 @@ install() {
dracut_install /usr/lib*/gcc/**/libgcc_s.so*
fi
# shellcheck disable=SC2050
- if [ @LIBFETCH_DYNAMIC@ != 0 ]; then
+ if [ "@LIBFETCH_DYNAMIC@" != 0 ]; then
for d in $libdirs; do
- [ -e "$d/"@LIBFETCH_SONAME@ ] && dracut_install "$d/"@LIBFETCH_SONAME@
+ [ -e "$d/@LIBFETCH_SONAME@" ] && dracut_install "$d/@LIBFETCH_SONAME@"
done
fi
dracut_install @mounthelperdir@/mount.zfs
@@ -107,7 +107,7 @@ install() {
for _service in "zfs-import-scan.service" "zfs-import-cache.service" ; do
dracut_install "@systemdunitdir@/$_service"
if ! [ -L "${initdir}/$systemdsystemunitdir/zfs-import.target.wants/$_service" ]; then
- ln -sf ../$_service "${initdir}/$systemdsystemunitdir/zfs-import.target.wants/$_service"
+ ln -sf "../$_service" "${initdir}/$systemdsystemunitdir/zfs-import.target.wants/$_service"
type mark_hostonly >/dev/null 2>&1 && mark_hostonly "@systemdunitdir@/$_service"
fi
done
diff --git a/contrib/dracut/90zfs/parse-zfs.sh.in b/contrib/dracut/90zfs/parse-zfs.sh.in
index 0f92f5c80..724c5e2c6 100755
--- a/contrib/dracut/90zfs/parse-zfs.sh.in
+++ b/contrib/dracut/90zfs/parse-zfs.sh.in
@@ -49,11 +49,14 @@ case "${root}" in
info "ZFS: Set ${root} as bootfs."
;;
+
+ *)
+ info "ZFS: no ZFS-on-root"
esac
# Make sure Dracut is happy that we have a root and will wait for ZFS
# modules to settle before mounting.
-if [ ${wait_for_zfs} -eq 1 ]; then
+if [ "${wait_for_zfs}" -eq 1 ]; then
ln -s /dev/null /dev/root 2>/dev/null
initqueuedir="${hookdir}/initqueue/finished"
test -d "${initqueuedir}" || {
diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in
index defc0bfc8..d7c3e96c1 100755
--- a/contrib/dracut/90zfs/zfs-lib.sh.in
+++ b/contrib/dracut/90zfs/zfs-lib.sh.in
@@ -70,6 +70,7 @@ import_pool() {
}
_mount_dataset_cb() {
+ # shellcheck disable=SC2154
mount -o zfsutil -t zfs "${1}" "${NEWROOT}${2}"
}
@@ -91,7 +92,7 @@ mount_dataset() {
fi
fi
- return ${ret}
+ return "${ret}"
}
# for_relevant_root_children DATASET EXEC
@@ -117,7 +118,7 @@ for_relevant_root_children() {
;;
esac
done
- exit ${_ret}
+ exit "${_ret}"
)
}
@@ -134,7 +135,7 @@ export_all() {
done
IFS="${OLDIFS}"
- return ${ret}
+ return "${ret}"
}
# ask_for_password
@@ -171,6 +172,7 @@ ask_for_password() {
--ply-tries) ply_tries="$2"; shift;;
--tty-tries) tty_tries="$2"; shift;;
--tty-echo-off) tty_echo_off=yes;;
+ *) echo "ask_for_password(): wrong opt '$1'" >&2;;
esac
shift
done
@@ -202,6 +204,6 @@ ask_for_password() {
fi
} 9>/.console_lock
- [ $ret -ne 0 ] && echo "Wrong password" >&2
- return $ret
+ [ "$ret" -ne 0 ] && echo "Wrong password" >&2
+ return "$ret"
}