Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub2 kernel list [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 20, 2015 9:55 am    Post subject: grub2 kernel list [SOLVED] Reply with quote

Whenever I do:-
Code:
grub2-mkconfig -o /boot/grub/grub.cfg

and then reboot my computer, it only shows the most recent kernel on the grub boot screen. How can I configure grub to show all my kernels in /boot when I reboot please? Many thanks in advance.


Last edited by systemshq on Tue Oct 20, 2015 1:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Oct 20, 2015 10:43 am    Post subject: Reply with quote

When you see the grub2 menu, you can read on the lower area what you can do.

usually you can enter the edit mode (control +e key i think) and than you can temporarily edit the grub entry. (these will not change your grub2.cfg. this is a fast way to test out things, i usually write down on a piece of paper what i tried and what works) later i bootup sysrecsue cd and edit the grub.cfg accordingly...
i usually remove the kernel, than type the first letter and use the tab key to autocomplete, the lower area shows you what are the possible options.

---

personally i dislike those grub2 updater scripts.

Usually i install once grub2 to the harddisc, than i edit those configs myself with an editor. Any needed kernel paramters / other stuff is applied by myself. when i update kernels, i just replace the kenrel name in grub.cfg and thats it.

grub2 scripts never gave me any benefit. it just ruins more than they will aid me.

Some guys are able to use those scripts. they never gave me any benefits, worked. linux mint also uses those scripts and they destroyed a valid config without confirmation using hte linux mint graphical updater tool. without any confirmation from myself, they just overwrote the configs. that's the main reasno why i unisntall instantly grub2 from portage after i set up grub2. no need to ever update grub2 when it works.
Back to top
View user's profile Send private message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 20, 2015 11:41 am    Post subject: Reply with quote

Thanks but that's a workaround. However, the solution I'm looking for is that I want to see all my kernels in the main boot screen and then choose the kernel I want to boot from. I'm sure this used to be possible not so long ago?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Oct 20, 2015 11:56 am    Post subject: Reply with quote

Just create these boot entries by hand.
and it seems only an advanced editor, like geany is feasable for such tasks.

I doubt any script is capable of such. they just replace overwrite everything and hope it works those scripts.
Back to top
View user's profile Send private message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 20, 2015 12:05 pm    Post subject: Reply with quote

The problem with editing /boot/grub/grub.cfg by hand is that it will get overwritten the next time I use grub2-mkconfig. If I use ubuntu or centos which also uses grub2 I can always see a recent list of kernels in the main boot screen without having to hack the grub.cfg after using grub2-mkconfig, so I'm sure its possible in Gentoo. I shall investigate further in the next few days.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Tue Oct 20, 2015 12:14 pm    Post subject: Reply with quote

Do not use grub2-mkconfig.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Oct 20, 2015 12:51 pm    Post subject: Reply with quote

and if you use, make backups of hole config before.
Back to top
View user's profile Send private message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 20, 2015 1:20 pm    Post subject: Reply with quote

I see what you mean. It puts all the previous kernels under the sub menu option,

Code:
Advanced options for Gentoo GNU/Linux


So if I choose this option I can get to my previous kernels. And there's no where to disable sub menus and have it like it was before. So the only solution to have everything in the main menu is to edit grub.cfg - genius!!
Back to top
View user's profile Send private message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 20, 2015 1:21 pm    Post subject: Reply with quote

Thanks your help guys I'll mark this one as solved:):)
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 431
Location: Somewhere in Denmark

PostPosted: Tue Oct 27, 2015 7:10 pm    Post subject: Reply with quote

Just noticed this - if you want them on the main menu I believe you can edit /etc/default/grub - specifically this section
Code:
# Uncomment to disable generation of the submenu and put all choices on
# the top-level menu.
# Besides the visual affect of no sub menu, this makes navigation of the
# menu easier for a user who can't see the screen.
GRUB_DISABLE_SUBMENU=y
It should put all entries on the main page when generating config using grub2-mkconfig.

This file lets you set quite a few defaults for grub2-mkconfig :)

The /etc/grub.d/ files are also a good place to make changes if you want grub2-mkconfig to use/respect them

After a few changes to /etc/default/grub and some of the /etc/grub.d/ files I'm now happily using grub2-mkconfig to update grub.cfg on my headless box whenever I'm updating the kernel :)
Back to top
View user's profile Send private message
systemshq
n00b
n00b


Joined: 28 Mar 2011
Posts: 53

PostPosted: Tue Oct 27, 2015 8:39 pm    Post subject: Reply with quote

Many thanks that's working for me as well!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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