commit: 1e1bce2e991a2d2ccc215b9802a6ba693a0145c0
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 13 18:46:59 2025 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Dec 13 18:47:45 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e1bce2e
sys-boot/grub: add 2.12-r8, 2.14_rc1-r2 with default-enabled Gentoo branding
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
.../grub/files/grub-2.14_rc1-gentootheme.patch | 37 +++++++++
.../grub/files/grub-2.14_rc1-themerecursive.patch | 45 +++++++++++
.../grub/{grub-9999.ebuild => grub-2.12-r8.ebuild} | 93 +++++++++++-----------
.../{grub-9999.ebuild => grub-2.14_rc1-r2.ebuild} | 32 +++++---
sys-boot/grub/grub-9999.ebuild | 11 ++-
5 files changed, 163 insertions(+), 55 deletions(-)
diff --git a/sys-boot/grub/files/grub-2.14_rc1-gentootheme.patch
b/sys-boot/grub/files/grub-2.14_rc1-gentootheme.patch
new file mode 100644
index 000000000000..10f5ffd0bcc7
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.14_rc1-gentootheme.patch
@@ -0,0 +1,37 @@
+From c28e65bbe31d47663c546077670888d4c44e042c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]>
+Date: Tue, 18 Nov 2025 20:26:59 +0100
+Subject: [PATCH] Install the themes starfield *and* gentoo_glass by default
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch is clearly Gentoo-specific.
+
+Signed-off-by: Andreas K. Hüttel <[email protected]>
+---
+ util/grub-install-common.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/util/grub-install-common.c b/util/grub-install-common.c
+index a913ee61c..7af7915fe 100644
+--- a/util/grub-install-common.c
++++ b/util/grub-install-common.c
+@@ -1082,10 +1082,11 @@ grub_install_copy_files (const char *src,
+ if (install_themes.is_default)
+ {
+ install_themes.is_default = 0;
+- install_themes.n_entries = 1;
+- install_themes.entries = xmalloc (2 * sizeof
(install_themes.entries[0]));
++ install_themes.n_entries = 2;
++ install_themes.entries = xmalloc (3 * sizeof
(install_themes.entries[0]));
+ install_themes.entries[0] = xstrdup ("starfield");
+- install_themes.entries[1] = NULL;
++ install_themes.entries[1] = xstrdup ("gentoo_glass");
++ install_themes.entries[2] = NULL;
+ }
+
+ if (grub_install_themes_directory)
+--
+2.51.0
+
diff --git a/sys-boot/grub/files/grub-2.14_rc1-themerecursive.patch
b/sys-boot/grub/files/grub-2.14_rc1-themerecursive.patch
new file mode 100644
index 000000000000..4d34363ba621
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.14_rc1-themerecursive.patch
@@ -0,0 +1,45 @@
+From c0a83f8ae0f4dfddf4ef360385d61fef2860f9e8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]>
+Date: Sat, 13 Dec 2025 19:15:58 +0100
+Subject: [PATCH] grub-install: Allow recursive copying of theme dirs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This should be upstreamed in some way.
+
+Signed-off-by: Andreas K. Hüttel <[email protected]>
+---
+ util/grub-install-common.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/util/grub-install-common.c b/util/grub-install-common.c
+index a913ee61c..c1c3c5704 100644
+--- a/util/grub-install-common.c
++++ b/util/grub-install-common.c
+@@ -803,13 +803,20 @@ copy_all (const char *srcd,
+ || strcmp (de->d_name, "..") == 0)
+ continue;
+ srcf = grub_util_path_concat (2, srcd, de->d_name);
+- if (grub_util_is_special_file (srcf)
+- || grub_util_is_directory (srcf))
++ if (grub_util_is_special_file (srcf))
+ {
+ free (srcf);
+ continue;
+ }
+ dstf = grub_util_path_concat (2, dstd, de->d_name);
++ if (grub_util_is_directory (srcf))
++ {
++ grub_install_mkdir_p (dstf);
++ copy_all (srcf, dstf);
++ free (srcf);
++ free (dstf);
++ continue;
++ }
+ grub_install_compress_file (srcf, dstf, 1);
+ free (srcf);
+ free (dstf);
+--
+2.51.2
+
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-2.12-r8.ebuild
similarity index 84%
copy from sys-boot/grub/grub-9999.ebuild
copy to sys-boot/grub/grub-2.12-r8.ebuild
index 308c002858b0..db623f82b32e 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-2.12-r8.ebuild
@@ -1,12 +1,12 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=8
+EAPI=7
# This ebuild uses 3 special global variables:
-# GRUB_BOOTSTRAP: Invoke bootstrap (gnulib)
-# GRUB_AUTOGEN: Invoke autogen.sh
-# GRUB_AUTORECONF: Inherit autotools and invoke eautoreconf
+# GRUB_BOOTSTRAP: Depend on python and invoke bootstrap (gnulib).
+# GRUB_AUTOGEN: Depend on python and invoke autogen.sh.
+# GRUB_AUTORECONF: Inherit autotools and invoke eautoreconf.
#
# When applying patches:
# If gnulib is updated, set GRUB_BOOTSTRAP=1
@@ -16,26 +16,26 @@ EAPI=8
# If any of the above applies to a user patch, the user should set the
# corresponding variable in make.conf or the environment.
-if [[ ${PV} == 9999 ]]; then
- GRUB_AUTORECONF=1
- GRUB_BOOTSTRAP=1
-fi
-
-PYTHON_COMPAT=( python3_{11..14} )
+GRUB_AUTOGEN=1
+GRUB_AUTORECONF=1
+PYTHON_COMPAT=( python3_{10..13} )
WANT_LIBTOOL=none
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/grub.asc
if [[ -n ${GRUB_AUTORECONF} ]]; then
inherit autotools
fi
inherit bash-completion-r1 eapi9-ver flag-o-matic multibuild optfeature
-inherit python-any-r1 secureboot toolchain-funcs verify-sig
+inherit python-any-r1 secureboot toolchain-funcs
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="https://www.gnu.org/software/grub/"
MY_P=${P}
if [[ ${PV} != 9999 ]]; then
+ inherit verify-sig
+
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/_/'~'}
@@ -47,37 +47,36 @@ if [[ ${PV} != 9999 ]]; then
else
SRC_URI="
mirror://gnu/${PN}/${P}.tar.xz
+
https://dev.gentoo.org/~floppym/dist/${P}-bash-completion.patch.gz
verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
"
S=${WORKDIR}/${P%_*}
fi
- BDEPEND="
- verify-sig? (
- sec-keys/openpgp-keys-grub
- sec-keys/openpgp-keys-unifont
- )
- "
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-grub )"
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
-DEJAVU=dejavu-fonts-ttf-${DEJAVU_VER}
-UNIFONT=unifont-17.0.02
-SRC_URI+="
- fonts? (
- mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz
- verify-sig? (
mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz.sig )
- )
- themes? (
https://downloads.sourceforge.net/project/dejavu/dejavu/${DEJAVU_VER}/${DEJAVU}.tar.bz2
)
-"
+PATCHES=(
+ "${FILESDIR}"/gfxpayload.patch
+ "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+ "${FILESDIR}"/grub-2.06-test-words.patch
+ "${FILESDIR}"/grub-2.12-fwsetup.patch
+ "${WORKDIR}"/grub-2.12-bash-completion.patch
+ "${FILESDIR}"/grub-2.12-zfs-zstd-compression-support.patch
+)
+
+DEJAVU=dejavu-sans-ttf-2.37
+UNIFONT=unifont-15.0.06
+SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
+ themes? ( https://downloads.sourceforge.net/dejavu/${DEJAVU}.zip )"
# Includes licenses for dejavu and unifont
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? (
CC-BY-SA-3.0 BitstreamVera )"
SLOT="2/${PVR}"
-IUSE="+device-mapper doc efiemu +fonts mount nls protect sdl test +themes
truetype libzfs"
+IUSE="+branding +device-mapper doc efiemu +fonts mount nls sdl test +themes
truetype libzfs"
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
@@ -111,6 +110,7 @@ BDEPEND+="
sys-fs/squashfs-tools
)
themes? (
+ app-arch/unzip
media-libs/freetype:2
virtual/pkgconfig
)
@@ -128,9 +128,9 @@ DEPEND="
truetype? ( media-libs/freetype:2= )
ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 )
- protect? ( dev-libs/libtasn1:= )
"
RDEPEND="${DEPEND}
+ branding? ( sys-boot/grub-themes-gentoo )
kernel_linux? (
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
@@ -158,15 +158,9 @@ src_unpack() {
local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo
"${GNULIB_REVISION}")
git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
git-r3_checkout "${GNULIB_URI}" gnulib
- sh linguas.sh || die
popd >/dev/null || die
elif use verify-sig; then
- verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig} \
- "${BROOT}"/usr/share/openpgp-keys/grub.asc
- fi
- if use fonts && use verify-sig; then
- verify-sig_verify_detached
"${DISTDIR}"/${UNIFONT}.pcf.gz{,.sig} \
- "${BROOT}"/usr/share/openpgp-keys/unifont.asc
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig}
fi
default
}
@@ -174,6 +168,10 @@ src_unpack() {
src_prepare() {
default
+ if use branding ; then
+ eapply "${FILESDIR}/${PN}-2.14_rc1-gentootheme.patch"
+ fi
+
python_setup
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
@@ -186,6 +184,10 @@ src_prepare() {
if [[ -n ${GRUB_AUTORECONF} ]]; then
eautoreconf
fi
+
+ # Avoid error due to extra_deps.lst missing from source tarball:
+ # make[3]: *** No rule to make target 'grub-core/extra_deps.lst',
needed by 'syminfo.lst'. Stop.
+ echo "depends bli part_gpt" > grub-core/extra_deps.lst || die
}
grub_do() {
@@ -227,7 +229,6 @@ grub_configure() {
$(use_enable device-mapper)
$(use_enable mount grub-mount)
$(use_enable nls)
- $(use_enable protect grub-protect)
$(use_enable themes grub-themes)
$(use_enable truetype grub-mkfont)
$(use_enable libzfs)
@@ -240,11 +241,11 @@ grub_configure() {
)
if use fonts; then
- cp "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
fi
if use themes; then
- cp "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf ||
die
+ ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf
|| die
fi
local ECONF_SOURCE="${S}"
@@ -373,6 +374,9 @@ src_install() {
insinto /etc/default
newins "${FILESDIR}"/grub.default-4 grub
+ if use branding && use themes ; then
+ sed -e
's:^#GRUB_THEME=.*$:GRUB_THEME="/boot/grub/themes/gentoo_glass/theme.txt":g' -i
"${D}/etc/default/grub" || die
+ fi
# https://bugs.gentoo.org/231935
dostrip -x /usr/lib/grub
@@ -406,17 +410,16 @@ pkg_postinst() {
ewarn
fi
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
if has_version sys-boot/os-prober; then
ewarn "Due to security concerns, os-prober is disabled by
default."
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to
enable it."
fi
- if grep -q GRUB_LINUX_KERNEL_GLOBS "${EROOT}"/etc/default/grub; then
- ewarn "Support for GRUB_LINUX_KERNEL_GLOBS has been dropped."
- ewarn "Ensure that your kernels are named appropriately or edit"
- ewarn "/etc/grub.d/10_linux to compensate."
- fi
-
if use secureboot; then
elog
elog "The signed standalone grub EFI executable(s) are
available in:"
diff --git a/sys-boot/grub/grub-9999.ebuild
b/sys-boot/grub/grub-2.14_rc1-r2.ebuild
similarity index 93%
copy from sys-boot/grub/grub-9999.ebuild
copy to sys-boot/grub/grub-2.14_rc1-r2.ebuild
index 308c002858b0..f454209ef839 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-2.14_rc1-r2.ebuild
@@ -16,8 +16,8 @@ EAPI=8
# If any of the above applies to a user patch, the user should set the
# corresponding variable in make.conf or the environment.
+GRUB_AUTORECONF=1
if [[ ${PV} == 9999 ]]; then
- GRUB_AUTORECONF=1
GRUB_BOOTSTRAP=1
fi
@@ -63,6 +63,13 @@ else
EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
fi
+PATCHES=(
+ "${FILESDIR}"/gfxpayload.patch
+ "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+ "${FILESDIR}"/grub-2.06-test-words.patch
+ "${FILESDIR}"/grub-2.14_rc1-configure.ac-avoid-bashisms.patch
+)
+
DEJAVU_VER=2.37
DEJAVU=dejavu-fonts-ttf-${DEJAVU_VER}
UNIFONT=unifont-17.0.02
@@ -77,7 +84,7 @@ SRC_URI+="
# Includes licenses for dejavu and unifont
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? (
CC-BY-SA-3.0 BitstreamVera )"
SLOT="2/${PVR}"
-IUSE="+device-mapper doc efiemu +fonts mount nls protect sdl test +themes
truetype libzfs"
+IUSE="+branding +device-mapper doc efiemu +fonts mount nls protect sdl test
+themes truetype libzfs"
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
@@ -131,6 +138,7 @@ DEPEND="
protect? ( dev-libs/libtasn1:= )
"
RDEPEND="${DEPEND}
+ branding? ( sys-boot/grub-themes-gentoo )
kernel_linux? (
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
@@ -158,7 +166,6 @@ src_unpack() {
local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo
"${GNULIB_REVISION}")
git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}"
git-r3_checkout "${GNULIB_URI}" gnulib
- sh linguas.sh || die
popd >/dev/null || die
elif use verify-sig; then
verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig} \
@@ -174,6 +181,11 @@ src_unpack() {
src_prepare() {
default
+ if use branding ; then
+ eapply "${FILESDIR}/${PN}-2.14_rc1-gentootheme.patch"
+ eapply "${FILESDIR}/${PN}-2.14_rc1-themerecursive.patch"
+ fi
+
python_setup
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
@@ -373,6 +385,9 @@ src_install() {
insinto /etc/default
newins "${FILESDIR}"/grub.default-4 grub
+ if use branding && use themes ; then
+ sed -e
's:^#GRUB_THEME=.*$:GRUB_THEME="/boot/grub/themes/gentoo_glass/theme.txt":g' -i
"${D}/etc/default/grub" || die
+ fi
# https://bugs.gentoo.org/231935
dostrip -x /usr/lib/grub
@@ -406,17 +421,16 @@ pkg_postinst() {
ewarn
fi
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
if has_version sys-boot/os-prober; then
ewarn "Due to security concerns, os-prober is disabled by
default."
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to
enable it."
fi
- if grep -q GRUB_LINUX_KERNEL_GLOBS "${EROOT}"/etc/default/grub; then
- ewarn "Support for GRUB_LINUX_KERNEL_GLOBS has been dropped."
- ewarn "Ensure that your kernels are named appropriately or edit"
- ewarn "/etc/grub.d/10_linux to compensate."
- fi
-
if use secureboot; then
elog
elog "The signed standalone grub EFI executable(s) are
available in:"
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index 308c002858b0..161ad8b199fb 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -77,7 +77,7 @@ SRC_URI+="
# Includes licenses for dejavu and unifont
LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? (
CC-BY-SA-3.0 BitstreamVera )"
SLOT="2/${PVR}"
-IUSE="+device-mapper doc efiemu +fonts mount nls protect sdl test +themes
truetype libzfs"
+IUSE="+branding +device-mapper doc efiemu +fonts mount nls protect sdl test
+themes truetype libzfs"
GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot
qemu qemu-mips pc uboot xen xen-32 xen-pvh )
@@ -131,6 +131,7 @@ DEPEND="
protect? ( dev-libs/libtasn1:= )
"
RDEPEND="${DEPEND}
+ branding? ( sys-boot/grub-themes-gentoo )
kernel_linux? (
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
@@ -174,6 +175,11 @@ src_unpack() {
src_prepare() {
default
+ if use branding ; then
+ eapply "${FILESDIR}/${PN}-2.14_rc1-gentootheme.patch"
+ eapply "${FILESDIR}/${PN}-2.14_rc1-themerecursive.patch"
+ fi
+
python_setup
if [[ -n ${GRUB_BOOTSTRAP} ]]; then
@@ -373,6 +379,9 @@ src_install() {
insinto /etc/default
newins "${FILESDIR}"/grub.default-4 grub
+ if use branding && use themes ; then
+ sed -e
's:^#GRUB_THEME=.*$:GRUB_THEME="/boot/grub/themes/gentoo_glass/theme.txt":g' -i
"${D}/etc/default/grub" || die
+ fi
# https://bugs.gentoo.org/231935
dostrip -x /usr/lib/grub