Results 1 to 6 of 6

Thread: Grub2 kernel order preference (rt/generic)

  1. #1
    Join Date
    Sep 2008
    Location
    San Antonio, TX
    Beans
    19
    Distro
    Ubuntu Studio 11.04 Natty Narwhal

    Grub2 kernel order preference (rt/generic)

    I got a new laptop a couple of days ago, and although I've been running Karmic for a while on my old laptop, this is the first fresh install I've used. Tonight, I found out that Grub2 has completely replace the old version, and does not work the same way.

    Since I've installed the UbuntuStudio updates and the realtime kernel, I wanted to go through and set the kernels flagged with "-rt" to be higher in preference to those flagged with "-generic" when it decides a default. I've also go Windows 7 on a different partition, but I want to boot Linux most of the time.

    Right now, the kernels labelled "-generic" are taking preference. How do I tell Grub2 that "-rt" is more important without rewriting /etc/default/grub every time I install a new kernel?

  2. #2
    Join Date
    Jun 2009
    Location
    0000:0400
    Beans
    Hidden!

    Re: Grub2 kernel order preference (rt/generic)

    Grub is a dumb animal and will only do what it's told. There's no way to "weight" entries. A little manual maintenance every few weeks isn't so bad, eh?

  3. #3
    Join Date
    Sep 2008
    Location
    San Antonio, TX
    Beans
    19
    Distro
    Ubuntu Studio 11.04 Natty Narwhal

    Re: Grub2 kernel order preference (rt/generic)

    Interesting. Alright, thanks for the help.

  4. #4
    Join Date
    Nov 2006
    Location
    Northampton, England
    Beans
    9
    Distro
    Ubuntu Development Release

    Smile Re: Grub2 kernel order preference (rt/generic)

    I've worked out a solution to this problem - see my blog post:

    http://funkyhat.org/2010/01/19/putti...irst-in-grub2/

    The gist of it is this:

    Code:
    cd /etc/grub.d
    sudo cp 10_linux 09_linux-rt
    sudo sed -i 's:\(vmlinu[^ ]*\)-\*:\1-*rt:g' 09_linux-rt #<-edits 09_linux-rt and makes
    sudo update-grub                                          #  it only find -rt kernels
    Hope this helps!
    Last edited by funkyhat; September 2nd, 2010 at 09:49 PM. Reason: Fixing sed command -- thanks canakas!

  5. #5
    Join Date
    May 2007
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Grub2 kernel order preference (rt/generic)

    Nice work. Thank you!

    Your sed command is not working, but manual editing of 09_linux-rt did the same job.
    update-grub now finds the rt kernels first.

    lets hope the reboot goes smoothly =)

    EDIT: Looks good =)
    Last edited by canakas; August 31st, 2010 at 12:02 PM.

  6. #6
    Join Date
    Oct 2009
    Beans
    125
    Distro
    Ubuntu Studio 10.10 Maverick Meerkat

    Re: Grub2 kernel order preference (rt/generic)

    Just found this, very useful, thanks guys!

    Edit: Had a few questions but sorted them out.
    Last edited by Peter7K; September 23rd, 2010 at 06:39 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •