Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Kernel compile, boot, genkernel [SOLVED]

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
jankom
Guru
Guru
Posts: 545
Joined: Mon Aug 30, 2021 4:18 pm
Location: USA
Contact:
Contact jankom
Website

Kernel compile, boot, genkernel [SOLVED]

  • Quote

Post by jankom » Tue Mar 05, 2024 3:49 pm

Help!
I recently updated my system with eix-sync, etc. and compiled kernel 6.6.13. I remember reading something about genkernel and grub, but I thought it does not apply to my system. However, after completing the usual commands my system would not boot. Here is what I did:

Code: Select all

make olddefconfig
make menuconfig
make -j$(nproc) 2>&1 | tee log.txt
make  modules_install -j$(nproc)
make install
make headers_install
grub-mkconfig -o /boot/grub/grub.cfg
What can I do? I can boot to a rescue USB drive, but chroot did not work because it uses zsh.

Please, help

jankom
Last edited by jankom on Wed Mar 06, 2024 1:08 pm, edited 1 time in total.
Top
pietinger
Administrator
Administrator
Posts: 6639
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

Re: Kernel compile, boot, genkernel

  • Quote

Post by pietinger » Tue Mar 05, 2024 6:25 pm

jankom wrote:[...] my system would not boot. [...]
This is vague and does not describe what exactly happens. If your world update also included the grub, then you probably did not reinstall it.

So chroot (*) again into your gentoo system; mount your ESP and do a re-install of grub with "grub-install ...". (See also the news on 2024-02-01)

*) https://wiki.gentoo.org/wiki/User:Pieti ... stallation
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
jankom
Guru
Guru
Posts: 545
Joined: Mon Aug 30, 2021 4:18 pm
Location: USA
Contact:
Contact jankom
Website

  • Quote

Post by jankom » Wed Mar 06, 2024 12:00 am

