diff options
-rwxr-xr-x | setup-gummiboot-conf | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/setup-gummiboot-conf b/setup-gummiboot-conf index fa0cf58..5a84ad9 100755 --- a/setup-gummiboot-conf +++ b/setup-gummiboot-conf @@ -68,11 +68,13 @@ default_entry="$(cat "$conf_file" | sed -n -e 's/[ \t]*default[ \t]\+\(.\+\)[ \t [ "$(printf "%s\n" "$default_entry" | wc -l)" -eq "1" ] || \ fatal "more than one default entry in \"$conf_file\"" -if ! [ -f "$entries_dir/$default_entry" ]; then - # The default entry does not exist anymore. Pick the entry - # corresponding to the newest kernel then. - default_entry="$(printf "%s" "$entries" | head -n1)" -fi +while ! [ -f "$entries_dir/$default_entry" ]; do + # The default entry does not exist anymore. Remove it and pick the + # entry corresponding to the newest installed kerne. + rm -f "$entries_dir/$default_entry" + entries="$(printf "%s" "$entries" | tail -n+2)" + default_entry="$(printf "%s" "$entries" | head -n1).conf" +done # Use the default entry to prepare the pattern for other entries pattern="$(cat "$entries_dir/$default_entry")" |