On Sun, Jan 27, 2013 at 11:52 PM, Francesco Turco <[email protected]> wrote: > Hello. > > I'm running GRUB 2.00 on a Gentoo Linux system. > > I compile my own kernels manually, and then I install them in /boot with > make install. I have the following kernels in /boot at the moment: > > # ls -1 /boot/vmlinuz* > /boot/vmlinuz-3.7.4-gentoo-5 > /boot/vmlinuz-3.7.4-gentoo-first > /boot/vmlinuz-3.7.4-gentoo-fourth > /boot/vmlinuz-3.7.4-gentoo-third > > Running grub2-mkconfig results in the following output: > > # grub2-mkconfig -o /boot/grub2/grub.cfg > Generating grub.cfg ... > Found linux image: /boot/vmlinuz-3.7.4-gentoo-third > Found linux image: /boot/vmlinuz-3.7.4-gentoo-fourth > Found linux image: /boot/vmlinuz-3.7.4-gentoo-first > Found linux image: /boot/vmlinuz-3.7.4-gentoo-5 > done > > If I now read the resulting /boot/grub2/grub.cfg file, I notice that the > following entries have been created: > > - A main default entry which starts vmlinuz-3.7.4-gentoo-third > - A submenu with the all the other entries (including recovery ones), in > the same order as the grub2-mkconfig command > > The problem is that at boot time I'd like to load by default the fifth > revision of my kernel (vmlinuz-3.7.4-gentoo-5), not the third one > (vmlinuz-3.7.4-gentoo-third). I also prefer not to access the submenu > for choosing the right kernel to load. > > How can I change this behaviour? How can I tell GRUB that I want to run > the fifth revision of my kernel by default and not the older third > revision? In general, how can I change the default entry line to match > the kernel I want and not a seemingly random one picked by GRUB? > > I also tried with setting GRUB_DEFAULT=3 in /etc/default/grub and > re-running grub2-mkconfig. But at boot time the default entry is still > vmlinuz-3.7.4-gentoo-third. > > Another problem I noticed with the GRUB_DEFAULT approach is that it > seems that you first have to run grub2-mkconfig for having the orderded > list of kernels, then you set that variable with the number of kernel > you want to load by default, but at last you have to re-run > grub2-mkconfig in order for the variable to take effect. > > Thank you. > > _______________________________________________ > Help-grub mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/help-grub
Does http://www.gnu.org/software/grub/manual/grub.html#default clarify things for you? Also, I highly recommend that you use a consistent naming scheme with your kernel images, and that that scheme use numbers that aren't spelled out, e.g. "/boot/vmlinuz-3.7.4-gentoo-4" rather than "/boot/vmlinuz-3.7.4-gentoo-fourth" so that grub-mkconfig will sort them by largest version number first, as you probably want. -- Jordan Uggla (Jordan_U on irc.freenode.net) _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
