Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
efi stub record is going out after reboot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Thu Jun 27, 2024 8:38 am    Post subject: efi stub record is going out after reboot Reply with quote

Hi,

i am try to install kernel as uefi stub. i have read this guide: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Alternative_2:_EFI_Stub. But my settings and new boot record are going out after rebboting my Hewlett Packard Pavilion laptop. I read the article about efibootmgr too. An Internet search indicates errors, but I am booming that this is not so, because the GRUB installation (now I would like to do it without GRUB) works without problems.

I would appreciate advice on how I can get the efi stub right.

Thanks!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3675

PostPosted: Thu Jun 27, 2024 8:55 am    Post subject: Reply with quote

for minimalistic setup based on gentoo-sources see https://wiki.gentoo.org/wiki/User:Vaukai/EFI_stub
there replace /boot with /efi

further options in https://wiki.gentoo.org/wiki/EFI_stub
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Thu Jun 27, 2024 9:15 am    Post subject: Reply with quote

Thank you very much for your response. I replaced /boot with /efi, read these articles and checked the kernel settings.

If I try to UEFI file (select the *.efi file) at boot, the kernel behaves as expected.

When adding a boot entry:

Code:
efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "Gentoo" --loader "\EFI\Gentoo\kernel-6.6.30-gentoo.efi"


it is added and appears in the list after the efibootmgr -v command is invoked.

With a new start, the boot record is no longer visible in the boot menu. After booting the system from Live USB and calling again the command efibootmgr -v the created boot record is no longer visible.

/sys/firmware/efi/efivars is mounted as rw

Thaks!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3675

PostPosted: Thu Jun 27, 2024 10:12 am    Post subject: Reply with quote

can't you use onboard tool to access the bios / efi instead of bothering with efibootmgr?
i don't even have efibootmgr installed.
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Thu Jun 27, 2024 10:23 am    Post subject: Reply with quote

I didn't use it before, but today I'll try it, thanks for the idea. I also found this: https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Windows_changes_boot_order, section 9.8 "Boot entries created with efibootmgr fail to show up in UEFI".

Thanks!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4520
Location: Bavaria

PostPosted: Thu Jun 27, 2024 11:29 am    Post subject: Reply with quote

st834,

I boot my kernel also directly from UEFI and wrote this article:

https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI

If your created UEFI boot entry disappears after system start there exist two reasons:

1. Your UEFI is faulty ... we had in our forum some systems where it was not possible to create a new entry (this is a definite violation of the uefi specification), OR

2. There exist no (valid) bin-file where the entry points to. Most (all?) UEFI systems check at system start EVERY entry it has and if that bin-file EXIST at the defined location; AND IF NOT, UEFI simply deletes this entry (so, yes, you can create every entry you want and you will even see it in "efibootmgr" immdediately after creating ... but if it is not correct it will be deleted after enxt system startup). =>

So, please check again if --loader "\EFI\Gentoo\kernel-6.6.30-gentoo.efi" really point to your EXISTING kernel (maybe a typo somewhere ?).


P.S.: Maybe give us the output of "efibootmgr" and a "ls -lR /efi"
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Thu Jun 27, 2024 11:49 am    Post subject: Reply with quote

Thank you very much for your response. I will check all paths today and will read your article again carefully. I will write the results here. Thanks!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3675

PostPosted: Thu Jun 27, 2024 1:27 pm    Post subject: Reply with quote

st834 wrote:
I didn't use it before, but today I'll try it, thanks for the idea. I also found this: https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Windows_changes_boot_order, section 9.8 "Boot entries created with efibootmgr fail to show up in UEFI".

Thanks!


there is some more lyrics on https://wiki.gentoo.org/wiki/EFI_System_Partition#UEFI_boot_items
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Fri Jun 28, 2024 10:13 am    Post subject: Reply with quote

Hi,

continued to explore the topic.

I installed GRUB earlier with the --removable key. Without this key the bootloader was not visible in UEFI. Here I read https://superuser.com/questions/1756758/what-does-grub-installs-removable-flag-do about with what path and with what name is the *.efi file of the bootloader with the -- removable key installed. Renamed the kernel from /efi/EFI/Gentoo/kernel-6.6.30-gentoo.efi to /efi/EFI/BOOT/bootx64.efi and the process went.

But doesn't Hewlett Packard firmware understand the other way? I bought this computer without pre-installed Windows and there is a version of non-Windows UEFI.

Thanks!
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 312
Location: Nijmegen

PostPosted: Fri Jun 28, 2024 10:45 am    Post subject: Reply with quote

Quote:
I installed GRUB earlier with the --removable key. Without this key the bootloader was not visible in UEFI. Here I read https://superuser.com/questions/1756758/what-does-grub-installs-removable-flag-do about with what path and with what name is the *.efi file of the bootloader with the -- removable key installed. Renamed the kernel from /efi/EFI/Gentoo/kernel-6.6.30-gentoo.efi to /efi/EFI/BOOT/bootx64.efi and the process went.

But doesn't Hewlett Packard firmware understand the other way? I bought this computer without pre-installed Windows and there is a version of non-Windows UEFI.


