contrib/dracut: export-zfs: simplify

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13093
This commit is contained in:
наб 2022-02-12 14:05:29 +01:00 committed by Brian Behlendorf
parent 497bf14a4a
commit 93669c3812

View File

@ -3,28 +3,22 @@
. /lib/dracut-zfs-lib.sh . /lib/dracut-zfs-lib.sh
_do_zpool_export() { _do_zpool_export() {
ret=0
errs=""
final="${1}"
info "ZFS: Exporting ZFS storage pools..." info "ZFS: Exporting ZFS storage pools..."
errs=$(export_all -F 2>&1) errs=$(export_all -F 2>&1)
ret=$? ret=$?
[ -z "${errs}" ] || echo "${errs}" | vwarn echo "${errs}" | vwarn
if [ "x${ret}" != "x0" ]; then if [ "${ret}" -ne 0 ]; then
info "ZFS: There was a problem exporting pools." info "ZFS: There was a problem exporting pools."
fi fi
if [ "x${final}" != "x" ]; then if [ -n "$1" ]; then
info "ZFS: pool list" info "ZFS: pool list"
zpool list 2>&1 | vinfo zpool list 2>&1 | vinfo
fi fi
return "${ret}" return "$ret"
} }
if command -v zpool >/dev/null; then if command -v zpool >/dev/null; then
_do_zpool_export "${1}" _do_zpool_export "${1}"
else
:
fi fi