aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dracut/90zfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-03 22:11:02 +0200
committerBrian Behlendorf <[email protected]>2021-05-07 17:20:42 -0700
commita27ab6d43b5f62db5d9093702a69b933fb5f4515 (patch)
treeff10aa3d8737fec6c9908434d516336483f0bf3d /contrib/dracut/90zfs
parent1966e959cab25d6e535eeb88e0b2ad9590881eb7 (diff)
dracut/90/module-setup: mainly shellcheck cleanup
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Issue #11956
Diffstat (limited to 'contrib/dracut/90zfs')
-rwxr-xr-xcontrib/dracut/90zfs/module-setup.sh.in11
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
index b6b86e2ea..c545c8838 100755
--- a/contrib/dracut/90zfs/module-setup.sh.in
+++ b/contrib/dracut/90zfs/module-setup.sh.in
@@ -8,8 +8,6 @@ check() {
for tool in "@sbindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
test -x "$tool" || return 1
done
- # Verify grep exists
- which grep >/dev/null 2>&1 || return 1
return 0
}
@@ -43,14 +41,15 @@ install() {
dracut_install @sbindir@/zpool
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
# ensuring libgcc_s.so(.1) is included
- if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then
+ if ldd @sbindir@/zpool | grep -qF 'libgcc_s.so'; then
# Dracut will have already tracked and included it
:;
- elif command -v gcc-config 2>&1 1>/dev/null; then
+ elif command -v gcc-config >/dev/null 2>&1; then
# On systems with gcc-config (Gentoo, Funtoo, etc.):
# Use the current profile to resolve the appropriate path
- dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
- elif [[ -n "$(ls /usr/lib/libgcc_s.so* 2>/dev/null)" ]]; then
+ s="$(gcc-config -c)"
+ dracut_install "/usr/lib/gcc/${s%-*}/${s##*-}/libgcc_s.so.1"
+ elif ls /usr/lib/libgcc_s.so* >/dev/null 2>&1; then
# Try a simple path first
dracut_install /usr/lib/libgcc_s.so*
else