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