Silence 'make checkbashisms'

Commit d2bce6d03 added the 'make checkbashisms' target but did not
resolve all of the bashisms in the scripts.  This commit doesn't
resolve them all either but it does fix up a few, and it excludes
the others so 'make checkstyle' no longer prints warnings.  It's
a small step in the right direction.

* Dracut is Linux specific and itself depends on bash.  Therefore
  all dracut support scripts can be bash specific, update their
  shebang accordingly.

* zed-functions.sh, zfs-import, zfs-mount, zfs-zed, smart
  paxcheck.sh, make_gitrev.sh - these scripts were excuded from
  the check until they can be updated and properly tested.

* zfsunlock - only whole values for sleep are allowed.

* vdev_id - removed unneeded locals; use && instead of -a.

* dkms.mkconf, dkms.postbuil - use || instead of -o.

Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by:  Gabriel A. Devenyi <gdevenyi@gmail.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10755
This commit is contained in:
Brian Behlendorf
2020-08-20 13:45:47 -07:00
committed by GitHub
parent 7bba1d404c
commit 64025fa3a1
11 changed files with 26 additions and 20 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
. /lib/dracut-zfs-lib.sh
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
. /lib/dracut-zfs-lib.sh
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
. /lib/dracut-lib.sh
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
command -v getarg >/dev/null || . /lib/dracut-lib.sh
command -v getargbool >/dev/null || {
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
[ -e /bin/systemctl ] || return 0
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+2 -2
View File
@@ -8,7 +8,7 @@ while [ ! -e /run/zfs_fs_name ]; do
if [ -e /run/zfs_unlock_complete ]; then
exit 0
fi
sleep 0.5
sleep 1
done
echo
echo "Unlocking encrypted ZFS filesystems..."
@@ -31,7 +31,7 @@ while [ ! -e /run/zfs_unlock_complete ]; do
fi
# Wait for another filesystem to unlock.
while [ "$(cat /run/zfs_fs_name)" = "$zfs_fs_name" ] && [ ! -e /run/zfs_unlock_complete ]; do
sleep 0.5
sleep 1
done
else
echo "Wrong password. Try again."