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 08-04-2021, 02:18 PM   #1
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Rep: Reputation: Disabled
Moving a Kernel Option into Grub?


With these instructions here:

https://handheld.computer/?page_id=1131#kernel

I was able to compile a 8.7mb monolith kernel for my One-Netbook A1. The rub is, this is a gentoo-based kernel running on my Linux Mint 19.3 xfce. "Make install" created a kernel panic, so I used installed this way:

Code:
mount /dev/nvme0n1p1 /mnt/boot
cp arch/x86_64/boot/bzImage /mnt/boot/EFI/Boot/bootx64.efi
umount /mnt/boot
efibootmgr -c -d /dev/nvme0n1 -p1 -L 'Gentoo' -l '\EFI\Boot\bootx64.efi'
Now I boot directly into the gentoo kernel, but is it possible to put this kernel option into grub so I can choose easily b/w gentoo and the generic ubuntu kernel?

Thanks for any advice,
Jake
 
Old 08-04-2021, 03:23 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,358

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
at the grub menu when you first boot press c for grub> prompt,
Code:
grub> chainloader (hd0,1)/EFI/Boot/bootx64.efi
is able to boot gentoo,

add an menuentry similar to this in /etc/grub.d/40_custom
Code:
menuentry 'Gentoo' {
set root=(hd0,1)
chainloader=/EFI/Boot/bootx64.efi
}
then rerun update-grub

Last edited by colorpurple21859; 08-04-2021 at 08:21 PM.
 
Old 08-04-2021, 03:52 PM   #3
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Many thanks for your quick reply. With "(hd0,1)", bootx64.efi is not found.

ls produces, in this order: (proc) (hd0) (hd0,msdos) (hd1) (hd1, gpt7) (hd1, gpt6) (hd1, gpt5) (hd1, gpt4) (hd1, gpt3) (hd1, gpt2) (hd1, gpt1)

Chainloading gpt1 or gpt6 appears to find the file, but gentoo doesn't load, things errorlessly return to grub prompt.

Thanks again for weighing in,
Jake

I don't know if this helps, but this is where I find the *.efi: /boot/efi/EFI/Boot/bootx64.efi

Last edited by jakfish; 08-04-2021 at 04:01 PM.
 
Old 08-04-2021, 08:23 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,358

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
based on
Quote:
mount /dev/nvme0n1p1 /mnt/boot
add this to the mix at the grub prompt
Code:
grub> chainloader (hd1,gpt1)/EFI/Boot/bootx64.efi
grub> boot
another menuentry in /etc/grub.d/40_custom that may work is
Code:
menuentry 'Gentoo' {
set root=(hd1,gpt1)
linux /EFI/Boot/bootx64.efi
}

Last edited by colorpurple21859; 08-04-2021 at 08:32 PM.
 
Old 08-04-2021, 09:09 PM   #5
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
That did it. Thanks once more for figuring this out.

One thing--could you tell me why
Code:
grub> boot
was necessary in this case? I'm still working through the mechanics of chainloading.

Jake
 
Old 08-04-2021, 09:19 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,358

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
I had forgot to add boot in my original post. boot is needed when booting from the grub prompt to tell grub to boot the system.
 
Old 08-05-2021, 08:15 AM   #7
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
Got it. Thanks for the explanation.

Jake
 
Old 08-05-2021, 08:29 AM   #8
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
An interesting quirk--booting into Win10 from grub works, but upon reboot, the Gentoo option disappears from grub. I have to boot into Linux Mint via ubuntu generic kernel, and re-reun update-grub to get Gentoo option back.

Any idea why?

Jake
 
Old 08-05-2021, 09:17 AM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,358

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Quote:
Chainloading gpt1 or gpt6 appears to find the file
Do you have two efi partitions? There may be another grub.cfg located somewhere else that is loaded instead of the one with the gentoo menu entry, possibly located on the efi partition somewhere.
 
Old 08-05-2021, 10:32 AM   #10
jakfish
Member
 
Registered: Aug 2016
Posts: 52

Original Poster
Rep: Reputation: Disabled
There's only one efi partition and only one grub.cfg, found in /boot/grub.

Perhaps Win10's boot is scrambling things as linux-to-linux reboots are fine, grub-wise.

For me, Win10 is basically a 25gb Netflix viewer, so I don't often boot there.

Jake
 
  


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
No display, no bios option page after choosing nomodeset... option in grub andy36633 Linux - Kernel 7 01-14-2019 01:07 AM
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
Remove dual boot option/Moving GRUB sumyunguy Linux - Newbie 3 02-24-2005 12:23 AM
Moving GRUB into WinMe boot loader cucolin@ Linux - Software 7 03-03-2004 01:43 PM

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

All times are GMT -5. The time now is 07:35 AM.

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