Skip to content

Commit

Permalink
dracut: fix boot on non-zfs-root systems
Browse files Browse the repository at this point in the history
Simply prevent overwriting root until it needs to be overwritten.

Dracut could change this value before this module is called, but won't
change the kernel command line.

Reviewed-by: Andrew J. Hesford <[email protected]>
Signed-off-by: Toyam Cox <[email protected]>
Closes #13592
  • Loading branch information
Vaelatern authored Jun 30, 2022
1 parent 5a4dd3a commit eefe83e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contrib/dracut/90zfs/zfs-lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ decode_root_args() {
return
fi

root=$(getarg root=)
xroot=$(getarg root=)
rootfstype=$(getarg rootfstype=)

# shellcheck disable=SC2249
case "$root" in
case "$xroot" in
""|zfs|zfs:|zfs:AUTO)
root=zfs:AUTO
rootfstype=zfs
return 0
;;

ZFS=*|zfs:*)
root="${root#zfs:}"
root="${xroot#zfs:}"
root="${root#ZFS=}"
root=$(echo "$root" | tr '+' ' ')
rootfstype=zfs
Expand All @@ -109,9 +109,9 @@ decode_root_args() {
esac

if [ "$rootfstype" = "zfs" ]; then
case "$root" in
case "$xroot" in
"") root=zfs:AUTO ;;
*) root=$(echo "$root" | tr '+' ' ') ;;
*) root=$(echo "$xroot" | tr '+' ' ') ;;
esac
return 0
fi
Expand Down

0 comments on commit eefe83e

Please sign in to comment.