Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
Closes #5228
Closes #5238
_do_zpool_export() {
local ret=0
+ local errs=""
local final="${1}"
- local opts=""
- if [ "x${final}" != "x" ]; then
- opts="-f"
+ info "ZFS: Exporting ZFS storage pools..."
+ errs=$(export_all -F 2>&1)
+ ret=$?
+ [ -z "${errs}" ] || echo "${errs}" | vwarn
+ if [ "x${ret}" != "x0" ]; then
+ info "ZFS: There was a problem exporting pools."
fi
- info "Exporting ZFS storage pools."
- export_all ${opts} || ret=$?
-
if [ "x${final}" != "x" ]; then
- info "zpool list"
+ info "ZFS: pool list"
zpool list 2>&1 | vinfo
fi
inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
fi
inst_hook mount 98 "${moddir}/mount-zfs.sh"
- inst_hook shutdown 30 "${moddir}/export-zfs.sh"
+ inst_hook shutdown 20 "${moddir}/export-zfs.sh"
inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
if [ -e @sysconfdir@/zfs/zpool.cache ]; then
ZFS_DATASET="$(find_bootfs)"
if [ $? -ne 0 ] ; then
warn "ZFS: No bootfs attribute found in importable pools."
- export_all || export_all "-f"
+ export_all -F
rootok=0
return 1
# export_all OPTS
# exports all imported zfs pools.
export_all() {
- local opts="${1}"
+ local opts="${@}"
local ret=0
IFS="${NEWLINE}"