summaryrefslogtreecommitdiffstats
path: root/dracut/90zfs/parse-zfs.sh
blob: ef3d058ac2b418fda3ed81ec42ede1e98cccaf1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
case "$root" in
    zfs:FILESYSTEM=*|FILESYSTEM=*)
	root="${root#zfs:}"
	root="zfs:${root#FILESYSTEM=}"
        rootfs="zfs"
        rootok=1 ;;
    zfs:ZFS=*|ZFS=*)
	root="${root#zfs:}"
	root="zfs:${root#ZFS=}"
        rootfs="zfs"
        rootok=1 ;;
esac

if [ "$rootok" != "1" ] ; then
	zpool import -aN
	zfsbootfs=`zpool list -H -o bootfs | grep -v ^-$ -m 1`
	if [ -n "$zfsbootfs" ] ; then
		root="zfs:$zfsbootfs"
		rootfs="zfs"
		rootok=1
	fi
	zpool list -H | while read fs rest ; do zpool export "$fs" ; done
fi