From 1202ff522352cff239aea17fdd12850b23360615 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 11 May 2026 08:18:58 +0000 Subject: [PATCH] sys-boot/grub: Sync with Gentoo It's from Gentoo commit a822ebdd34d0270dc3adad287abee2c6fd7f86cf. Signed-off-by: Flatcar Buildbot --- .../sys-boot/grub/files/gfxpayload.patch | 4 ++ .../grub/files/grub-2.14-efi_uga.patch | 41 +++++++++++++++++++ .../grub/files/grub-2.14-gfxpayload.patch | 39 ++++++++++++++++++ ...rub-2.14-r3.ebuild => grub-2.14-r5.ebuild} | 15 +++++-- .../sys-boot/grub/grub-9999.ebuild | 15 ++++--- 5 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/sys-boot/grub/files/grub-2.14-efi_uga.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-boot/grub/files/grub-2.14-gfxpayload.patch rename sdk_container/src/third_party/portage-stable/sys-boot/grub/{grub-2.14-r3.ebuild => grub-2.14-r5.ebuild} (96%) diff --git a/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/gfxpayload.patch b/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/gfxpayload.patch index 6c63ef88b0..59e4a45e49 100644 --- a/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/gfxpayload.patch +++ b/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/gfxpayload.patch @@ -1,3 +1,7 @@ +https://bugs.gentoo.org/528826 +http://lists.gnu.org/archive/html/grub-devel/2014-10/msg00031.html +https://gitlab.freedesktop.org/gnu-grub/grub/-/merge_requests/98 + From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Thu, 16 Oct 2014 23:43:51 -0400 diff --git a/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/grub-2.14-efi_uga.patch b/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/grub-2.14-efi_uga.patch new file mode 100644 index 0000000000..51819d0431 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-boot/grub/files/grub-2.14-efi_uga.patch @@ -0,0 +1,41 @@ +https://gitlab.freedesktop.org/gnu-grub/grub/-/merge_requests/10 + +From 129588e498647842c6f13f7809ef9ac583e2351b Mon Sep 17 00:00:00 2001 +From: Egor Ignatov +Date: Thu, 19 Mar 2026 17:22:11 +0500 +Subject: [PATCH] util/grub.d/00_header.in: Load efi_uga only on x86 EFI + platforms + +The efi_uga module is only built for i386-efi and x86_64-efi firmware), but +commit ea0b76dc4a ("Disable loading all_video for EFI") loads it unconditionally +on all EFI platforms. This causes a "file not found" error on aarch64-efi and +other non-x86 EFI targets. + +Guard the insmod with a $grub_cpu check so the module is only +loaded where it is actually available. + +Fixes: ea0b76dc4 ("util/grub.d/00_header.in: Disable loading all_video for EFI") + +Signed-off-by: Egor Ignatov +--- + util/grub.d/00_header.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in +index 77834cfaf..1afe41e67 100644 +--- a/util/grub.d/00_header.in ++++ b/util/grub.d/00_header.in +@@ -135,7 +135,9 @@ else # GRUB_FORCE_EFI_ALL_VIDEO is not set true + cat < +Date: Thu, 16 Oct 2014 23:43:51 -0400 +Subject: [PATCH] 10_linux: default gfxpayload=keep only when booting using EFI + +A given kernel may be compiled with CONFIG_FB_EFI, but may be booted in +legacy PC-BIOS mode. It is not safe to set gfxmode=keep under these +conditions, and this may result in a black screen once the kernel +starts. + +Signed-off-by: Mike Gilbert +Reviewed-by: Neal Gompa +Reviewed-by: Leo Sandoval +--- + util/grub.d/10_linux.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 1233b112b..737e1c30c 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -118,7 +118,9 @@ linux_entry () + echo " load_video" | sed "s/^/$submenu_indentation/" + if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \ + && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then +- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/" ++ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' fi' | sed "s/^/$submenu_indentation/" + fi + else + if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then +-- +GitLab + diff --git a/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r3.ebuild b/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r5.ebuild similarity index 96% rename from sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r3.ebuild rename to sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r5.ebuild index 8cbfee458c..dd354a614f 100644 --- a/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r3.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-2.14-r5.ebuild @@ -26,7 +26,7 @@ if [[ -n ${GRUB_AUTORECONF} ]]; then inherit autotools fi -inherit bash-completion-r1 eapi9-ver flag-o-matic multibuild optfeature +inherit bash-completion-r1 eapi9-pipestatus eapi9-ver flag-o-matic multibuild optfeature inherit python-any-r1 secureboot toolchain-funcs verify-sig DESCRIPTION="GNU GRUB boot loader" @@ -56,7 +56,7 @@ if [[ ${PV} != 9999 ]]; then sec-keys/openpgp-keys-unifont ) " - KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" + KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv ~sparc x86" else inherit git-r3 EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" @@ -175,8 +175,14 @@ src_unpack() { } src_prepare() { + # Bug 971544 + find grub-core/lib/gnulib -name '*.in.h' | sed 's/.in.h$/.h/' | xargs rm -fv + pipestatus || die + local PATCHES=( "${WORKDIR}/${P}-patches" + "${FILESDIR}/${P}-efi_uga.patch" + "${FILESDIR}/${P}-gfxpayload.patch" ) default @@ -302,7 +308,10 @@ src_configure() { src_compile() { # Sandbox bug 404013. - use libzfs && { addpredict /etc/dfs; addpredict /dev/zfs; } + if use libzfs; then + addpredict /etc/dfs + addpredict /dev/zfs + fi grub_do emake use doc && grub_do_once emake -C docs html diff --git a/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-9999.ebuild b/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-9999.ebuild index 1c175f9860..9e2f2153af 100644 --- a/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-boot/grub/grub-9999.ebuild @@ -32,10 +32,13 @@ inherit bash-completion-r1 eapi9-ver flag-o-matic multibuild optfeature inherit python-any-r1 secureboot toolchain-funcs verify-sig DESCRIPTION="GNU GRUB boot loader" -HOMEPAGE="https://www.gnu.org/software/grub/" +HOMEPAGE="https://gnu-grub.freedesktop.org/" MY_P=${P} -if [[ ${PV} != 9999 ]]; then +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.freedesktop.org/gnu-grub/grub.git" +else if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860 MY_P=${P/_/'~'} @@ -58,9 +61,6 @@ if [[ ${PV} != 9999 ]]; then ) " KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" -else - inherit git-r3 - EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" fi DEJAVU_VER=2.37 @@ -299,7 +299,10 @@ src_configure() { src_compile() { # Sandbox bug 404013. - use libzfs && { addpredict /etc/dfs; addpredict /dev/zfs; } + if use libzfs; then + addpredict /etc/dfs + addpredict /dev/zfs + fi grub_do emake use doc && grub_do_once emake -C docs html