Permit both mountpoint=legacy and mountpoint=/ in initrd
[zfs.git] / dracut / 90zfs / mount-zfs.sh
1 #!/bin/sh
2
3 . /lib/dracut-lib.sh
4
5 if [ "$rootfs" = "zfs" ]; then
6     zfsrootfs=`echo "$root" | sed 's|^zfs:||'`
7     zfspool=`echo "$zfsrootfs" | sed 's|/.*||g'`
8     zpool import -N "$zfspool"
9     mount -o zfsutil -t "$rootfs" "$zfsrootfs" "$NEWROOT"
10     if [ "$?" = "0" ]
11     then
12         ROOTFS_MOUNTED=yes
13     else
14         mount -t "$rootfs" "$zfsrootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
15    fi
16 fi