grubby-bls: fix corner case when a kernel param value contains a '='
If a kernel command line parameter has a '=' character, grubby fails to update the options field in the BLS snippet, for example: $ grubby --update-kernel=foo --args="bar=https://test?token=" sed: -e expression #1, char 30: unknown option to `s' Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
parent
8c7d866907
commit
f57406f3ab
@ -460,7 +460,7 @@ update_args() {
|
||||
|
||||
for arg in ${remove_args[*]}; do
|
||||
if [[ $arg = *"="* ]]; then
|
||||
arg=$(echo $arg | sed -e 's/\//\\\//g')
|
||||
arg="$(echo $arg | sed -e 's/\//\\\//g')"
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg([[:space:]]|$)/ /")"
|
||||
else
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg(([[:space:]]|$)|([=][^ ]*([$]*)))/ /g")"
|
||||
@ -468,7 +468,7 @@ update_args() {
|
||||
done
|
||||
|
||||
for arg in ${add_args[*]}; do
|
||||
arg=${arg%=*}
|
||||
arg="${arg%%=*}"
|
||||
args="$(echo $args | sed -E "s/(^|[[:space:]])$arg(([[:space:]]|$)|([=][^ ]*([$]*)))/ /g")"
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user