LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-11-2019, 07:35 AM   #16
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242

here is a grub on my one laptop.
Code:
$ cat /etc/default/grub
#
# Configuration file for GRUB.
#
GRUB_DEFAULT=saved
#save last distro booted
GRUB_SAVEDEFAULT=true
#GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Void"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 slub_debug=P page_poison=1"
# Uncomment to use basic console
#GRUB_TERMINAL_INPUT="console"
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
#GRUB_BACKGROUND=/usr/share/void-artwork/splash.png
GRUB_BACKGROUND=/boot/grub/images/tuxkiller3.png
GRUB_GFXMODE=1920x1080x32,1600x900x32,1600x900x24,1600x900x16,auto
GRUB_GFXPAYLOAD="keep"
#GRUB_DISABLE_LINUX_UUID=true
#GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-blue/black"
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

what you are looking for is the advance options in the menu when you boot up, saving last boot might help, I'll have to reboot to check that, also you might be able to use 40_custom and write a menu in there that will always point to your specific kernel that you want to boot.

open up your /boot/grub/grub,cfg and use that as a template for the kernel you want. Where you can actually find it in the cfg file then copy that over into your 40_custom file in /etc/grub.d, save, update-grub, reboot, cross fingers.
Code:
    menuentry 'Slackware 14.2 x86_64 (post 14.2 -current) (on /dev/sdb2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-generic-4.19.41--d830e5b3-b05a-479f-9431-8cbd4dc0ccd6' {
                savedefault
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2  d830e5b3-b05a-479f-9431-8cbd4dc0ccd6
                else
                  search --no-floppy --fs-uuid --set=root d830e5b3-b05a-479f-9431-8cbd4dc0ccd6
                fi
                linux /boot/vmlinuz-generic-4.19.41 root=/dev/sdb2
        }
the bold is where you'll find the kernel you are looking for to use.

with your last selection saved in your default grub if it does work then it will always default to that kernel unless you pick something different, because it works off of last menu option selected.

if all you want is the latest kernel installed on a particular OS, then just add this, and as stated, it will always be set to whichever menu option you used last, because it will always be selected on next boot. Just by adding this to your grub file.
Code:
GRUB_DEFAULT=saved
#save last distro booted
GRUB_SAVEDEFAULT=true
It is under advance options where that gets tricky because there usually is more than one kernel and mode to pick from and all that is being selected on the boot menu is the option to go into advance options where you then have to move to the kernel and mode yo want, then just go back to the beginning of this post and give that idea a try.

Last edited by BW-userx; 05-11-2019 at 07:48 AM.
 
Old 05-11-2019, 10:39 AM   #17
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,375

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
At the grub menu when you first boot select the kernel you want to use. The next boot the same kernel you selected at the first boot should be saved kernel for the default.
 
Old 05-12-2019, 04:21 AM   #18
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
@BW-userx, @colorpurple21859, but I am afraid the next time I will build and install new kernel it will all be overwritten again right?
 
Old 05-12-2019, 02:09 PM   #19
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
this is why we have version numbering system, and should have means for a custom naming scheme. So you can have a back up kernel if you want one. therefore, if you use the same version of kernel then apply the naming scheme to identify it for what it is.

You'll have to read up on that, or wait and hope someone else clues you in on the details more on that. Because I do not roll my own kernels.

Last edited by BW-userx; 05-12-2019 at 02:11 PM.
 
Old 05-12-2019, 08:57 PM   #20
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,375

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
another option is to use grub-customizer to set default http://tipsonubuntu.com/2018/03/11/i...ntu-18-04-lts/
 
Old 09-27-2020, 02:38 PM   #21
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by BW-userx View Post
__________________

“Stand up for Truth even it means standing alone.” Suzy Kassem
"It disturbs me no more to find men base, unjust, or selfish than to see apes mischievous, wolves savage, or the vulture ravenous." Jean-Paul Sartre
“Whenever you deny the hand of Justice, Violence almost always steps in.” Suzy Kassem
"Posting Quotes is not against the law even in Linux Questions, But them that have the power to abuse believe it is.
"If you can abuse your power you have too much." -Marty Rubin
"Government big enough to supply everything you need is big enough to take everything you have." -- often attributed to Thomas Jefferson
Personally, I like the sentiment regardless of the source.
RE: Thomas Jefferson

Regards,
~~~ 0;-Dan
 
Old 10-01-2020, 03:44 PM   #22
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,375

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
Quote:
@BW-userx, @colorpurple21859, but I am afraid the next time I will build and install new kernel it will all be overwritten again right?
Yes the default will change, However, as long as grub picks up the new kernel when update-grub is run, it will become the default when selected from the grub menu. The saved default lines in /etc/default/grub are for this when update-grub is run

Last edited by colorpurple21859; 10-01-2020 at 03:47 PM.
 
Old 10-04-2020, 06:10 AM   #23
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by mra90 View Post
Thanks for the answer,

There are no words to express how GRUB annoys me

I try to setup default grub, I even found similar problem here


So what I do is I set GRUB_DEFAULT in /etc/default/grub to kernel name - FAIL, still boots the exact same kernel #0 from list. Then I didn't give up and try setting GRUB_DEFAULT to number/index regarding to menuentry in /boot/grub/grub.cfg - no luck again.

Here is content of my /etc/default/grub


Does anybody know why this crap doesn't boot the kernal I specify by GRUB_DEFAULT?

PS: of cource I do sudo grub-update after I change that /etc/default/grub file
Grub2 works on the principles of magic, prayer and hope. You can do and hope or you can try and pray, but generally things are just magically happening the way grump2 says it is to happen with no apparent logic or consistency..

autogen.magix

Last edited by zeebra; 10-04-2020 at 06:12 AM.
 
  


Reply



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
GRUB menu not getting updated even after changing /boot/grub/grub.cfg KNSI Linux From Scratch 4 06-20-2018 09:13 PM
GRUB menu not getting updated even after changing /boot/grub/grub.cfg KNSI Linux - Newbie 6 06-20-2018 01:54 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:49 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
Open Source Consulting | Domain Registration