aboutsummaryrefslogtreecommitdiffstats
path: root/dracut/90zfs/mount-zfs.sh
diff options
context:
space:
mode:
authorZachary Bedell <[email protected]>2011-07-24 16:46:16 -0400
committerBrian Behlendorf <[email protected]>2011-07-25 10:42:07 -0700
commit1ef5e8296a07a0d208d0663ae966c8b0206f7e6a (patch)
tree9ce92f5f31e047f2cade37bf735cf0a0aa945904 /dracut/90zfs/mount-zfs.sh
parentbeb982690293310b14a4835d3ffeb883ba03cc0a (diff)
Soft to hard tabs
For consistency with the upstream sources and the rest of the project use hard instead of soft tabs. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'dracut/90zfs/mount-zfs.sh')
-rwxr-xr-xdracut/90zfs/mount-zfs.sh104
1 files changed, 52 insertions, 52 deletions
diff --git a/dracut/90zfs/mount-zfs.sh b/dracut/90zfs/mount-zfs.sh
index e067c18a0..a451bf9f5 100755
--- a/dracut/90zfs/mount-zfs.sh
+++ b/dracut/90zfs/mount-zfs.sh
@@ -4,65 +4,65 @@
ZPOOL_FORCE=""
if getargbool 0 zfs_force -y zfs.force -y zfsforce ; then
- warn "ZFS: Will force-import pools if necessary."
- ZPOOL_FORCE="-f"
+ warn "ZFS: Will force-import pools if necessary."
+ ZPOOL_FORCE="-f"
fi
case "$root" in
- zfs:*)
- # We have ZFS modules loaded, so we're able to import pools now.
- if [ "$root" = "zfs:AUTO" ] ; then
- # Need to parse bootfs attribute
- info "ZFS: Attempting to detect root from imported ZFS pools."
+ zfs:*)
+ # We have ZFS modules loaded, so we're able to import pools now.
+ if [ "$root" = "zfs:AUTO" ] ; then
+ # Need to parse bootfs attribute
+ info "ZFS: Attempting to detect root from imported ZFS pools."
- # Might be imported by the kernel module, so try searching before
- # we import anything.
- zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
- if [ "$zfsbootfs" = "" ] ; then
- # Not there, so we need to import everything.
- info "ZFS: Attempting to import additional pools."
- zpool import -N -a ${ZPOOL_FORCE}
- zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
- if [ "$zfsbootfs" = "" ] ; then
- rootok=0
- pool=""
+ # Might be imported by the kernel module, so try searching before
+ # we import anything.
+ zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
+ if [ "$zfsbootfs" = "" ] ; then
+ # Not there, so we need to import everything.
+ info "ZFS: Attempting to import additional pools."
+ zpool import -N -a ${ZPOOL_FORCE}
+ zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
+ if [ "$zfsbootfs" = "" ] ; then
+ rootok=0
+ pool=""
- warn "ZFS: No bootfs attribute found in importable pools."
+ warn "ZFS: No bootfs attribute found in importable pools."
- # Re-export everything since we're not prepared to take
- # responsibility for them.
- zpool list -H | while read fs rest ; do
- zpool export "$fs"
- done
+ # Re-export everything since we're not prepared to take
+ # responsibility for them.
+ zpool list -H | while read fs rest ; do
+ zpool export "$fs"
+ done
- return 1
- fi
- fi
- info "ZFS: Using ${zfsbootfs} as root."
- else
- # Should have an explicit pool set, so just import it and we're done.
- zfsbootfs="${root#zfs:}"
- pool="${zfsbootfs%%/*}"
- if ! zpool list -H $pool > /dev/null ; then
- # pool wasn't imported automatically by the kernel module, so
- # try it manually.
- info "ZFS: Importing pool ${pool}..."
- if ! zpool import -N ${ZPOOL_FORCE} $pool ; then
- warn "ZFS: Unable to import pool ${pool}."
- rootok=0
+ return 1
+ fi
+ fi
+ info "ZFS: Using ${zfsbootfs} as root."
+ else
+ # Should have an explicit pool set, so just import it and we're done.
+ zfsbootfs="${root#zfs:}"
+ pool="${zfsbootfs%%/*}"
+ if ! zpool list -H $pool > /dev/null ; then
+ # pool wasn't imported automatically by the kernel module, so
+ # try it manually.
+ info "ZFS: Importing pool ${pool}..."
+ if ! zpool import -N ${ZPOOL_FORCE} $pool ; then
+ warn "ZFS: Unable to import pool ${pool}."
+ rootok=0
- return 1
- fi
- fi
- fi
+ return 1
+ fi
+ fi
+ fi
- # Above should have left our rpool imported and pool/dataset in $root.
- # We need zfsutil for non-legacy mounts and not for legacy mounts.
- mountpoint=`zfs get -H -o value mountpoint $zfsbootfs`
- if [ "$mountpoint" = "legacy" ] ; then
- mount -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
- else
- mount -o zfsutil -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
- fi
- ;;
+ # Above should have left our rpool imported and pool/dataset in $root.
+ # We need zfsutil for non-legacy mounts and not for legacy mounts.
+ mountpoint=`zfs get -H -o value mountpoint $zfsbootfs`
+ if [ "$mountpoint" = "legacy" ] ; then
+ mount -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
+ else
+ mount -o zfsutil -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
+ fi
+ ;;
esac