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