diff options
Diffstat (limited to 'contrib/dracut/90zfs/export-zfs.sh.in')
-rwxr-xr-x | contrib/dracut/90zfs/export-zfs.sh.in | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/dracut/90zfs/export-zfs.sh.in b/contrib/dracut/90zfs/export-zfs.sh.in new file mode 100755 index 000000000..393753fbf --- /dev/null +++ b/contrib/dracut/90zfs/export-zfs.sh.in @@ -0,0 +1,29 @@ +#!/bin/sh + +. /lib/dracut-zfs-lib.sh + +_do_zpool_export() { + local ret=0 + local final="${1}" + local opts="" + + if [ "x${final}" != "x" ]; then + opts="-f" + fi + + info "Exporting ZFS storage pools." + export_all ${opts} || ret=$? + + if [ "x${final}" != "x" ]; then + info "zpool list" + zpool list 2>&1 | vinfo + fi + + return ${ret} +} + +if command -v zpool >/dev/null; then + _do_zpool_export "${1}" +else + : +fi |