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 <behlendorf1@llnl.gov>
This commit is contained in:
parent
beb9826902
commit
1ef5e8296a
|
@ -1,46 +1,46 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
# We depend on udev-rules being loaded
|
# We depend on udev-rules being loaded
|
||||||
[ "$1" = "-d" ] && return 0
|
[ "$1" = "-d" ] && return 0
|
||||||
|
|
||||||
# Verify the zfs tool chain
|
# Verify the zfs tool chain
|
||||||
which zpool >/dev/null 2>&1 || return 1
|
which zpool >/dev/null 2>&1 || return 1
|
||||||
which zfs >/dev/null 2>&1 || return 1
|
which zfs >/dev/null 2>&1 || return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
depends() {
|
depends() {
|
||||||
echo udev-rules
|
echo udev-rules
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
installkernel() {
|
installkernel() {
|
||||||
instmods zfs
|
instmods zfs
|
||||||
instmods zcommon
|
instmods zcommon
|
||||||
instmods znvpair
|
instmods znvpair
|
||||||
instmods zavl
|
instmods zavl
|
||||||
instmods zunicode
|
instmods zunicode
|
||||||
instmods spl
|
instmods spl
|
||||||
instmods zlib_deflate
|
instmods zlib_deflate
|
||||||
instmods zlib_inflate
|
instmods zlib_inflate
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
inst_rules "$moddir/90-zfs.rules"
|
inst_rules "$moddir/90-zfs.rules"
|
||||||
inst_rules /etc/udev/rules.d/60-zpool.rules
|
inst_rules /etc/udev/rules.d/60-zpool.rules
|
||||||
inst_rules /etc/udev/rules.d/60-zvol.rules
|
inst_rules /etc/udev/rules.d/60-zvol.rules
|
||||||
inst /etc/zfs/zdev.conf
|
inst /etc/zfs/zdev.conf
|
||||||
inst /etc/zfs/zpool.cache
|
inst /etc/zfs/zpool.cache
|
||||||
inst /etc/hostid
|
inst /etc/hostid
|
||||||
dracut_install zfs
|
dracut_install zfs
|
||||||
dracut_install zpool
|
dracut_install zpool
|
||||||
dracut_install zpool_layout
|
dracut_install zpool_layout
|
||||||
dracut_install zpool_id
|
dracut_install zpool_id
|
||||||
dracut_install zvol_id
|
dracut_install zvol_id
|
||||||
dracut_install mount.zfs
|
dracut_install mount.zfs
|
||||||
dracut_install hostid
|
dracut_install hostid
|
||||||
inst_hook cmdline 95 "$moddir/parse-zfs.sh"
|
inst_hook cmdline 95 "$moddir/parse-zfs.sh"
|
||||||
inst_hook mount 98 "$moddir/mount-zfs.sh"
|
inst_hook mount 98 "$moddir/mount-zfs.sh"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,65 +4,65 @@
|
||||||
|
|
||||||
ZPOOL_FORCE=""
|
ZPOOL_FORCE=""
|
||||||
if getargbool 0 zfs_force -y zfs.force -y zfsforce ; then
|
if getargbool 0 zfs_force -y zfs.force -y zfsforce ; then
|
||||||
warn "ZFS: Will force-import pools if necessary."
|
warn "ZFS: Will force-import pools if necessary."
|
||||||
ZPOOL_FORCE="-f"
|
ZPOOL_FORCE="-f"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$root" in
|
case "$root" in
|
||||||
zfs:*)
|
zfs:*)
|
||||||
# We have ZFS modules loaded, so we're able to import pools now.
|
# We have ZFS modules loaded, so we're able to import pools now.
|
||||||
if [ "$root" = "zfs:AUTO" ] ; then
|
if [ "$root" = "zfs:AUTO" ] ; then
|
||||||
# Need to parse bootfs attribute
|
# Need to parse bootfs attribute
|
||||||
info "ZFS: Attempting to detect root from imported ZFS pools."
|
info "ZFS: Attempting to detect root from imported ZFS pools."
|
||||||
|
|
||||||
# Might be imported by the kernel module, so try searching before
|
# Might be imported by the kernel module, so try searching before
|
||||||
# we import anything.
|
# we import anything.
|
||||||
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
|
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
|
||||||
if [ "$zfsbootfs" = "" ] ; then
|
if [ "$zfsbootfs" = "" ] ; then
|
||||||
# Not there, so we need to import everything.
|
# Not there, so we need to import everything.
|
||||||
info "ZFS: Attempting to import additional pools."
|
info "ZFS: Attempting to import additional pools."
|
||||||
zpool import -N -a ${ZPOOL_FORCE}
|
zpool import -N -a ${ZPOOL_FORCE}
|
||||||
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
|
zfsbootfs=`zpool list -H -o bootfs | sed 'q'`
|
||||||
if [ "$zfsbootfs" = "" ] ; then
|
if [ "$zfsbootfs" = "" ] ; then
|
||||||
rootok=0
|
rootok=0
|
||||||
pool=""
|
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
|
# Re-export everything since we're not prepared to take
|
||||||
# responsibility for them.
|
# responsibility for them.
|
||||||
zpool list -H | while read fs rest ; do
|
zpool list -H | while read fs rest ; do
|
||||||
zpool export "$fs"
|
zpool export "$fs"
|
||||||
done
|
done
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
info "ZFS: Using ${zfsbootfs} as root."
|
info "ZFS: Using ${zfsbootfs} as root."
|
||||||
else
|
else
|
||||||
# Should have an explicit pool set, so just import it and we're done.
|
# Should have an explicit pool set, so just import it and we're done.
|
||||||
zfsbootfs="${root#zfs:}"
|
zfsbootfs="${root#zfs:}"
|
||||||
pool="${zfsbootfs%%/*}"
|
pool="${zfsbootfs%%/*}"
|
||||||
if ! zpool list -H $pool > /dev/null ; then
|
if ! zpool list -H $pool > /dev/null ; then
|
||||||
# pool wasn't imported automatically by the kernel module, so
|
# pool wasn't imported automatically by the kernel module, so
|
||||||
# try it manually.
|
# try it manually.
|
||||||
info "ZFS: Importing pool ${pool}..."
|
info "ZFS: Importing pool ${pool}..."
|
||||||
if ! zpool import -N ${ZPOOL_FORCE} $pool ; then
|
if ! zpool import -N ${ZPOOL_FORCE} $pool ; then
|
||||||
warn "ZFS: Unable to import pool ${pool}."
|
warn "ZFS: Unable to import pool ${pool}."
|
||||||
rootok=0
|
rootok=0
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Above should have left our rpool imported and pool/dataset in $root.
|
# Above should have left our rpool imported and pool/dataset in $root.
|
||||||
# We need zfsutil for non-legacy mounts and not for legacy mounts.
|
# We need zfsutil for non-legacy mounts and not for legacy mounts.
|
||||||
mountpoint=`zfs get -H -o value mountpoint $zfsbootfs`
|
mountpoint=`zfs get -H -o value mountpoint $zfsbootfs`
|
||||||
if [ "$mountpoint" = "legacy" ] ; then
|
if [ "$mountpoint" = "legacy" ] ; then
|
||||||
mount -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
|
mount -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
|
||||||
else
|
else
|
||||||
mount -o zfsutil -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
|
mount -o zfsutil -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -5,42 +5,42 @@
|
||||||
# Let the command line override our host id.
|
# Let the command line override our host id.
|
||||||
spl_hostid=`getarg spl_hostid=`
|
spl_hostid=`getarg spl_hostid=`
|
||||||
if [ "${spl_hostid}" != "" ] ; then
|
if [ "${spl_hostid}" != "" ] ; then
|
||||||
info "ZFS: Using hostid from command line: ${spl_hostid}"
|
info "ZFS: Using hostid from command line: ${spl_hostid}"
|
||||||
echo "${spl_hostid}" > /etc/hostid
|
echo "${spl_hostid}" > /etc/hostid
|
||||||
elif [ -f /etc/hostid ] ; then
|
elif [ -f /etc/hostid ] ; then
|
||||||
info "ZFS: Using hostid from /etc/hostid: `cat /etc/hostid`"
|
info "ZFS: Using hostid from /etc/hostid: `cat /etc/hostid`"
|
||||||
else
|
else
|
||||||
warn "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly."
|
warn "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$root" in
|
case "$root" in
|
||||||
""|zfs|zfs:)
|
""|zfs|zfs:)
|
||||||
# We'll take root unset, root=zfs, or root=zfs:
|
# We'll take root unset, root=zfs, or root=zfs:
|
||||||
# No root set, so we want to read the bootfs attribute. We can't do
|
# No root set, so we want to read the bootfs attribute. We can't do
|
||||||
# that until udev settles so we'll set dummy values and hope for the
|
# that until udev settles so we'll set dummy values and hope for the
|
||||||
# best later on.
|
# best later on.
|
||||||
root="zfs:AUTO"
|
root="zfs:AUTO"
|
||||||
rootok=1
|
rootok=1
|
||||||
|
|
||||||
info "ZFS: Enabling autodetection of bootfs after udev settles."
|
info "ZFS: Enabling autodetection of bootfs after udev settles."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ZFS\=*|zfs:*|zfs:FILESYSTEM\=*|FILESYSTEM\=*)
|
ZFS\=*|zfs:*|zfs:FILESYSTEM\=*|FILESYSTEM\=*)
|
||||||
# root is explicit ZFS root. Parse it now.
|
# root is explicit ZFS root. Parse it now.
|
||||||
# We can handle a root=... param in any of the following formats:
|
# We can handle a root=... param in any of the following formats:
|
||||||
# root=ZFS=rpool/ROOT
|
# root=ZFS=rpool/ROOT
|
||||||
# root=zfs:rpool/ROOT
|
# root=zfs:rpool/ROOT
|
||||||
# root=zfs:FILESYSTEM=rpool/ROOT
|
# root=zfs:FILESYSTEM=rpool/ROOT
|
||||||
# root=FILESYSTEM=rpool/ROOT
|
# root=FILESYSTEM=rpool/ROOT
|
||||||
|
|
||||||
# Strip down to just the pool/fs
|
# Strip down to just the pool/fs
|
||||||
root="${root#zfs:}"
|
root="${root#zfs:}"
|
||||||
root="${root#FILESYSTEM=}"
|
root="${root#FILESYSTEM=}"
|
||||||
root="zfs:${root#ZFS=}"
|
root="zfs:${root#ZFS=}"
|
||||||
rootok=1
|
rootok=1
|
||||||
|
|
||||||
info "ZFS: Set ${root} as bootfs."
|
info "ZFS: Set ${root} as bootfs."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Make sure Dracut is happy that we have a root and will wait for ZFS
|
# Make sure Dracut is happy that we have a root and will wait for ZFS
|
||||||
|
|
Loading…
Reference in New Issue