summaryrefslogtreecommitdiffstats
path: root/dracut/90zfs/mount-zfs.sh
blob: b4a4de6ff013432ebc887574e2748c77791b6814 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

. /lib/dracut-lib.sh

if [ "$rootfs" = "zfs" ]; then
    zfsrootfs=`echo "$root" | sed 's|^zfs:||'`
    zfspool=`echo "$zfsrootfs" | sed 's|/.*||g'`
    zpool import -N "$zfspool"
    mount -o zfsutil -t "$rootfs" "$zfsrootfs" "$NEWROOT"
    if [ "$?" = "0" ]
    then
        ROOTFS_MOUNTED=yes
    else
        mount -t "$rootfs" "$zfsrootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
    fi
fi