That sounds like buggy UEFI firmware, the only thing you can try here is update the firmware if there is an update available. Otherwise you cannot use EFI stub booting, and I recommend using systemd-boot or refind instead.

This is precisely the reason why this feature is only available in testing, and not stable. I wrote a bit more about this here: https://bugs.gentoo.org/932842#c3
_________________
OS: Gentoo 6.8.10-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4520
Location: Bavaria

PostPosted: Fri Jun 28, 2024 1:16 pm    Post subject: Reply with quote

AndrewAmmerlaan wrote:
[...] Otherwise you cannot use EFI stub booting, and I recommend using systemd-boot or refind instead. [...]

I'm sorry if I have a different opinion here: Of course you can also boot a stub kernel directly with such a buggy UEFI by copying this stub kernel to the ESP in \EFI\BOOT\bootx64.efi, which @st834 has also done. The only disadvantage with this UEFI is that you can only boot this one kernel and cannot select others in the UEFI(-BIOS) (this means: if a kernel is not bootable, you have to boot from a boot CD and chroot into the gentoo system).

@st834

since you have overwritten the grub by copying your stub kernel (and because you probably don't want to have a boot manager) you can of course stay on this path. If you do want a boot manager, there is no reason to go to systemd-boot or refind ... your old grub will do just as well ... and you can reactivate it at any time by installing it (again) with paramter --removable.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 312
Location: Nijmegen

PostPosted: Fri Jun 28, 2024 1:25 pm    Post subject: Reply with quote

Quote:
I'm sorry if I have a different opinion here: Of course you can also boot a stub kernel directly with such a buggy UEFI by copying this stub kernel to the ESP in \EFI\BOOT\bootx64.efi, which @st834 has also done. The only disadvantage with this UEFI is that you can only boot this one kernel and cannot select others in the UEFI(-BIOS) (this means: if a kernel is not bootable, you have to boot from a boot CD and chroot into the gentoo system).


Yes you are right, what I meant to say was not that it is not possible at all, but that it is not supported by sys-kernel/installkernel[efistub]. And that you'll therefore have to do the copying manually, or make your own custom kernel installation hook to do it for you.

I still highly recommend using systemd-boot or refind instead, or have a system recovery usb close by at all times :P
_________________
OS: Gentoo 6.8.10-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4520
Location: Bavaria

PostPosted: Fri Jun 28, 2024 1:31 pm    Post subject: Reply with quote

AndrewAmmerlaan wrote:
[...] I still highly recommend using systemd-boot or refind instead, or have a system recovery usb close by at all times :P

What speaks against grub ?

It is even the default in our AMD64 Handbook:
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Default:_GRUB
Even I recommend systemd-boot only for systemd installations and for OpenRC also the grub:
https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 312
Location: Nijmegen

PostPosted: Fri Jun 28, 2024 1:45 pm    Post subject: Reply with quote

Quote:
What speaks against grub ?


Nothing, it's just that users who try efistub booting usually do so because it is "simple" (as in less components, more direct, etc). If that fails, as it unfortunately does on many buggy UEFIs, then I'd recommend a light-weight chain-loading solution such as systemd-boot or refind, since those are relatively more simple and direct compared to GRUB. GRUB on the other hand is more of a "real bootloader", and less of a "chain loader" for EFI executables. But that's just my opinion.
_________________
OS: Gentoo 6.8.10-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4520
Location: Bavaria

PostPosted: Fri Jun 28, 2024 1:52 pm    Post subject: Reply with quote

AndrewAmmerlaan wrote:
Quote:
What speaks against grub ?


Nothing, it's just that users who try efistub booting usually do so because it is "simple" (as in less components, more direct, etc). If that fails, as it unfortunately does on many buggy UEFIs, then I'd recommend a light-weight chain-loading solution such as systemd-boot or refind, since those are relatively more simple and direct compared to GRUB. GRUB on the other hand is more of a "real bootloader", and less of a "chain loader" for EFI executables. But that's just my opinion.

Thank you very much for this explanation ! :D

(Yes, grub is a bootloader and bootmanger in one; as a moderator I am of course bound to the specifications of our developers (AMD64 Handbook) ... I was already afraid that I had recommended systemd-boot for systemd systems ... and your recommendation here takes away some of that worry :D )
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 80

PostPosted: Fri Jun 28, 2024 2:11 pm    Post subject: Reply with quote

Thakns a lot for all answers!

Quote:
I'm sorry if I have a different opinion here: Of course you can also boot a stub kernel directly with such a buggy UEFI by copying this stub kernel to the ESP in \EFI\BOOT\bootx64.efi, which @st834 has also done. The only disadvantage with this UEFI is that you can only boot this one kernel and cannot select others in the UEFI(-BIOS) (this means: if a kernel is not bootable, you have to boot from a boot CD and chroot into the gentoo system).


I thought about it too, thank you. The technical solution may be to choose an alternative * .efi file manually in UEFI file expolrer, but this is possible if the computer is used by one person who installed the system.

Thanks!
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1833

PostPosted: Fri Jun 28, 2024 3:42 pm    Post subject: Reply with quote

The boot entry may disappear if the files it points to disappear as well.

Also search the internet for similar problems with your particular hardware.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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