Skip to content

Commit a27ab6d

Browse files
nabijaczlewelibehlendorf
authored andcommitted
dracut/90/module-setup: mainly shellcheck cleanup
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Issue #11956
1 parent 1966e95 commit a27ab6d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

contrib/dracut/90zfs/module-setup.sh.in

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ check() {
88
for tool in "@sbindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
99
test -x "$tool" || return 1
1010
done
11-
# Verify grep exists
12-
which grep >/dev/null 2>&1 || return 1
1311

1412
return 0
1513
}
@@ -43,14 +41,15 @@ install() {
4341
dracut_install @sbindir@/zpool
4442
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
4543
# ensuring libgcc_s.so(.1) is included
46-
if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then
44+
if ldd @sbindir@/zpool | grep -qF 'libgcc_s.so'; then
4745
# Dracut will have already tracked and included it
4846
:;
49-
elif command -v gcc-config 2>&1 1>/dev/null; then
47+
elif command -v gcc-config >/dev/null 2>&1; then
5048
# On systems with gcc-config (Gentoo, Funtoo, etc.):
5149
# Use the current profile to resolve the appropriate path
52-
dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
53-
elif [[ -n "$(ls /usr/lib/libgcc_s.so* 2>/dev/null)" ]]; then
50+
s="$(gcc-config -c)"
51+
dracut_install "/usr/lib/gcc/${s%-*}/${s##*-}/libgcc_s.so.1"
52+
elif ls /usr/lib/libgcc_s.so* >/dev/null 2>&1; then
5453
# Try a simple path first
5554
dracut_install /usr/lib/libgcc_s.so*
5655
else

0 commit comments

Comments
 (0)