I’ve installed the linux-rt realtime kernel package in Ubuntu 9.10 so I can play with the pro audio stuff that uses JACK properly. It seems that the -rt kernel doesn’t get as many updates as the -generic one, resulting in it having a lower release version (currently -generic is at 2.6.31-18 and -rt is at 2.6.31-9).
This is unfortunate because it means that -generic kernels will be placed first in the grub boot menu, and be chosen as the default boot option. I could change the default boot option each time a new kernel is installed, but I’m lazy.
There are a couple of solutions to this, firstly I could remove all of the linux-generic kernel versions, but I’d rather not just in case the -rt kernel causes issues, or some apps don’t play nice with it.
The other solution is to figure out how to re-order the grub menu. With grub2 (in Ubuntu and Debian at least) the menu config file should not be edited by hand, and is instead generated by running the scripts in /etc/grub.d/ in order. I didn’t work out exactly how the scripts order the kernels, but I figured out if I copied the file responsible for generating the linux entries in the boot list and modified my copy so that it only found -rt kernels I could force the -rt kernels to the top.
Here are the commands needed to do this:
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
This does result in the -rt kernels being listed twice, and I could modify 10_linux as well so that this didn’t happen, but I’m happy with the way it is.
Update: 02/09/2010 fixed sed command (thanks to canakas on ubuntuforums.com for pointing out it wasn’t working)