main/gummiboot: fix non-secureboot mode and wait for key

This commit is contained in:
Jakub Jirutka 2023-09-08 23:34:40 +02:00 committed by Natanael Copa
parent 1569cfb027
commit f12529ee67
3 changed files with 43 additions and 1 deletions

View file

@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gummiboot
pkgver=48.1
pkgrel=7
pkgrel=8
pkgdesc="Simple EFI Boot Manager"
url="https://cgit.freedesktop.org/gummiboot/"
arch="x86 x86_64 aarch64"
@ -14,6 +14,8 @@ source="https://dev.alpinelinux.org/archive/gummiboot/gummiboot-$pkgver.tar.gz
gummiboot-aarch64-support.patch
sysmacros.patch
remove-conflicts.patch
fix-non-secureboot-mode.patch
fix-waitforkey.patch
"
options="!check"
@ -51,4 +53,6 @@ a536db10ee384fa2cd38d22bd43f87215501c38471612a1d30986748d645d970e67b3f3d38fc9d6b
6acc971c59b917616d75f5935859d109efff14c55b8fb26075ee89b6e4141f1c91708c1fc77f0acb2239d9030f4b350eaf1dac59ebb37e7a9ae5682eb52687cf gummiboot-aarch64-support.patch
b16d5f68429acfd7ff7942ef6091455035645cb592b9f4b1424daff3245c584bf61c30a7d5eb236530c46226d67ba48f6496f6ae00de6c94a7c5e37f5bdc4831 sysmacros.patch
2f48957253afdb05d1ec401a80383bc582543822fda2c2a30b8a9137481b6911194ac34c7da323414dd00234cd51b8f7803788360e747d325e192b71f9171f72 remove-conflicts.patch
cf411c3ecf5f6d975533a85c3fa0f0cf5ee1bb4e899680179d7a3103ccf618c68b0746faac0a83497f1e150f691a26399fc73e5e644b03954e4bcc02c07702b1 fix-non-secureboot-mode.patch
d07c3e0ea4eaed0396e13d5327ac282681d1667333d29fa420ffd81f81c341ef85c1d8ce621873d63310a7d3f9d691c8f70a3e52b0227aeaaadd7943e4ff3b9c fix-waitforkey.patch
"

View file

@ -0,0 +1,14 @@
Patch-Source: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gummiboot/patches/stub.patch
--
--- a/src/efi/stub.c 2015-03-12 00:50:35.000000000 +0100
+++ b/src/efi/stub.c 2020-07-06 12:32:55.985327487 +0200
@@ -83,7 +83,7 @@
cmdline_len = szs[0];
/* if we are not in secure boot mode, accept a custom command line and replace the built-in one */
- if (!secure && loaded_image->LoadOptionsSize > 0) {
+ if ((!secure || cmdline_len == 0) && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions > 0x1F) {
CHAR16 *options;
CHAR8 *line;
UINTN i;

View file

@ -0,0 +1,24 @@
Patch-Source: https://github.com/void-linux/void-packages/blob/master/srcpkgs/gummiboot/patches/fix-waitforkey.patch
--
This patch fixes an issue where pressing any key within the gummiboot
menu causes it to hang (though no issue occurs if no key is pressed). The
culprit appears to be the WaitForKeyEx function, which lacks support in certain
UEFI implementations. This fix is backported from the same issue found in
systemd-boot (gummiboot's mainstream counterpart): see
<https://github.com/systemd/systemd/issues/3632> and
<https://github.com/systemd/systemd/pull/3735>.
--- a/src/efi/console.c 2015-03-11 16:50:35.000000000 -0700
+++ b/src/efi/console.c 2020-12-09 15:41:19.837704801 -0800
@@ -96,10 +96,7 @@
/* wait until key is pressed */
if (wait) {
- if (TextInputEx)
- uefi_call_wrapper(BS->WaitForEvent, 3, 1, &TextInputEx->WaitForKeyEx, &index);
- else
- uefi_call_wrapper(BS->WaitForEvent, 3, 1, &ST->ConIn->WaitForKey, &index);
+ uefi_call_wrapper(BS->WaitForEvent, 3, 1, &ST->ConIn->WaitForKey, &index);
}
if (TextInputEx) {