mirror_zfs/dracut/90zfs/mount-zfs.sh
Manuel Amador (Rudd-O) 6583dcacdc Permit both mountpoint=legacy and mountpoint=/ in initrd
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2011-04-07 10:31:02 -07:00

17 lines
391 B
Bash
Executable File

#!/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