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
|
2015-02-15 22:28:42 +03:00
|
|
|
local final="${1}"
|
|
|
|
local opts=""
|
2014-10-06 15:08:33 +04:00
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
if [ "x${final}" != "x" ]; then
|
|
|
|
opts="-f"
|
2014-10-06 15:08:33 +04:00
|
|
|
fi
|
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
info "Exporting ZFS storage pools."
|
|
|
|
export_all ${opts} || ret=$?
|
2014-10-06 15:08:33 +04:00
|
|
|
|
2015-02-15 22:28:42 +03:00
|
|
|
if [ "x${final}" != "x" ]; then
|
2014-10-06 15:08:33 +04:00
|
|
|
info "zpool list"
|
|
|
|
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
|