Skip to content

Commit

Permalink
contrib/dracut: export-zfs: simplify
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#13093
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent 99d496e commit e2f4dd1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions contrib/dracut/90zfs/export-zfs.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e2f4dd1

Please sign in to comment.