bugGNU GRUB - Bugs: bug #28581, Add machine name to generated...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28581: Add machine name to generated menuentry names

Submitter:  Greg Tarsa <tarsa>
Submitted:  Wed 13 Jan 2010 02:58:59 AM UTC
   
 
Category:  Configuration Severity:  Major
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Greg Tarsa
Open/Closed:  Closed Release:  1.97
Release:  Reproducibility:  Every Time
Planned Release:  None

Sat 17 Apr 2010 05:41:56 PM UTC, comment #5: 

/etc/grub.d/* are configuration files too. They can be changed by
user as he sees fit. /etc/default/grub lists only the most common
and useful options. Everything else would only encumber it. If
there is enough demand for your feature this point of view may
change though

Vladimir Serbinenko <phcoder>
Group administrator
Thu 21 Jan 2010 03:41:14 AM UTC, comment #4: 

I take your point about only one grub.cfg file being used for the boot; however, it does seem like 30_os-prober is getting information from other grub.cfg files or somewhere because on my box, if the grub.cfg for a non-booted system partition contains the machine name for that partitions menuentrys, then that machine name shows up in the grub.cfg file  on the "master" partition when update-grub is run in that instance; that is, the machine name gets propagated.

Bottom line: my solution may not be the best one.  I am not married to it.  But is there some way to enable the machine/architecture to be added to the automatically generated menu entries somehow?

Greg Tarsa <tarsa>
Sat 16 Jan 2010 09:57:08 AM UTC, comment #3: 

If update-grub gets run on a system where /boot is not the one GRUB was installed to MBR it won't change anything because GRUB won't look at that grub.cfg
grub-install saves the partition number (or UUID in case of cross-install) of the one which has /boot/grub

Felix Zielcke <fzielcke>
Group Member
Fri 15 Jan 2010 09:41:09 PM UTC, comment #2: 

Thanks, Felix.  I understand that there is some unique information already present in existing menuentry lines.  My system is an experimental system where I am booting both 32 and 64-bit versions of Ubuntu 9.10. For now.  However, I expect to be experimenting with other Linux OSes as well.  Unless the best practice is to run update-grub always from the same instance of the OS whenever updates are needed, a user in my position will see different menuentries float to the top of the menu list depending on which OS instance is booted when the update-grub command is executed.  In this case, the 64-bit entries are at the bottom because update-grub was last run on a 32-bit instance.

It may be that I am not using GRUB2 in the generally accepted way; and, of course, I can/should keep a list of which OSes are on which drives. But the heart of this feature request is based on the assertion that adding the architecture information automatically is trivial and eliminates the need for the kind of manual bookkeeping that would be needed otherwise.

Making this change to 10_linux would ensure that anytime any instance of a Linux grub2 OS was updated that its entries would be tagged with machine architecture information.  Since an update occurs at least once with every installation, it would follow that all menuentries would be tagged with the proper architecture.

Heck, I'd like to see the distribution's version number included as well.

Granted, that most installations run a single instance of a single version of a single architecture. In which case, it doesn't really matter what gets done.  But when configurations get complicated it would be good for the tools to be able to automatically make things clearer.

Does this make sense?  I am open to argument if my premise is faulty.

Greg Tarsa <tarsa>
Fri 15 Jan 2010 06:13:30 PM UTC, comment #1: 

10_linux only creates menu entries for the kernels in /boot of the current system.
The other ones are added by 30_os-prober and they clearly show the device from which they are.
Note that your 64bit entries come after Memtest and Windows.
So i don't think this is needed at all.

Felix Zielcke <fzielcke>
Group Member
Wed 13 Jan 2010 02:58:59 AM UTC, original submission:  

The new grub provides a lot of good features, but I would like to see it provide the machine name/arch as part of the automatically generated menu entries.  My system is a multi-boot machine with multiple versions of 32 and 64-bit Ubuntu running on it.  The currently generated menu lists do not provide any way to tell which are which.

Some minor changes to /etc/grub.d/10_linux fix this. I have attached a patch file which has proposed changes.

Here is an example.  Before the change, all the generated menu entries look the same: which are the 32 and which are the 64 bit entries?

Ubuntu, Linux 2.6.31-17-generic
Ubuntu, Linux 2.6.31-17-generic (recovery mode)
Ubuntu, Linux 2.6.31-16-generic
Ubuntu, Linux 2.6.31-16-generic (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
Windows Vista (loader) (on /dev/sda1)
Ubuntu, Linux 2.6.31-17-generic (on /dev/sda6)
Ubuntu, Linux 2.6.31-17-generic (recovery mode) (on /dev/sda6)
Ubuntu, Linux 2.6.31-15-generic (on /dev/sda6)
Ubuntu, Linux 2.6.31-15-generic (recovery mode) (on /dev/sda6)

Once the 10_linux is patched and update-grub is run from both systems, the list looks like this:

Ubuntu-i686, Linux 2.6.31-17-generic
Ubuntu-i686, Linux 2.6.31-17-generic (recovery mode)
Ubuntu-i686, Linux 2.6.31-16-generic
Ubuntu-i686, Linux 2.6.31-16-generic (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
Windows Vista (loader) (on /dev/sda1)
Ubuntu-x86_64, Linux 2.6.31-17-generic (on /dev/sda6)
Ubuntu-x86_64, Linux 2.6.31-17-generic (recovery mode) (on /dev/sda6)
Ubuntu-x86_64, Linux 2.6.31-15-generic (on /dev/sda6)
Ubuntu-x86_64, Linux 2.6.31-15-generic (recovery mode) (on /dev/sda6)


Greg Tarsa <tarsa>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #19478:  grub2.10_linux.patch added by tarsa (1KiB - text/x-patch - Patches to add machine name to GRUB menuentries for Linux)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by fzielcke (Posted a comment)
  • -email is unavailable- added by tarsa (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-04-17 phcoder Open/ClosedOpen Closed
    2010-01-13 tarsa Attached File- Added grub2.10_linux.patch, #19478

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code