bugGNU GRUB - Bugs: bug #40291, more configurable menu generation

 
 

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

bug #40291: more configurable menu generation

Submitted by:  Alex Efros <powerman>
Submitted on:  Thu 17 Oct 2013 04:22:37 PM UTC  
 
Category: ConfigurationSeverity: Major
Priority: 5 - NormalItem Group: Feature Request
Status: InvalidPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: Bazaar - trunkReproducibility: None
Planned Release: None

Thu 17 Oct 2013 09:05:34 PM UTC, comment #1:

This is not a right place to discuss patches. Please use -unavailable- mailinglist.
Also even without looking deep into your patch I see bashisms. Please keep 10_linux compatible with dash.

Vladimir Serbinenko <phcoder>
Project Administrator
Thu 17 Oct 2013 04:22:37 PM UTC, original submission:

I've developed a patch which implement few related features:
- ability to define which linux kernels and in which order will be shown in top menu instead of one auto-detected latest kernel
- ability to show kernel version in simple menu items, to distinguish between several items added by previous feature
- ability to use custom kernel command line parameters for some kernels instead of GRUB_CMDLINE_LINUX_DEFAULT

Here is my real use-case explaining needs in these features. I'm experimenting with switching between proprietary nvidia driver and nouveau. My main kernel is 3.10.1-hardened-r1 (for proprietary nvidia driver), and I've also compiled experimental kernel with "_nouveau" local version: 3.10.1-hardened-r1_nouveau.

First issue - auto-detect of latest kernel choose 3.10.1-hardened-r1_nouveau, which is wrong for me, and only way to change this is add some fake local version for main kernel just to make sure it will be sorted before "_nouveau" string.
Second issue - main kernel need "vga=" parameter, while nouveau kernel need "video=" parameter, but there is no way to configure this.
Third issue - I'd like to have both normal and nouveau kernels in main menu, in manually defined order.

Attached patch is for grub-2.00_p5107.

All these features configurable using /etc/default/grub using two new variables (GRUB_SIMPLE_VERSION and GRUB_MENU_LINUX) and one user-defined function (grub_cmdline_linux_custom). Example:

# Add kernel version to simple menu entries
GRUB_SIMPLE_VERSION=true

# Manually define list of simple menu entries instead of auto-detecting
# latest kernel.
GRUB_MENU_LINUX="
/boot/vmlinuz-3.10.1-hardened-r1
/boot/vmlinuz-3.10.1-hardened-r1_nouveau
"

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="vga=0x315"

# Append parameters to the linux kernel command line for non-recovery entries
# for some kernels (instead of GRUB_CMDLINE_LINUX_DEFAULT)
function grub_cmdline_linux_custom {
local -A CMDLINE

CMDLINE[3.10.1-hardened-r1_nouveau]="video=800x600"

echo ${CMDLINE[$1]}
}

Alex Efros <powerman>

 

Attached Files
file #29391:  customize_menu.patch added by powerman (5KiB - application/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by powerman (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 17 Oct 2013 09:05:34 PM UTCphcoderStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Thu 17 Oct 2013 04:22:37 PM UTCpowermanAttached File-=>Added customize_menu.patch, #29391

    Back to the top


    Powered by Savane 3.1-cleanup1