LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-14-2015, 11:52 AM   #1
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,076

Rep: Reputation: 153Reputation: 153
GRUB2 change default to custom kernel


I have made the switch from LILO to GRUB2 on all my Slackware boxes. Still learning all the ins and outs. I am running into an issue though when I want to change the default kernel to a custom compiled on. No matter what I do, the changes won't take. Has anyone been successful in doing so? I have tried playing around with changing GRUB_DEFAULT=saved to GRUB_DEFAULT=2 and even using the actual title, but no success. I've also tried this:
Code:
Open /etc/default/grub and ensure this line exists:

GRUB_DEFAULT=saved
Apply the change to grub.cfg by running:

grub-mkconfig -o /boot/grub/grub.cfg
Now list all possible menu entries

grep "submenu\|^\smenuentry" /boot/grub/grub.cfg | cut -d "'" -f2
Now set the desired default menu entry

grub-set-default "<submenu title>><menu entry title>"
Verify the default menu entry

grub-editenv list
Which I modified from this link. Still no luck.

Any help would be appreciated.
 
Old 07-14-2015, 01:09 PM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,076

Original Poster
Rep: Reputation: 153Reputation: 153
Figured it out! For GRUB_DEFAULT, I was using:
Code:
GRUB_DEFAULT="Slackware-14.1 GNU/Linux, with Linux 3.18.18-local"
However, upon running grub-mkconfig -o /boot/grub/grub.cfg, I was instructed to use this instead:
Code:
GRUB_DEFAULT="gnulinux-advanced-e246d5eb-623e-4518-ae21-96df0820c0c3>gnulinux-3.18.18-local-advanced-e246d5eb-623e-4518-ae21-96df0820c0c3"
I'm sure this code will be different depending on the kernel version used and probably other factors. I ran the grub-mkconfig command again, and this time, the correct kernel was loaded. Marking this thread as solved. Hopefully it can be of help to others.
 
1 members found this post helpful.
Old 07-14-2015, 08:39 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,169

Rep: Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628Reputation: 2628
Why are you using (grub) submenus ?. Probably just complicating things.
I always create a 40_custom entry with a sane menuentry.
 
Old 07-15-2015, 08:11 AM   #4
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,076

Original Poster
Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by syg00 View Post
Why are you using (grub) submenus ?. Probably just complicating things.
I always create a 40_custom entry with a sane menuentry.
Thanks for the tip. Like I mentioned, I'm still learning the ins and outs of grub2. Needless to say, it's a lot more complicated than grub1.
 
Old 07-15-2015, 10:45 AM   #5
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,076

Original Poster
Rep: Reputation: 153Reputation: 153
Also, would you mind sharing what your 40_custom file looks like? I'm reading up on some documentation on how to set up a custom menu. I'm using the default menu entries.
 
  


Reply

Tags
custom, grub2, kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
current Kernel 3.16-2 fails. (custom config, but not default one) Debian jessie i386 kaz2100 Debian 2 10-29-2014 09:51 AM
[SOLVED] How to change the Grub2 to show the available kernel to boot? MarcosPauloBR Ubuntu 5 08-25-2011 05:29 AM
change the module and create custom kernel cccc Debian 9 05-30-2011 11:46 AM
change grub boot order, all instructions say change default, but I don't see default mhg Linux - Newbie 5 11-09-2008 11:01 AM
Custom kernel 2.6.22 name change from hda to sda bristi Debian 4 07-15-2007 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration