GNU GRUB - Bugs: bug #39306, Contrib: grub-list-kernels.pl...
You are not allowed to post comments on this tracker with your current authentication level.
bug #39306: Contrib: grub-list-kernels.pl script
Submitter: | Craig Sanders <csanders> | ||
Submitted: | Fri 21 Jun 2013 01:03:15 AM UTC | ||
Category: | None | Severity: | Major |
Priority: | 5 - Normal | Item Group: | Feature Request |
Status: | Invalid | Privacy: | Public |
Assigned to: | None | Originator Name: | |
Open/Closed: | Closed | Release: | other |
Release: | Reproducibility: | None | |
Planned Release: | None |
Jump to the original submission
Fri 21 Jun 2013 11:27:05 PM UTC, comment #9: |
Craig Sanders <csanders> |
Fri 21 Jun 2013 02:08:40 AM UTC, comment #8: This is not a right place to contribute. This is a bug tracker. For contributions use grub-devel@gnu.org. The script is not acceptable as-is as it would encourage bad practice (use of indices). Another problem is the language: we don't use perl at all and introducing a new dependency for a secondary script is not an option. Changing to 'Invalid' since it's not a bug report. The task you've chosen is not fully solvable since menus can be generated dynamically, consider following:
|
Vladimir Serbinenko <phcoder> |
Fri 21 Jun 2013 01:54:53 AM UTC, comment #7: Thank you for making my attempt to contribute something to the GNU Grub project such a pleasant and rewarding experience.
|
Craig Sanders <csanders> |
Fri 21 Jun 2013 01:51:31 AM UTC, comment #6: re: comment #3 - yes, i understand how they're generated.
|
Craig Sanders <csanders> |
Fri 21 Jun 2013 01:47:51 AM UTC, comment #5: our version of 30_os-prober generates ids. Other scripts you mention are not ours at all. For them you can use menuentry titles for now and contact their distribuotrs to provide ids. |
Vladimir Serbinenko <phcoder> |
Fri 21 Jun 2013 01:39:08 AM UTC, comment #4: BTW, looking at various grub.cfg files on my own systems, it looks like it's only the 10_linux, 20_linux_xen, and 30_uefi-firmware scripts that generate a $menuentry_id_option for each menuentry.
|
Craig Sanders <csanders> |
Fri 21 Jun 2013 01:37:54 AM UTC, comment #3: the IDs after $menuentry_id_option are stable. They are generated from root uuid and kernel name both of which are stable. |
Vladimir Serbinenko <phcoder> |
Fri 21 Jun 2013 01:29:07 AM UTC, comment #2: if you mean $menuentry_id_option, then that's no more 'stable' than the indexes. i.e. they can both change when a menuentry is added or removed.
|
Craig Sanders <csanders> |
Fri 21 Jun 2013 01:07:47 AM UTC, comment #1: Indices are not stable and should never be recommended to use. ID should be used instead. |
Vladimir Serbinenko <phcoder> |
Fri 21 Jun 2013 01:03:15 AM UTC, original submission:
Script to list menu entries in grub.cfg, with indexes suitable for use with grub-set-default and grub-reboot (e.g. grub-set-default '1>0'). Includes support for grub submenus.
|
Craig Sanders <csanders> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2013-06-21 | phcoder | Status | Wont Fix | Invalid | |
2013-06-21 | phcoder | Status | None | Wont Fix | |
Open/Closed | Open | Closed | |||
2013-06-21 | csanders | Attached File | - | Added grub-list-kernels.pl, #28371 |
Powered by Savane 3.13-3230.
Corresponding source code
OK, then tell me how else I can get a list of menuentries without having to reboot.
Without such a list, grub-set-default and grub-reboot are effectively useless.
I wrote my script because I had a need for it, and there was nothing else to do the job. It's a useful tool that I would have expected should come with grub (and the absence of such a tool IS a bug), but it doesn't so I had to write my own.
Various versions of it have served me well for well over 10 years, starting with a version I wrote for legacy grub to extract the info from /boot/grub/menu.lst not long after i switched from LILO to grub in the late 90s.
It might be possible to run a loop as you describe in grub.cfg itself, but I have never seen it on any of hundreds of systems over the years - I don't think anyone actually uses that feature.
certainly not me, or any of the linux distros I use...all menu entries I've ever seen in grub.cfg (and earlier in menu.lst) are generated as static entries by update-grub/grub-mkconfig (sort of like at "compile-time" rather than run-time)