Bug 297721 - The grub2 settng in kde setting does not allow display of all kernel installed
Summary: The grub2 settng in kde setting does not allow display of all kernel installed
Status: RESOLVED UPSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_grub2 (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konstantinos Smanis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 15:45 UTC by Daniel Moyne
Modified: 2022-09-20 04:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Moyne 2012-04-08 15:45:41 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34
Build Identifier: 

When booting only the most recent linux kernel is proposed in grub 2 boot menu ; I was expecting all kernel entries to be displayed as before ; besides a possible choice for the user during boot process this gives an indication on the number of kernel entries installed and that may need to be removed if last kernel runs properly ; grub2 kde setting does not propose a list of kernel entries to be checked and I do not know how to modify the "10_linux" file to display all kernels.

I consider this as a bug a normal grub2 behaviour should list in menu all kernel entries available on root partition ; how can this be fixed ; thanks.

Reproducible: Always

Steps to Reproduce:
1. boot or reboot
Actual Results:  
Only most recent kernel entry displayed

Expected Results:  
as default mode all kernel entries

grub2 kde setting module should allow for this to avoid that the user modify directly the "10_linux" file
Comment 1 Konstantinos Smanis 2012-04-10 09:37:30 UTC
I would say this is an upstream feature request. The recent versions of grub2 indeed hide the older kernel versions in a submenu (only the most recent kernel version is shown in the boot menu), but to my knowledge there isn't any configuration variable that could show all entries in the boot menu (something like GRUB_EXPAND_SUBMENUS).

Modifying the 10_linux is not a viable solution as I see it: it's a bash script, probably edited by the user/distribution; you can't automate this procedure, these scripts are meant to be manually edited.
Comment 2 Konstantinos Smanis 2012-04-10 10:00:39 UTC
In order to illustrate my point I quote the snippets that should be commented out in two different distributions (Kubuntu 11.10 & Gentoo).

For Kubuntu it is:
if [ "$list" ] && ! $in_submenu; then
  echo "submenu \"Previous Linux versions\" {"
  in_submenu=:
fi

For Gentoo it is:
if [ "x$is_first_entry" = xtrue ]; then
  linux_entry "${OS}" "${version}" simple \
  "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"

  submenu_indentation="\t"

  if [ -z "$boot_device_id" ]; then
      boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
  fi
  # TRANSLATORS: %s is replaced with an OS name
  echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
fi
Comment 3 Daniel Moyne 2012-04-11 12:58:07 UTC
What do you mean here :
- modifying "10_linux" file by commenting for Kubuntu distibution the following lines in the script ? :
if [ "$list" ] && ! $in_submenu; then
  echo "submenu \"Previous Linux versions\" {"
  in_submenu=:
fi

These lines being present in my 10_linux" file. Can you confirm.
Thanks
Comment 4 Konstantinos Smanis 2012-04-11 13:12:13 UTC
If you comment out the above lines (that is, put a # at the start of the line), you will see all your entries, ie. no submenus. But this only applies for (K)ubuntu 11.10. Other distributions (I brought Gentoo as an example) have different scripts and therefore you have to do other modifications. I don't think it's possible to automate this procedure unless an upstream configuration variable is created (as explained above).
Comment 5 Daniel Moyne 2012-04-11 19:12:34 UTC
Thanks Konstantinos ; I confirm that your proposed fix works for Kubuntu 12.04 ; I am very surprised of the complexity of grub where you have to comment lines in a complex script to get what was proposed long time ago as default in previous version.
In my case as I have a separate partion for "/boot" of small size I have to control the space left in it and therefore the number ofvoluminous kernels installed and that become obsoletes ; the best being remembered at boot time what is available.
I understood that the way grub is designed now you cannot simply parameter this in /etc/default/grub !
Comment 6 Konstantinos Smanis 2012-07-15 12:18:24 UTC
I reported the feature request upstream: https://savannah.gnu.org/bugs/index.php?36850
Comment 7 Konstantinos Smanis 2013-11-04 13:58:10 UTC
The feature has been implemented and released in upstream master: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=323de05ba27594861c75eec0b39cb01049a023c9