From 695377d276cf0990c96d57263c608b97f4fe6644 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Sat, 17 Nov 2018 03:35:14 +0100 Subject: [PATCH] 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 --- grubby-bls | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/grubby-bls b/grubby-bls index add7b0a..7b8bae7 100755 --- a/grubby-bls +++ b/grubby-bls @@ -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]}\""