mirror_zfs/dracut/90zfs/mount-zfs.sh

17 lines
399 B
Bash
Raw Normal View History

#!/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
2011-04-08 20:41:41 +04:00
fi
fi