diff options
author | Manuel Amador (Rudd-O) <[email protected]> | 2016-04-24 11:35:44 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-05-12 14:31:15 -0700 |
commit | d402c18dd60124525b253b27c5018f54a030928d (patch) | |
tree | 1057315f14baad460620b4340a9f312d57432463 /contrib/dracut/90zfs/zfs-lib.sh.in | |
parent | 8adb798aa50849cc3f6e099fcae7c29db1b83e39 (diff) |
A collection of dracut fixes
- In older systems without sysroot.mount, import before dracut-mount,
and re-enable old dracut mount hook
- rootflags MUST be present even if the administrator neglected to
specify it explicitly
- Check that mount.zfs exists in sbindir
- Remove awk and head as (now unused) requirements, add grep, and
install the right mount.zfs
- Eliminate one use of grep in Dracut
- Use a more accurate grepping statement to identify zfsutil in rootflags
- Ensure that pooldev is nonempty
- Properly handle /dev/sd* devices and more
- Use new -P to get list of zpool devices
- Bail out of the generator when zfs:AUTO is on the root command line
- Ignore errors from systemctl trying to load sysroot.mount, we only
care about the output
- Determine which one is the correct initqueuedir at run time.
- Add a compatibility getargbool for our detection / setup script.
- Update dracut .gitignore files
Signed-off-by: <Matthew Thode [email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4558
Closes #4562
Diffstat (limited to 'contrib/dracut/90zfs/zfs-lib.sh.in')
-rwxr-xr-x | contrib/dracut/90zfs/zfs-lib.sh.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in index 1c223befd..c822ddb9d 100755 --- a/contrib/dracut/90zfs/zfs-lib.sh.in +++ b/contrib/dracut/90zfs/zfs-lib.sh.in @@ -1,6 +1,24 @@ #!/bin/sh command -v getarg >/dev/null || . /lib/dracut-lib.sh +command -v getargbool >/dev/null || { + # Compatibility with older Dracut versions. + # With apologies to the Dracut developers. + getargbool() { + local _b + unset _b + local _default + _default="$1"; shift + _b=$(getarg "$@") + [ $? -ne 0 -a -z "$_b" ] && _b="$_default" + if [ -n "$_b" ]; then + [ $_b = "0" ] && return 1 + [ $_b = "no" ] && return 1 + [ $_b = "off" ] && return 1 + fi + return 0 + } +} OLDIFS="${IFS}" NEWLINE=" |