There was no EFI or boot screen, turning on the computer took me to the hardware setup screen (various info , select boot device order, etc.
2nd problem is that my rescue USB stick failed. It was an old 1 G stick, showing signs of old age. Caput.
Created new Rescue stick and it found my boot files - I guess it chrooted and started my computer, - Good news!
Copied grub.cfg from backup (I do backups at least monthly - fortunately) after renaming the new cfg to preserve it.
Bingo, computer started again to previous kernel - I'm writing this on it.
Here is a diff output:

Code: Select all

janos@andraslinux ~/tmp $ diff grub.cfg grub.cfg.new 
106,107c106,107
<       echo    'Loading Linux 6.1.67-gentoo ...'
<       linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
---
>       echo    'Loading Linux 6.6.13-gentoo ...'
>       linux   /vmlinuz-6.6.13-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
110c110
<       menuentry 'Gentoo GNU/Linux, with Linux 6.1.67-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.67-gentoo-advanced-ebb3d50c-198e-45ac-aade-a07070215803' {
---
>       menuentry 'Gentoo GNU/Linux, with Linux 6.6.13-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.6.13-gentoo-advanced-ebb3d50c-198e-45ac-aade-a07070215803' {
124,125c124,125
<               echo    'Loading Linux 6.1.67-gentoo ...'
<               linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
---
>               echo    'Loading Linux 6.6.13-gentoo ...'
>               linux   /vmlinuz-6.6.13-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
127c127
<       menuentry 'Gentoo GNU/Linux, with Linux 6.1.67-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.67-gentoo-recovery-ebb3d50c-198e-45ac-aade-a07070215803' {
---
>       menuentry 'Gentoo GNU/Linux, with Linux 6.6.13-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.6.13-gentoo-recovery-ebb3d50c-198e-45ac-aade-a07070215803' {
141,142c141,142
<               echo    'Loading Linux 6.1.67-gentoo ...'
<               linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro single 
---
>               echo    'Loading Linux 6.6.13-gentoo ...'
>               linux   /vmlinuz-6.6.13-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro single 
144c144
<       menuentry 'Gentoo GNU/Linux, with Linux 6.1.57-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.57-gentoo-advanced-ebb3d50c-198e-45ac-aade-a07070215803' {
---
>       menuentry 'Gentoo GNU/Linux, with Linux 6.1.67-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.67-gentoo-advanced-ebb3d50c-198e-45ac-aade-a07070215803' {
158,159c158,159
<               echo    'Loading Linux 6.1.57-gentoo ...'
<               linux   /vmlinuz-6.1.57-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
---
>               echo    'Loading Linux 6.1.67-gentoo ...'
>               linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
161c161
<       menuentry 'Gentoo GNU/Linux, with Linux 6.1.57-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.57-gentoo-recovery-ebb3d50c-198e-45ac-aade-a07070215803' {
---
>       menuentry 'Gentoo GNU/Linux, with Linux 6.1.67-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.1.67-gentoo-recovery-ebb3d50c-198e-45ac-aade-a07070215803' {
175,176c175,176
<               echo    'Loading Linux 6.1.57-gentoo ...'
<               linux   /vmlinuz-6.1.57-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro single 
---
>               echo    'Loading Linux 6.1.67-gentoo ...'
>               linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro single 
184a185,190
> ### BEGIN /etc/grub.d/25_bli ###
> if [ "$grub_platform" = "efi" ]; then
>   insmod bli
> fi
> ### END /etc/grub.d/25_bli ###
> 
189,191c195,202
< menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
<       fwsetup
< }
---
> if [ "$grub_platform" = "efi" ]; then
>       fwsetup --is-supported
>       if [ "$?" = 0 ]; then
>               menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
>                       fwsetup
>               }
>       fi
> fi
janos@andraslinux ~/tmp $
What did I do wrong, what should've done?

Thanks for your help.

jankom
Top
myga
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 121
Joined: Mon Jun 12, 2023 2:06 am

Re: Kernel compile, boot, genkernel

  • Quote

Post by myga » Wed Mar 06, 2024 2:42 am

jankom wrote:Help!
I recently updated my system with eix-sync, etc. and compiled kernel 6.6.13. I remember reading something about genkernel and grub, but I thought it does not apply to my system. However, after completing the usual commands my system would not boot. Here is what I did:

Code: Select all

make olddefconfig
make menuconfig
make -j$(nproc) 2>&1 | tee log.txt
make  modules_install -j$(nproc)
make install
make headers_install
grub-mkconfig -o /boot/grub/grub.cfg
What can I do? I can boot to a rescue USB drive, but chroot did not work because it uses zsh.

Please, help

jankom
Not sure where you got the guide to build the kernel sources with those commands from, but here is how I personally do it:

Build the kernel (this is done after you either copied the kconfig file to /usr/src/linux and/or modified it using make menuconfig).

Code: Select all

cd /usr/src/linux

make modules_prepare && make && emerge @module-rebuild && make modules_install && make install && make clean
Next, generate the initramfs. As an example, I'm using gentoo-sources-6.1.74.

Code: Select all

dracut --force --kver=6.1.74-gentoo
Finally, update the grub config file.

Code: Select all

grub-mkconfig -o /boot/grub/grub.cfg
[Never break the law to save people. Nope, there aint no heroes here. Unless you are 'Satoshi Nakamoto', that's a true anonymous.]
Top
BurningMemory
n00b
n00b
Posts: 61
Joined: Tue Jan 17, 2023 2:33 am

  • Quote

Post by BurningMemory » Wed Mar 06, 2024 3:25 am

Considering recent grub updates you might want to try doing grub-install again
in case they changed something with config generation.
If you're certain this is not a kernel issue it's worth a try to just reinstall grub and
regenerate the configuration file.
Also, if you have an initramfs do regenerate it as well, as myga mentioned.
Top
pietinger
Administrator
Administrator
Posts: 6639
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 06, 2024 12:04 pm

jankom,

if your computer starts BIOS when you switch on, then it is probably not a problem with your kernel (your procedure is correct; I would choose "make oldconfig" and answering the questions instead "make olddefconfig" which sets all the new options automatically; but this is your decision). As said before, if you update grub you must re-install it. Please do:

1. Boot now into your old system
2. Check to which mountpoint you have mounted your EfiSystemPartition (ESP)
3. Re-install grub wtih "grub-install --efi-directory=/efi" OR "grub-install --efi-directory=/boot" (depending your mountpoint of your ESP)
4. Check if there is an error message. If yes: STOP here and tell us. If successfull proceed with:
4. Do a "grub-mkconfig -o /boot/grub/grub.cfg" AND check if grub found all your kernels you have (also the new one)
5. Reboot
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2404
Joined: Wed Mar 07, 2007 6:41 pm

  • Quote

Post by Goverp » Wed Mar 06, 2024 1:11 pm

jankom wrote:There was no EFI or boot screen, turning on the computer took me to the hardware setup screen (various info , select boot device order, etc.
You were certainly OK up to "grub-mkconfig" in you first post in this thread (it's consistent with what I've done for many years) - though for most purposes you should skip "make headers_install" - AFAIK Gentoo is set to use what's installed by "sys-kernel/linux-headers". (They don't need to be updated for each kernel - there's a discussion elsewhere on the forums if you want more details.)
In particular, I don't see what made your computer enter hardware setup - the sequence of commands in your first post didn't touch the EFI variables, or grub module, so your PC's BIOS should have found grub64.efi in its usual location and started it. Something else must have changed - running say "grub install" or something else that touches either grub64.efi or the EFI variables.
...
Copied grub.cfg from backup (I do backups at least monthly - fortunately) after renaming the new cfg to preserve it.
Bingo, computer started again to previous kernel - I'm writing this on it.
Here is a diff output:

Code: Select all

janos@andraslinux ~/tmp $ diff grub.cfg grub.cfg.new 
106,107c106,107
<       echo    'Loading Linux 6.1.67-gentoo ...'
<       linux   /vmlinuz-6.1.67-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
---
>       echo    'Loading Linux 6.6.13-gentoo ...'
>       linux   /vmlinuz-6.6.13-gentoo root=PARTUUID=787ad6e8-0bce-684b-8847-b59983dfddfd ro  
...
184a185,190
> ### BEGIN /etc/grub.d/25_bli ###
> if [ "$grub_platform" = "efi" ]; then
>   insmod bli
> fi
> ### END /etc/grub.d/25_bli ###
> 
[/quote]
As far as I can see, the old and new grub.cfg files look good apart from changing the vmlinuz file versions as you presumably wanted, and that bit about bli, which seems to be a stanza near the end of grub.cfg that I'd have thought was not invoked.  If the bli module was invoked, that might be your problem.  It's new to me, but reading [url=https://www.gnu.org/software/grub/manual/grub/grub.html#bli]the description in the grub manual[/url], it does play about with EFI vars.

The other possibility is you updated grub and ran [i]grub-install --removable[/i] and not [i]grub-install[/i] (without --removable).  Running grub-install (whatever options) should update the modules in /boot/grub, so you have to ensure the loader in the EFI partition is updated in step - typically by running grub-install without the --removable option.

(Note that discussions about running dracut or regenerating initramfs seem off-thread, as your working grub.cfg makes no mention of initramfs.)
Greybeard
Top
jankom
Guru
Guru
Posts: 545
Joined: Mon Aug 30, 2021 4:18 pm
Location: USA
Contact:
Contact jankom
Website

Solved

  • Quote

Post by jankom » Wed Mar 06, 2024 1:19 pm

Heureka! The machine rebooted to the new kernel.
@pietinger
Re-install grub wtih "grub-install --efi-directory=/efi" OR "grub-install --efi-directory=/boot" (depending your mountpoint of your ESP)

Code: Select all

andraslinux / # grub-install --efi-directory=/boot
Installing for x86_64-efi platform.
Installation finished. No error reported.
andraslinux / # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.6.13-gentoo
Found linux image: /boot/vmlinuz-6.1.67-gentoo
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
andraslinux / # 
Apparently grub had to be reinstalled. When I compared grub directory with the one in the backup I could see no difference, but now system boots normally to the new kernel.

I'll add the "grub-install" step to my process for future akernel updates.

Thank you all, for your interest and ideas.

I marked this post as SOLVED.

jankom
Top
pietinger
Administrator
Administrator
Posts: 6639
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 06, 2024 1:59 pm

Goverp wrote:[...] If the bli module was invoked, that might be your problem. [...]
As you probably already know, grub consists of two parts. UEFI loads \efi\gentoo\grubx64.efi (the first part of grub) from the EfiSystemPartition (ESP). This part of grub now loads all its parts from /boot/grub and also the grub.cfg (the second half) - which was created by "grub-mkconfig". If now in a new grub version creates a grub.cfg with "grub-mkconfig" that ONLY the new grub understands, then there is a problem if the old grub is still installed / active. Because the old grub unfortunately cannot execute the new grub.cfg correctly. Therefore it was pointed out in the NEWS of 2024-02-01 that grub must be reinstalled.
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
jankom
Guru
Guru
Posts: 545
Joined: Mon Aug 30, 2021 4:18 pm
Location: USA
Contact:
Contact jankom
Website

  • Quote

Post by jankom » Wed Mar 06, 2024 3:05 pm

Yesss!

I love linux - jankom
Top
pietinger
Administrator
Administrator
Posts: 6639
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 06, 2024 3:28 pm

jankom wrote:Yesss!

I love linux - jankom
:lol:

Yes, me too ! 8)
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

  • Quote

Post by tnt » Wed Mar 13, 2024 4:39 pm

Today my remote server failed to boot after regular kernel update with message:

Code: Select all

error: diskfilter writes not supported.
I used regular update command I use for years:

Code: Select all

make -j6 && make modules_install && make install && grub-mkconfig -o /boot/grub/grub.cfg
Should I also try solving it by running grub-install or this error is not related to the mentioned one?
gentoo user
Top
pietinger
Administrator
Administrator
Posts: 6639
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 13, 2024 4:42 pm

tnt wrote:[...] Should I also try solving it by running grub-install [...] ?
Yes. 8)
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

  • Quote

Post by tnt » Wed Mar 13, 2024 5:37 pm

OK, now I'm getting:

kernel panic unable to mount root fs on unknown-block(0,0)

It seems it cannot see my /dev/md0 (raid1) root partition :(
gentoo user
Top
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

  • Quote

Post by tnt » Wed Mar 13, 2024 5:55 pm

stopping /dev/md127 and re-assembling /dev/md0 before mounting /mnt/getnoo from live CD and following grub update process solved the issue...
gentoo user
Top
Post Reply

15 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic