No appropriate method for modifying specfic menuentry

Bug #538884 reported by Peter Hurley
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Wishlist
Unassigned

Bug Description

Binary package hint: grub2

With grub2 (grub-pc 1.97~beta4-1ubuntu4.1) on Ubuntu 9.10, there is no appropriate mechanism for adding command-line parameters to a specific menuentry.

For example, I need to add "disable_esco=true" (bluetooth subsystem kernel parameter) to the "Ubuntu, Linux 2.6.31-20-generic" menuentry. I *do not* want this parameter for any other menuentry. Similarly, I only want 1 (recovery mode) menuentry.

I understand that I could create a custom script, say /etc/grub.d/07-custom, that would have a menuentry in it copied from /boot/grub/grub.cfg. Unfortunately, this approach has several drawbacks that make it unsuitable. First, it forces this menuentry to be before any kernel enumerated by the 10-linux script, even if it's a prior version to other kernels. Second, the script has no access to the functions available in 10-linux (like the UUID get).

I'm also aware that I could edit /boot/grub/grub.cfg directly. Unfortunately, this is worse because *there is no way* to protect the contents of grub.cfg. The kernel upgrade packages overwrite this file regardless of the file attributes (like, what if I forget that I've made custom changes to this file when I upgrade the kernel in 6 months).

Adding a kernel parameter should not be this difficult.

Tags: patch
Revision history for this message
Colin Watson (cjwatson) wrote :

This is related to bug 439538, although it's not quite the same thing.

Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :

(And I agree that we ought to have something for this kind of thing that's easier than editing /etc/grub.d/10_linux, although it will take some careful design work.)

Revision history for this message
Peter Hurley (phurley) wrote :

Well, I took the most direct route that made sense to me.

I created a 07_custom script (attached) that is largely a refactored version of 10_linux, where each menuentry is built from functionality that existed in 10_linux. The only truly new addition is that kernels can be added to a no-search list so that when the modified 10_linux runs, it can exclude those kernels from created new menuentries.

Although it's hardly robust, I marked this for patch anyway.

Revision history for this message
Peter Hurley (phurley) wrote :

[Matching 10_linux]

tags: added: patch
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for your patch. I'm unsubscribing the sponsors team from this, though, as I don't want somebody to just go ahead and upload this. We'd like to look at this upstream after the 1.99 release and design something hopefully comprehensive and workable. In the meantime I would prefer not to add temporary solutions that we might have to migrate away from later.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in grub2 (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.