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).

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.

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.