2014-10-06 15:08:33 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
. /lib/dracut-zfs-lib.sh
|
|
|
|
|
2014-10-06 15:08:33 +04:00
|
|
|
_do_zpool_export() {
|
|
|
|
local ret=0
|
2016-10-16 06:30:53 +03:00
|
|
|
local errs=""
|
2015-02-15 22:28:42 +03:00
|
|
|
local final="${1}"
|
2014-10-06 15:08:33 +04:00
|
|
|
|
2016-10-16 06:30:53 +03:00
|
|
|
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."
|
2014-10-06 15:08:33 +04:00
|
|
|
fi
|
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
if [ "x${final}" != "x" ]; then
|
2016-10-16 06:30:53 +03:00
|
|
|
info "ZFS: pool list"
|
2014-10-06 15:08:33 +04:00
|
|
|
zpool list 2>&1 | vinfo
|
|
|
|
fi
|
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
return ${ret}
|
2014-10-06 15:08:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if command -v zpool >/dev/null; then
|
2015-02-15 22:28:42 +03:00
|
|
|
_do_zpool_export "${1}"
|
2014-10-06 15:08:33 +04:00
|
|
|
else
|
|
|
|
:
|
|
|
|
fi
|