View previous topic :: View next topic |
Author |
Message |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Thu Jun 27, 2024 8:38 am Post subject: efi stub record is going out after reboot |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3683
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Thu Jun 27, 2024 9:15 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3683
|
Posted: Thu Jun 27, 2024 10:12 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pietinger Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
Joined: 17 Oct 2006 Posts: 4842 Location: Bavaria
|
Posted: Thu Jun 27, 2024 11:29 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Thu Jun 27, 2024 11:49 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3683
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Fri Jun 28, 2024 10:13 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
AndrewAmmerlaan Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/2077717582664e40d6c60df.png)
Joined: 25 Jun 2014 Posts: 365 Location: Nijmegen
|
Posted: Fri Jun 28, 2024 10:45 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
pietinger Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
Joined: 17 Oct 2006 Posts: 4842 Location: Bavaria
|
Posted: Fri Jun 28, 2024 1:16 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
AndrewAmmerlaan Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/2077717582664e40d6c60df.png)
Joined: 25 Jun 2014 Posts: 365 Location: Nijmegen
|
Posted: Fri Jun 28, 2024 1:25 pm Post subject: |
|
|
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 ![Razz :P](images/smiles/icon_razz.gif) _________________ 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 |
|
![](templates/gentoo/images/spacer.gif) |
pietinger Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
Joined: 17 Oct 2006 Posts: 4842 Location: Bavaria
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
AndrewAmmerlaan Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/2077717582664e40d6c60df.png)
Joined: 25 Jun 2014 Posts: 365 Location: Nijmegen
|
Posted: Fri Jun 28, 2024 1:45 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
pietinger Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
Joined: 17 Oct 2006 Posts: 4842 Location: Bavaria
|
Posted: Fri Jun 28, 2024 1:52 pm Post subject: |
|
|
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 !
(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 ) _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Fri Jun 28, 2024 2:11 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Fri Jun 28, 2024 3:42 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
st834 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 23 Jun 2022 Posts: 95
|
Posted: Mon Jul 01, 2024 12:12 pm Post subject: |
|
|
Thank you very much for the answers and attention in this post!
Georgi: I looked, but unfortunately did not find much information about UEFI Hewlett-Packard like mine. I think the reason for this limited functional UEFI and the lack of information about it is that, I ordered a laptop without pre-installed Windows, which an exception for HP is.
I'll probably put an intermediate bootloader systemd-boot
Thank you very much ! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|