X-Git-Url: http://git.squeep.com/?p=portage-squeep;a=blobdiff_plain;f=sys-fs%2Fzfs%2Ffiles%2Fzfs-init.sh.in;fp=sys-fs%2Fzfs%2Ffiles%2Fzfs-init.sh.in;h=ed84585cd5f686eed067fe24319943454d515fa8;hp=0000000000000000000000000000000000000000;hb=703fe789c88c5e89cd1012ef35719a14613b176f;hpb=d114b4f65225948d38665ecb98cd45e55918156d diff --git a/sys-fs/zfs/files/zfs-init.sh.in b/sys-fs/zfs/files/zfs-init.sh.in new file mode 100644 index 0000000..ed84585 --- /dev/null +++ b/sys-fs/zfs/files/zfs-init.sh.in @@ -0,0 +1,29 @@ +#!/bin/sh + +ZFS="@sbindir@/zfs" +ZPOOL="@sbindir@/zpool" +ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache" + +if [ -f "${ZPOOL_CACHE}" ]; then + "${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null + if [ "${?}" != "0" ]; then + echo "Failed to import not-yet imported pools." >&2 + fi +fi + +echo "Mounting ZFS filesystems" +"${ZFS}" mount -a +if [ "${?}" != "0" ]; then + echo "Failed to mount ZFS filesystems." >&2 + exit 1 +fi + +echo "Exporting ZFS filesystems" +"${ZFS}" share -a +if [ "${?}" != "0" ]; then + echo "Failed to export ZFS filesystems." >&2 + exit 1 +fi + +exit 0 +