grubby-bls: make info print the root parameter if is present in cmdline

The old grubby tool printed the root parameter separated from the other
kernel command line arguments. Make the wrapper have the same behaviour.

Resolves: rhbz#1649791

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2018-11-17 03:35:14 +01:00
parent 6cdfe45ece
commit 695377d276
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69

View File

@ -223,9 +223,27 @@ display_info_values() {
fi
for i in ${indexes[*]}; do
local root=""
local args=${bls_options[$i]}
local opts=(${args})
for opt in ${opts[*]}; do
if echo $opt | grep -q "^root="; then
root="$(echo $opt | sed -e 's/root=//')"
value="$(echo ${opt} | sed -e 's/\//\\\//g')"
args="$(echo ${args} | sed -e "s/${value}[ \t]*//")"
break
fi
done
echo "index=$i"
echo "kernel=\"${prefix}${bls_linux[$i]}\""
echo "args=\"${bls_options[$i]}\""
echo "args=\"${args}\""
if [[ -n $root ]]; then
echo "root=\"${root}\""
fi
echo "initrd=\"${prefix}${bls_initrd[$i]}\""
echo "title=\"${bls_title[$i]}\""
echo "id=\"${bls_id[$i]}\""