Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for UEFI bootloader with ESP layout #28

Closed
nE0sIghT opened this issue Dec 4, 2021 · 8 comments
Closed

Support for UEFI bootloader with ESP layout #28

nE0sIghT opened this issue Dec 4, 2021 · 8 comments

Comments

@nE0sIghT
Copy link

nE0sIghT commented Dec 4, 2021

It would be nice to have EFI Stub kernel support with plain UEFI bootloader.

https://wiki.gentoo.org/wiki/EFI_stub
https://wiki.gentoo.org/wiki/EFI_System_Partition

@Nowa-Ammerlaan
Copy link
Contributor

andrew-gentoo-pc andrew # eclean-kernel -aA
eclean-kernel has met the following issue:

SystemError('No vmlinuz found. This seems ridiculous, aborting.')

If you believe that the mentioned issue is a bug, please report it
to https://github.com/mgorny/eclean-kernel/issues. If possible,
please attach the output of 'eclean-kernel --list-kernels' and your
regular eclean-kernel call with additional '--debug' argument.

In fact it is not ridiculous at all :P!

A /etc/kernel/install.conf with layout=uki will result in $BOOT that looks like this:

andrew-gentoo-pc andrew # tree /boot
/boot
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Linux
│   │   ├── linux-6.3.8-gentoo-dist.efi
│   │   ├── linux-6.3.9-gentoo-dist.efi
│   │   └── linux-6.4.0-rc7-gentoo-dist+.efi
│   └── systemd
│       └── systemd-bootx64.efi
├── linux
└── loader
├── entries
├── entries.srel
├── loader.conf
└── random-seed

This is the type 2 Boot Loader Specification instead of the default type 1.

So in addition to checking for $BOOT/vmlinuz_$KERNEL_VERSION and $BOOT/$ENTRY_TOKEN-$KERNEL_VERSION/linux we should also check $ESP/Linux/$ENTRY_TOKEN-$KERNEL_VERSION.efi and if necessary clean it up.

@Nowa-Ammerlaan
Copy link
Contributor

This issue should be fixed with the latest release and can probably be closed.

@mmatous
Copy link

mmatous commented Sep 17, 2023

2.99.6: SystemError('No vmlinuz found. This seems ridiculous, aborting.')
Not working for $BOOT/EFI/Linux/linux-x.y.z-gentoo.efi format. Both specs state that the machine id/entry token is optional.
I think that if no matching entry is found, eclean should fall back to looking for *-gentoo.efi (or *-<currentdistro>.efi) files.

@Nowa-Ammerlaan
Copy link
Contributor

Not working for $BOOT/EFI/Linux/linux-x.y.z-gentoo.efi format. Both specs state that the machine id/entry token is optional.

The problem with cleaning up entries that do not match our machine-id/entry-token is that they might belong to other distributions. Therefore I don't think we can properly support that configuration.

@avollmerhaus
Copy link

According to the Gentoo wiki, mounting the ESP at /boot/efi is not recommended any more.
I now have it at /efi, with the Gentoo kernels at /efi/EFI/GENTOO.
It would be a treat if eclean-kernel could support that :)

Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 8, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 8, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 8, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
@Nowa-Ammerlaan
Copy link
Contributor

According to the Gentoo wiki, mounting the ESP at /boot/efi is not recommended any more. I now have it at /efi, with the Gentoo kernels at /efi/EFI/GENTOO. It would be a treat if eclean-kernel could support that :)

Please try with this patch: #50

Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 8, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 16, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
@avollmerhaus
Copy link

Please try with this patch: #50

At the moment, make install from the kernel sources directory only copies vmlinuz to /efi/EFI/GENTOO and moves the previous one to vmlinuz.old. I'm not entirely sure why this is the case, something something installkernel.
I'll test the patch when this is resolved. Though I have to admit I'm mostly fine with the two vmlinuz files.

@Nowa-Ammerlaan
Copy link
Contributor

At the moment, make install from the kernel sources directory only copies vmlinuz to /efi/EFI/GENTOO and moves the previous one to vmlinuz.old. I'm not entirely sure why this is the case, something something installkernel. I'll test the patch when this is resolved. Though I have to admit I'm mostly fine with the two vmlinuz files.

Could you show me the version and USE configuration of sys-kernel/installkernel and the full output of make install?

Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 22, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 22, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
Nowa-Ammerlaan added a commit to Nowa-Ammerlaan/eclean-kernel that referenced this issue Apr 22, 2024
These kernels are installed by installkernel[efistub] for efi stub
booting (not UKI booting, UKIs are in ESP/EFI/Linux)

Closes: projg2#28
Signed-off-by: Andrew Ammerlaan <[email protected]>
@mgorny mgorny closed this as completed in 765ca5f Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants