View previous topic :: View next topic |
Author |
Message |
jankom Guru
Joined: 30 Aug 2021 Posts: 342 Location: USA
|
Posted: Tue Mar 05, 2024 3:49 pm Post subject: Kernel compile, boot, genkernel [SOLVED] |
|
|
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: | 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 |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
|
Back to top |
|
|
jankom Guru
Joined: 30 Aug 2021 Posts: 342 Location: USA
|
Posted: Wed Mar 06, 2024 12:00 am Post subject: |
|
|
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: | 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 |
|
Back to top |
|
|
myga Tux's lil' helper
Joined: 12 Jun 2023 Posts: 121
|
Posted: Wed Mar 06, 2024 2:42 am Post subject: Re: Kernel compile, boot, genkernel |
|
|
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: | 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: | 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: | dracut --force --kver=6.1.74-gentoo |
Finally, update the grub config file.
Code: | 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.] |
|
Back to top |
|
|
BurningMemory n00b
Joined: 17 Jan 2023 Posts: 54
|
Posted: Wed Mar 06, 2024 3:25 am Post subject: |
|
|
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. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
Posted: Wed Mar 06, 2024 12:04 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2167
|
Posted: Wed Mar 06, 2024 1:11 pm Post subject: |
|
|
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.
Quote: |
...
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]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 ###
>
|
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 the description in the grub manual, it does play about with EFI vars.
The other possibility is you updated grub and ran grub-install --removable and not grub-install (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 |
|
Back to top |
|
|
jankom Guru
Joined: 30 Aug 2021 Posts: 342 Location: USA
|
Posted: Wed Mar 06, 2024 1:19 pm Post subject: Solved |
|
|
Heureka! The machine rebooted to the new kernel.
@pietinger Quote: | Re-install grub wtih "grub-install --efi-directory=/efi" OR "grub-install --efi-directory=/boot" (depending your mountpoint of your ESP) |
Code: | 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 |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
Posted: Wed Mar 06, 2024 1:59 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
jankom Guru
Joined: 30 Aug 2021 Posts: 342 Location: USA
|
Posted: Wed Mar 06, 2024 3:05 pm Post subject: |
|
|
Yesss!
I love linux - jankom |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Wed Mar 13, 2024 4:39 pm Post subject: |
|
|
Today my remote server failed to boot after regular kernel update with message:
Code: | error: diskfilter writes not supported. |
I used regular update command I use for years:
Code: | 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 |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Wed Mar 13, 2024 5:37 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1227
|
Posted: Wed Mar 13, 2024 5:55 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|
|
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
|
|