Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 and default kernel boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pking
n00b
n00b


Joined: 11 Sep 2009
Posts: 61

PostPosted: Sat Oct 19, 2013 1:46 am    Post subject: GRUB2 and default kernel boot Reply with quote

I just migrated from grub-legacy to grub2, following the migration guide. All went well
enough, except for one extremely minor puzzle. Under grub-legacy, I had two kernels
installed, usually a new one and the immediately preceding version -- say, 3.10.7 as the
tried-and-true kernel, with the new testing kernel 3.10.7-r1. Well, after running the command
to configure grub2:
Code:

grub2-mkconfig -o /boot/grub/grub.cfg

it seems that grub2 found both kernels, but it made the earlier kernel (3.10.7) the default,
and the testing kernel (3.10.7-r1) only available under "Advanced Boot Options" or whatever
it's called. But I'd prefer to boot into the testing kernel, with the tried-and-true option as the
backup. The actual grub.cfg file has multiple scary warnings about not editing that file but to
edit entries in /etc/grub.d/ instead -- but there is nothing, or nothing obvious, there to change
this behaviour. There is an entry in /etc/default/grub for which menuentry to boot by default,
but there is no obvious way to figure out from the mess that is grub.cfg what the number of
the menuentry is.

Anyone have a straightforward answer/solution? Not a major problem, but annoying nonetheless.
Thanks.
Back to top
View user's profile Send private message
Aquous
l33t
l33t


Joined: 08 Jan 2011
Posts: 700

PostPosted: Sat Oct 19, 2013 11:09 am    Post subject: Reply with quote

The file you're looking for is /etc/default/grub
Back to top
View user's profile Send private message
pking
n00b
n00b


Joined: 11 Sep 2009
Posts: 61

PostPosted: Sat Oct 19, 2013 2:03 pm    Post subject: Reply with quote

As stated above:
Quote:

There is an entry in /etc/default/grub for which menuentry to boot by default,
but there is no obvious way to figure out from the mess that is grub.cfg what the number of
the menuentry is.

Googling around I found several websites suggesting to just "try out numbers" to see which
one works. That seems like a step backwards; grub-legacy at least had a reasonable way to
proceed...
Back to top
View user's profile Send private message
nemectic
Apprentice
Apprentice


Joined: 20 Aug 2004
Posts: 182

PostPosted: Sat Oct 19, 2013 2:09 pm    Post subject: Reply with quote

As long as you're confident on what to change, and you have a live cd/usb to boot just in case, just edit your grub.cfg.
Back to top
View user's profile Send private message
pking
n00b
n00b


Joined: 11 Sep 2009
Posts: 61

PostPosted: Sat Oct 19, 2013 3:55 pm    Post subject: Reply with quote

Well, yes. Of course I can edit grub.cfg directly (keeping a spare boot device handy). The
question was, is there some sensible and sane way to set the default kernel to boot? Clearly
you can work it out by experimentation, and just as clearly you can write it from scratch, but
a direct and straightforward way would be appreciated, especially since it was easy to do in
grub-legacy [either put the default boot menuentry first in the list or read off its position in the
numerical list and change the "default boot" entry before the menu list].

I see I'm not the only one to ask, and that the proposed answers listed don't seem to work:
http://unix.stackexchange.com/questions/62733/how-to-correctly-set-up-the-right-grub-2-default-menu-entry
Don't think I'll be switching to grub2 on other systems if it's this much trouble for little by way of
concrete gain, at least in my case.
Back to top
View user's profile Send private message
nemectic
Apprentice
Apprentice


Joined: 20 Aug 2004
Posts: 182

PostPosted: Sat Oct 19, 2013 5:54 pm    Post subject: Reply with quote

I dont think theres much to gain switching to grub2 unless you use uefi. I'm away at the moment & typing on my phone, but if you post your grub.cfg and tell me which you want to load as default I'll happily take a look when I'm at a computer tomorrow if you haven't got it sorted by then.
Back to top
View user's profile Send private message
pking
n00b
n00b


Joined: 11 Sep 2009
Posts: 61

PostPosted: Sun Oct 20, 2013 10:44 pm    Post subject: Reply with quote

Thanks, but after looking into it I decided it wasn't worth my time to learn grub2 -- for
the next round of computers I'll use some version of efi booting that doesn't need any
bootloader; for this round, well, I already understand grub-legacy and it doesn't seem
to have any particular bugs and it isn't a security issue, so why change? Yes, it won't
get bugfixes, but it doesn't seem broken, either. Whereas grub2 -- at least given the
"helpful" scripts provided by gentoo -- would be another learning curve, and, given the
way the future seems to be shaping up, no reason to bother. If I need a new bootloader
in the meantime I'll use syslinux.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum