From 93669c381249e0d42bb3eb21336861c1a759b6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 12 Feb 2022 14:05:29 +0100 Subject: [PATCH] contrib/dracut: export-zfs: simplify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13093 --- contrib/dracut/90zfs/export-zfs.sh.in | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/contrib/dracut/90zfs/export-zfs.sh.in b/contrib/dracut/90zfs/export-zfs.sh.in index 9ad72bd6f5..6b711a0d15 100755 --- a/contrib/dracut/90zfs/export-zfs.sh.in +++ b/contrib/dracut/90zfs/export-zfs.sh.in @@ -3,28 +3,22 @@ . /lib/dracut-zfs-lib.sh _do_zpool_export() { - ret=0 - errs="" - final="${1}" - info "ZFS: Exporting ZFS storage pools..." errs=$(export_all -F 2>&1) ret=$? - [ -z "${errs}" ] || echo "${errs}" | vwarn - if [ "x${ret}" != "x0" ]; then + echo "${errs}" | vwarn + if [ "${ret}" -ne 0 ]; then info "ZFS: There was a problem exporting pools." fi - if [ "x${final}" != "x" ]; then + if [ -n "$1" ]; then info "ZFS: pool list" zpool list 2>&1 | vinfo fi - return "${ret}" + return "$ret" } if command -v zpool >/dev/null; then _do_zpool_export "${1}" -else - : fi