diff options
author | Toyam Cox <[email protected]> | 2022-06-30 13:47:58 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-06-30 10:47:58 -0700 |
commit | eefe83eaa68f7cb4a49c580dd940d3688e42c849 (patch) | |
tree | 5b32ea9ae248e81bb2e94b3d8fdb62d0b4553962 | |
parent | 5a4dd3a262106c1506bdc154d9474efa6510f33a (diff) |
dracut: fix boot on non-zfs-root systems
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
-rwxr-xr-x | contrib/dracut/90zfs/zfs-lib.sh.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in index e44673c2d..3a43e514d 100755 --- a/contrib/dracut/90zfs/zfs-lib.sh.in +++ b/contrib/dracut/90zfs/zfs-lib.sh.in @@ -88,11 +88,11 @@ 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 @@ -100,7 +100,7 @@ decode_root_args() { ;; ZFS=*|zfs:*) - root="${root#zfs:}" + root="${xroot#zfs:}" root="${root#ZFS=}" root=$(echo "$root" | tr '+' ' ') rootfstype=zfs @@ -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 |