diff options
Diffstat (limited to 'sys-boot/grub')
19 files changed, 316 insertions, 1530 deletions
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index ce3bb74bbd86..03be6d621874 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -1,7 +1,5 @@ DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae -DIST grub-2.02.tar.xz 6113260 BLAKE2B 7c5ec61a8dc5a00e9cdc91c489f0d2ee37cd7e673eef8e8e26bbc18c5ec28829f563b9298874fb96d45a5d523ce366e936649c21ebda7462afda0cc328b970ce SHA512 cc6eb0a42b5c8df2f671cc128ff725afb3ff1f8832a196022e433cf0d3b75decfca2316d0aa5fabea75747d55e88f3d021dd93508563f8ca80fd7b9e7fe1f088 -DIST grub-2.04.tar.xz 6393864 BLAKE2B 413ffb9aaeae1ee3128032914ca426a1a5adb3737895dfe563fdde5a7e0386ac2dbc2f7ddfc4e0a67b3ad90494985d6886c20054b038701feb743e67e2eed9d0 SHA512 9c15c42d0cf5d61446b752194e3b628bb04be0fe6ea0240ab62b3d753784712744846e1f7c3651d8e0968d22012e6d713c38c44936d4004ded3ca4d4007babbb -DIST grub-2.04~rc1.tar.xz 6422420 BLAKE2B cf189fea32badba00051734d4e67954009bae016a6b8a366ce41a2ac8ddf8792e2b63262c0a80f1fa5771394ebc76b090f50eac1ccd9f81d594feb8cc15ab400 SHA512 c0bee6a7aced0408d7477fdb8b6fdd3ec48f80f0ecc4e7602d76f9a37081fe08e405faa030b4e4f181f45793641b13f398fe0bed121058ad8729f9a8908703d3 -DIST unifont-12.0.01.pcf.gz 1360857 BLAKE2B ab87e58aee2295e52dc49b7bb131793ad775abbf49f4b64758045a9b5158e75afd01a8425b56e6f6d0ba288a733bf426df363c1ecc78daddec516c33d461bc3b SHA512 9d34a005dd10f212e43075beb71eb39b9cc3403ae1cddec7d79af91b3a3a1beb4a3696075cc94563c8402efe2ad05de552ace77a24da09f1c0b7f95e99b056a3 -DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0 -DIST unifont-9.0.06.pcf.gz 1360354 BLAKE2B 09b96e1711c729ef159d62e3ea7b289ca2d01dc0ea417e35a18b73dc02a23f62ce7821d9761bceee4002d9eeaabd91cfb69bbacc6fbdfdfa00445d18fe8f1d66 SHA512 dd0a1afa72f5204c62055d83f22750c74af38ffafdb8eda8e1f1cf7292e572a14969b8a9a6a2cb336d5bed4ab633f6b5a962c59117a590e4238788959cb82774 +DIST grub-2.12-bash-completion.patch.gz 3627 BLAKE2B 6ba80fd4fb4b28ae2e5a2387133d815da126a4eaa4b5cb24b13f4ba5a2499ab4099d10ada366ed39f84be2c38774122f48e1a1894768c5bee29149528610d095 SHA512 a9ee6d2253ae48d7f90907a9e975a3a1d01346bc621d8b8cddf7cc815cd91e078f6c61392724d13556ee64f099fa15c94fcb88a49ff02d4a90ebd376252cea5c +DIST grub-2.12.tar.xz 6675608 BLAKE2B a678f7fafb945d325c8cf47aa086f48357a8f6335b762f77038c30a3896b3b05491598d9931d5335841d224fffcbe4a9a43ca1479057c1f1ce52b8d2a952c431 SHA512 761c060a4c3da9c0e810b0ea967e3ebc66baa4ddd682a503ae3d30a83707626bccaf49359304a16b3a26fc4435fe6bea1ee90be910c84de3c2b5485a31a15be3 +DIST grub-2.12.tar.xz.sig 566 BLAKE2B 9b77fe53041b99f1196743aa6d9fc9c727b17c6512129bab2b35005f2c70f371e30521ddd804bf0c666e36cf2667247980f385ca1ac911fa9b8e0311427dc01c SHA512 fbe971d8c382578b49d33902234edd9cbd084b70820a1a56a59df4ec30874c0dd4fe27f8dc44bb380716bb7480ca68a87d120a25b92a6a10ff6c8ec1b60548d3 +DIST unifont-15.0.06.pcf.gz 1358322 BLAKE2B 81811e3de390ca35d1a2dc1f1dee73464e97f44907ba522c218ba9c5e39ca3c9d767552780a257a97c156eb623c17786d9c0d2b67786d61df5ca33a1e10db7ca SHA512 0a28a406629c604f5cbf51f501528239a7ed50d19f93ea505bc5bdc72639e4b926b03f4b8782a5733041f7cdb4aebb9948ac7cfd5a8ad9a0fe309944e595517b diff --git a/sys-boot/grub/files/2.02-X86_64_PLT32.patch b/sys-boot/grub/files/2.02-X86_64_PLT32.patch deleted file mode 100644 index 2c65cb78a5d5..000000000000 --- a/sys-boot/grub/files/2.02-X86_64_PLT32.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 02702bdfe14d8a04643a45b03715f734ae34dbac Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" <hjl.tools@gmail.com> -Date: Sat, 17 Feb 2018 06:47:28 -0800 -Subject: x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 - -Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: - -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a - -x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for -32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as -R_X86_64_PC32. - -Signed-off-by: H.J. Lu <hjl.tools@gmail.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> - -Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=842c390469e2c2e10b5aa36700324cd3bde25875 -Last-Update: 2018-07-30 - -Patch-Name: R_X86_64_PLT32.patch ---- - grub-core/efiemu/i386/loadcore64.c | 1 + - grub-core/kern/x86_64/dl.c | 1 + - util/grub-mkimagexx.c | 1 + - util/grub-module-verifier.c | 1 + - 4 files changed, 4 insertions(+) - -diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c -index e49d0b6ff..18facf47f 100644 ---- a/grub-core/efiemu/i386/loadcore64.c -+++ b/grub-core/efiemu/i386/loadcore64.c -@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - err = grub_efiemu_write_value (addr, - *addr32 + rel->r_addend - + sym.off -diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c -index 440690673..3a73e6e6c 100644 ---- a/grub-core/kern/x86_64/dl.c -+++ b/grub-core/kern/x86_64/dl.c -@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_int64_t value; - value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - -diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index e63f148e4..f20255a28 100644 ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -832,6 +832,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index 9179285a5..a79271f66 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { - -1 - }, (int[]){ - R_X86_64_PC32, -+ R_X86_64_PLT32, - -1 - } - }, diff --git a/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch b/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch deleted file mode 100644 index f20845d5a34b..000000000000 --- a/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 446794de8da4329ea532cbee4ca877bcafd0e534 Mon Sep 17 00:00:00 2001 -From: "David E. Box" <david.e.box@linux.intel.com> -Date: Fri, 15 Sep 2017 15:37:05 -0700 -Subject: [PATCH] tsc: Change default tsc calibration method to pmtimer on EFI - systems - -On efi systems, make pmtimer based tsc calibration the default over the -pit. This prevents Grub from hanging on Intel SoC systems that power gate -the pit. - -Signed-off-by: David E. Box <david.e.box@linux.intel.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/kern/i386/tsc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c -index 2e85289d8..f266eb131 100644 ---- a/grub-core/kern/i386/tsc.c -+++ b/grub-core/kern/i386/tsc.c -@@ -68,7 +68,7 @@ grub_tsc_init (void) - #ifdef GRUB_MACHINE_XEN - (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); - #elif defined (GRUB_MACHINE_EFI) -- (void) (grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); -+ (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); - #elif defined (GRUB_MACHINE_COREBOOT) - (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); - #else --- -2.22.0 - diff --git a/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch b/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch deleted file mode 100644 index 9aa7f54f32ab..000000000000 --- a/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch +++ /dev/null @@ -1,126 +0,0 @@ -From ba84c8d1b4830e9fcb14d9f0e4a36e03ac40a09d Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@ubuntu.com> -Date: Tue, 30 Jan 2018 14:08:26 +0000 -Subject: build: Capitalise *freetype_* variables - -Using FREETYPE_CFLAGS and FREETYPE_LIBS is more in line with the naming -scheme used by pkg-config macros. - -Bug-Debian: https://bugs.debian.org/887721 -Last-Update: 2018-02-11 - -Patch-Name: freetype-capitalise-variables.patch ---- - Makefile.am | 6 +++--- - Makefile.util.def | 4 ++-- - configure.ac | 24 ++++++++++++------------ - 3 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index f0ab1adc3..b47b4b1ac 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -71,7 +71,7 @@ endif - starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 - - build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS) - CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT) - - garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c -@@ -80,11 +80,11 @@ CLEANFILES += garbage-gen$(BUILD_EXEEXT) - EXTRA_DIST += util/garbage-gen.c - - build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS) -Wall -Werror - CLEANFILES += build-grub-gen-asciih$(BUILD_EXEEXT) - - build-grub-gen-widthspec$(BUILD_EXEEXT): util/grub-gen-widthspec.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(BUILD_FREETYPE_CFLAGS) $(BUILD_FREETYPE_LIBS) -Wall -Werror - CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) - - if COND_STARFIELD -diff --git a/Makefile.util.def b/Makefile.util.def -index 168acbe59..fa39d8bd1 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -302,14 +302,14 @@ program = { - common = grub-core/kern/emu/argp_common.c; - common = grub-core/osdep/init.c; - -- cflags = '$(freetype_cflags)'; -+ cflags = '$(FREETYPE_CFLAGS)'; - cppflags = '-DGRUB_MKFONT=1'; - - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; - ldadd = grub-core/gnulib/libgnu.a; -- ldadd = '$(freetype_libs)'; -+ ldadd = '$(FREETYPE_LIBS)'; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - condition = COND_GRUB_MKFONT; - }; -diff --git a/configure.ac b/configure.ac -index cd1f49837..85c23bd62 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1505,12 +1505,12 @@ unset ac_cv_header_ft2build_h - - if test x"$grub_mkfont_excuse" = x ; then - # Check for freetype libraries. -- freetype_cflags=`$FREETYPE --cflags` -- freetype_libs=`$FREETYPE --libs` -+ FREETYPE_CFLAGS=`$FREETYPE --cflags` -+ FREETYPE_LIBS=`$FREETYPE --libs` - SAVED_CPPFLAGS="$CPPFLAGS" - SAVED_LIBS="$LIBS" -- CPPFLAGS="$CPPFLAGS $freetype_cflags" -- LIBS="$LIBS $freetype_libs" -+ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -+ LIBS="$LIBS $FREETYPE_LIBS" - AC_CHECK_HEADERS([ft2build.h], [], - [grub_mkfont_excuse=["need freetype2 headers"]]) - AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]]) -@@ -1527,8 +1527,8 @@ else - enable_grub_mkfont=no - fi - AC_SUBST([enable_grub_mkfont]) --AC_SUBST([freetype_cflags]) --AC_SUBST([freetype_libs]) -+AC_SUBST([FREETYPE_CFLAGS]) -+AC_SUBST([FREETYPE_LIBS]) - - SAVED_CC="$CC" - SAVED_CPP="$CPP" -@@ -1566,12 +1566,12 @@ fi - - if test x"$grub_build_mkfont_excuse" = x ; then - # Check for freetype libraries. -- build_freetype_cflags=`$BUILD_FREETYPE --cflags` -- build_freetype_libs=`$BUILD_FREETYPE --libs` -+ BUILD_FREETYPE_CFLAGS=`$BUILD_FREETYPE --cflags` -+ BUILD_FREETYPE_LIBS=`$BUILD_FREETYPE --libs` - SAVED_CPPFLAGS_2="$CPPFLAGS" - SAVED_LIBS="$LIBS" -- CPPFLAGS="$CPPFLAGS $build_freetype_cflags" -- LIBS="$LIBS $build_freetype_libs" -+ CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS" -+ LIBS="$LIBS $BUILD_FREETYPE_LIBS" - AC_CHECK_HEADERS([ft2build.h], [], - [grub_build_mkfont_excuse=["need freetype2 headers"]]) - AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]]) -@@ -1595,8 +1595,8 @@ if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || tes - fi - fi - --AC_SUBST([build_freetype_cflags]) --AC_SUBST([build_freetype_libs]) -+AC_SUBST([BUILD_FREETYPE_CFLAGS]) -+AC_SUBST([BUILD_FREETYPE_LIBS]) - - CC="$SAVED_CC" - CPP="$SAVED_CPP" diff --git a/sys-boot/grub/files/2.02-freetype-pkg-config.patch b/sys-boot/grub/files/2.02-freetype-pkg-config.patch deleted file mode 100644 index 94437f073c4f..000000000000 --- a/sys-boot/grub/files/2.02-freetype-pkg-config.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 3eec911197081a63d9dae28f1784ad01a06fb60a Mon Sep 17 00:00:00 2001 -From: Colin Watson <cjwatson@ubuntu.com> -Date: Tue, 30 Jan 2018 21:54:17 +0000 -Subject: build: Use pkg-config to find FreeType - -pkg-config is apparently preferred over freetype-config these days (see -the BUGS section of freetype-config(1)). pkg-config support was added -to FreeType in version 2.1.5, which was released in 2003, so it should -comfortably be available everywhere by now. - -We no longer need to explicitly substitute FREETYPE_CFLAGS and -FREETYPE_LIBS, since PKG_CHECK_MODULES does that automatically. - -Fixes Debian bug #887721. - -Reported-by: Hugh McMaster <hugh.mcmaster@outlook.com> -Signed-off-by: Colin Watson <cjwatson@ubuntu.com> - -Bug-Debian: https://bugs.debian.org/887721 -Last-Update: 2018-02-11 - -Patch-Name: freetype-pkg-config.patch ---- - INSTALL | 11 +++++---- - configure.ac | 74 +++++++++++++++++++++++++----------------------------------- - 2 files changed, 37 insertions(+), 48 deletions(-) - -diff --git a/INSTALL b/INSTALL -index f3c20edc8..b370d7753 100644 ---- a/INSTALL -+++ b/INSTALL -@@ -37,6 +37,7 @@ configuring the GRUB. - * GNU gettext 0.17 or later - * GNU binutils 2.9.1.0.23 or later - * Flex 2.5.35 or later -+* pkg-config - * Other standard GNU/Unix tools - * a libc with large file support (e.g. glibc 2.1 or later) - -@@ -52,7 +53,7 @@ For optional grub-emu features, you need: - - To build GRUB's graphical terminal (gfxterm), you need: - --* FreeType 2 or later -+* FreeType 2.1.5 or later - * GNU Unifont - - If you use a development snapshot or want to hack on GRUB you may -@@ -158,8 +159,8 @@ For this example the configure line might look like (more details below) - (some options are optional and included here for completeness but some rarely - used options are omitted): - --./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu --CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config -+./configure BUILD_CC=gcc BUILD_PKG_CONFIG=pkg-config --host=amd64-linux-gnu -+CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" PKG_CONFIG=amd64-linux-gnu-pkg-config - --target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc - TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6" - TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip" -@@ -176,7 +177,7 @@ corresponding platform are not needed for the platform in question. - 2. BUILD_CFLAGS= for C options for build. - 3. BUILD_CPPFLAGS= for C preprocessor options for build. - 4. BUILD_LDFLAGS= for linker options for build. -- 5. BUILD_FREETYPE= for freetype-config for build (optional). -+ 5. BUILD_PKG_CONFIG= for pkg-config for build (optional). - - - For host - 1. --host= to autoconf name of host. -@@ -184,7 +185,7 @@ corresponding platform are not needed for the platform in question. - 3. HOST_CFLAGS= for C options for host. - 4. HOST_CPPFLAGS= for C preprocessor options for host. - 5. HOST_LDFLAGS= for linker options for host. -- 6. FREETYPE= for freetype-config for host (optional). -+ 6. PKG_CONFIG= for pkg-config for host (optional). - 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional). - 8. Libfuse if any must be in standard linker folders (-lfuse) (optional). - 9. Libzfs if any must be in standard linker folders (-lzfs) (optional). -diff --git a/configure.ac b/configure.ac -index 85c23bd62..f102b7024 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -50,6 +50,10 @@ AC_PREREQ(2.60) - AC_CONFIG_SRCDIR([include/grub/dl.h]) - AC_CONFIG_HEADER([config-util.h]) - -+# Explicitly check for pkg-config early on, since otherwise conditional -+# calls are problematic. -+PKG_PROG_PKG_CONFIG -+ - # Program name transformations - AC_ARG_PROGRAM - grub_TRANSFORM([grub-bios-setup]) -@@ -1493,29 +1497,22 @@ if test x"$enable_grub_mkfont" = xno ; then - grub_mkfont_excuse="explicitly disabled" - fi - --if test x"$grub_mkfont_excuse" = x ; then -- # Check for freetype libraries. -- AC_CHECK_TOOLS([FREETYPE], [freetype-config]) -- if test "x$FREETYPE" = x ; then -- grub_mkfont_excuse=["need freetype2 library"] -- fi --fi -- - unset ac_cv_header_ft2build_h - - if test x"$grub_mkfont_excuse" = x ; then - # Check for freetype libraries. -- FREETYPE_CFLAGS=`$FREETYPE --cflags` -- FREETYPE_LIBS=`$FREETYPE --libs` -- SAVED_CPPFLAGS="$CPPFLAGS" -- SAVED_LIBS="$LIBS" -- CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -- LIBS="$LIBS $FREETYPE_LIBS" -- AC_CHECK_HEADERS([ft2build.h], [], -- [grub_mkfont_excuse=["need freetype2 headers"]]) -- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_mkfont_excuse=["freetype2 library unusable"]]) -- CPPFLAGS="$SAVED_CPPFLAGS" -- LIBS="$SAVED_LIBS" -+ PKG_CHECK_MODULES([FREETYPE], [freetype2], [ -+ SAVED_CPPFLAGS="$CPPFLAGS" -+ SAVED_LIBS="$LIBS" -+ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" -+ LIBS="$LIBS $FREETYPE_LIBS" -+ AC_CHECK_HEADERS([ft2build.h], [], -+ [grub_mkfont_excuse=["need freetype2 headers"]]) -+ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], -+ [grub_mkfont_excuse=["freetype2 library unusable"]]) -+ CPPFLAGS="$SAVED_CPPFLAGS" -+ LIBS="$SAVED_LIBS" -+ ], [grub_mkfont_excuse=["need freetype2 library"]]) - fi - - if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then -@@ -1527,8 +1524,6 @@ else - enable_grub_mkfont=no - fi - AC_SUBST([enable_grub_mkfont]) --AC_SUBST([FREETYPE_CFLAGS]) --AC_SUBST([FREETYPE_LIBS]) - - SAVED_CC="$CC" - SAVED_CPP="$CPP" -@@ -1558,25 +1553,21 @@ AC_SUBST([BUILD_WORDS_BIGENDIAN]) - - if test x"$grub_build_mkfont_excuse" = x ; then - # Check for freetype libraries. -- AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config]) -- if test "x$BUILD_FREETYPE" = x ; then -- grub_build_mkfont_excuse=["need freetype2 library"] -- fi --fi -- --if test x"$grub_build_mkfont_excuse" = x ; then -- # Check for freetype libraries. -- BUILD_FREETYPE_CFLAGS=`$BUILD_FREETYPE --cflags` -- BUILD_FREETYPE_LIBS=`$BUILD_FREETYPE --libs` -- SAVED_CPPFLAGS_2="$CPPFLAGS" -- SAVED_LIBS="$LIBS" -- CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS" -- LIBS="$LIBS $BUILD_FREETYPE_LIBS" -- AC_CHECK_HEADERS([ft2build.h], [], -- [grub_build_mkfont_excuse=["need freetype2 headers"]]) -- AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], [grub_build_mkfont_excuse=["freetype2 library unusable"]]) -- LIBS="$SAVED_LIBS" -- CPPFLAGS="$SAVED_CPPFLAGS_2" -+ SAVED_PKG_CONFIG="$PKG_CONFIG" -+ test -z "$BUILD_PKG_CONFIG" || PKG_CONFIG="$BUILD_PKG_CONFIG" -+ PKG_CHECK_MODULES([BUILD_FREETYPE], [freetype2], [ -+ SAVED_CPPFLAGS_2="$CPPFLAGS" -+ SAVED_LIBS="$LIBS" -+ CPPFLAGS="$CPPFLAGS $BUILD_FREETYPE_CFLAGS" -+ LIBS="$LIBS $BUILD_FREETYPE_LIBS" -+ AC_CHECK_HEADERS([ft2build.h], [], -+ [grub_build_mkfont_excuse=["need freetype2 headers"]]) -+ AC_LINK_IFELSE([AC_LANG_CALL([], [FT_Load_Glyph])], [], -+ [grub_build_mkfont_excuse=["freetype2 library unusable"]]) -+ LIBS="$SAVED_LIBS" -+ CPPFLAGS="$SAVED_CPPFLAGS_2" -+ ], [grub_build_mkfont_excuse=["need freetype2 library"]]) -+ PKG_CONFIG="$SAVED_PKG_CONFIG" - fi - - if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then -@@ -1595,9 +1586,6 @@ if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || tes - fi - fi - --AC_SUBST([BUILD_FREETYPE_CFLAGS]) --AC_SUBST([BUILD_FREETYPE_LIBS]) -- - CC="$SAVED_CC" - CPP="$SAVED_CPP" - CFLAGS="$SAVED_CFLAGS" diff --git a/sys-boot/grub/files/2.02-gcc8.patch b/sys-boot/grub/files/2.02-gcc8.patch deleted file mode 100644 index 51ee7dc86c25..000000000000 --- a/sys-boot/grub/files/2.02-gcc8.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 -From: Michael Chang <mchang@suse.com> -Date: Mon, 26 Mar 2018 16:52:34 +0800 -Subject: Fix packed-not-aligned error on GCC 8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When building with GCC 8, there are several errors regarding packed-not-aligned. - -./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] - -This patch fixes the build error by cleaning up the ambiguity of placing -aligned structure in a packed one. In "struct grub_btrfs_time" and "struct -grub_gpt_part_type", the aligned attribute seems to be superfluous, and also -has to be packed, to ensure the structure is bit-to-bit mapped to the format -laid on disk. I think we could blame to copy and paste error here for the -mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as -the name suggests. :) - -Signed-off-by: Michael Chang <mchang@suse.com> -Tested-by: Michael Chang <mchang@suse.com> -Tested-by: Paul Menzel <paulepanter@users.sourceforge.net> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/fs/btrfs.c | 2 +- - include/grub/efiemu/runtime.h | 2 +- - include/grub/gpt_partition.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4849c1c..be19544 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -175,7 +175,7 @@ struct grub_btrfs_time - { - grub_int64_t sec; - grub_uint32_t nanosec; --} __attribute__ ((aligned (4))); -+} GRUB_PACKED; - - struct grub_btrfs_inode - { -diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h -index 9b6b729..36d2ded 100644 ---- a/include/grub/efiemu/runtime.h -+++ b/include/grub/efiemu/runtime.h -@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel - - struct efi_variable - { -- grub_efi_guid_t guid; -+ grub_efi_packed_guid_t guid; - grub_uint32_t namelen; - grub_uint32_t size; - grub_efi_uint32_t attributes; -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f67..9668a68 100644 ---- a/include/grub/gpt_partition.h -+++ b/include/grub/gpt_partition.h -@@ -28,7 +28,7 @@ struct grub_gpt_part_type - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; --} __attribute__ ((aligned(8))); -+} GRUB_PACKED; - typedef struct grub_gpt_part_type grub_gpt_part_type_t; - - #define GRUB_GPT_PARTITION_TYPE_EMPTY \ --- -cgit v1.0-41-gc330 - diff --git a/sys-boot/grub/files/2.02-multiple-early-initrd.patch b/sys-boot/grub/files/2.02-multiple-early-initrd.patch deleted file mode 100644 index 74b576f8b007..000000000000 --- a/sys-boot/grub/files/2.02-multiple-early-initrd.patch +++ /dev/null @@ -1,177 +0,0 @@ -From a698240df0c43278b2d1d7259c8e7a6926c63112 Mon Sep 17 00:00:00 2001 -From: "Matthew S. Turnbull" <sparky@bluefang-logic.com> -Date: Sat, 24 Feb 2018 17:44:58 -0500 -Subject: grub-mkconfig/10_linux: Support multiple early initrd images - -Add support for multiple, shared, early initrd images. These early -images will be loaded in the order declared, and all will be loaded -before the initrd image. - -While many classes of data can be provided by early images, the -immediate use case would be for distributions to provide CPU -microcode to mitigate the Meltdown and Spectre vulnerabilities. - -There are two environment variables provided for declaring the early -images. - -* GRUB_EARLY_INITRD_LINUX_STOCK is for the distribution declare - images that are provided by the distribution or installed packages. - If undeclared, this will default to a set of common microcode image - names. - -* GRUB_EARLY_INITRD_LINUX_CUSTOM is for user created images. User - images will be loaded after the stock images. - -These separate configurations allow the distribution and user to -declare different image sets without clobbering each other. - -This also makes a minor update to ensure that UUID partition labels -stay disabled when no initrd image is found, even if early images are -present. - -This is a continuation of a previous patch published by Christian -Hesse in 2016: -http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00025.html - -Down stream Gentoo bug: -https://bugs.gentoo.org/645088 - -Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> -Signed-off-by: Matthew S. Turnbull <sparky@bluefang-logic.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - docs/grub.texi | 19 +++++++++++++++++++ - util/grub-mkconfig.in | 8 ++++++++ - util/grub.d/10_linux.in | 33 +++++++++++++++++++++++++++------ - 3 files changed, 54 insertions(+), 6 deletions(-) - -diff --git a/docs/grub.texi b/docs/grub.texi -index 137b894..65b4bbe 100644 ---- a/docs/grub.texi -+++ b/docs/grub.texi -@@ -1398,6 +1398,25 @@ for all respectively normal entries. - The values of these options replace the values of @samp{GRUB_CMDLINE_LINUX} - and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. - -+@item GRUB_EARLY_INITRD_LINUX_CUSTOM -+@itemx GRUB_EARLY_INITRD_LINUX_STOCK -+List of space-separated early initrd images to be loaded from @samp{/boot}. -+This is for loading things like CPU microcode, firmware, ACPI tables, crypto -+keys, and so on. These early images will be loaded in the order declared, -+and all will be loaded before the actual functional initrd image. -+ -+@samp{GRUB_EARLY_INITRD_LINUX_STOCK} is for your distribution to declare -+images that are provided by the distribution. It should not be modified -+without understanding the consequences. They will be loaded first. -+ -+@samp{GRUB_EARLY_INITRD_LINUX_CUSTOM} is for your custom created images. -+ -+The default stock images are as follows, though they may be overridden by -+your distribution: -+@example -+intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio -+@end example -+ - @item GRUB_DISABLE_LINUX_UUID - Normally, @command{grub-mkconfig} will generate menu entries that use - universally-unique identifiers (UUIDs) to identify the root filesystem to -diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index f8496d2..35ef583 100644 ---- a/util/grub-mkconfig.in -+++ b/util/grub-mkconfig.in -@@ -147,6 +147,12 @@ if [ x"$GRUB_FS" = xunknown ]; then - GRUB_FS="$(stat -f --printf=%T / || echo unknown)" - fi - -+# Provide a default set of stock linux early initrd images. -+# Define here so the list can be modified in the sourced config file. -+if [ "x${GRUB_EARLY_INITRD_LINUX_STOCK}" = "x" ]; then -+ GRUB_EARLY_INITRD_LINUX_STOCK="intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio" -+fi -+ - if test -f ${sysconfdir}/default/grub ; then - . ${sysconfdir}/default/grub - fi -@@ -211,6 +217,8 @@ export GRUB_DEFAULT \ - GRUB_CMDLINE_NETBSD \ - GRUB_CMDLINE_NETBSD_DEFAULT \ - GRUB_CMDLINE_GNUMACH \ -+ GRUB_EARLY_INITRD_LINUX_CUSTOM \ -+ GRUB_EARLY_INITRD_LINUX_STOCK \ - GRUB_TERMINAL_INPUT \ - GRUB_TERMINAL_OUTPUT \ - GRUB_SERIAL_COMMAND \ -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index de9044c..faedf74 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -136,9 +136,13 @@ EOF - if test -n "${initrd}" ; then - # TRANSLATORS: ramdisk isn't identifier. Should be translated. - message="$(gettext_printf "Loading initial ramdisk ...")" -+ initrd_path= -+ for i in ${initrd}; do -+ initrd_path="${initrd_path} ${rel_dirname}/${i}" -+ done - sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' -- initrd ${rel_dirname}/${initrd} -+ initrd $(echo $initrd_path) - EOF - fi - sed "s/^/$submenu_indentation/" << EOF -@@ -188,7 +192,15 @@ while [ "x$list" != "x" ] ; do - alt_version=`echo $version | sed -e "s,\.old$,,g"` - linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" - -- initrd= -+ initrd_early= -+ for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \ -+ ${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do -+ if test -e "${dirname}/${i}" ; then -+ initrd_early="${initrd_early} ${i}" -+ fi -+ done -+ -+ initrd_real= - for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ - "initrd-${version}" "initramfs-${version}.img" \ - "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ -@@ -198,11 +210,22 @@ while [ "x$list" != "x" ] ; do - "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ - "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do - if test -e "${dirname}/${i}" ; then -- initrd="$i" -+ initrd_real="${i}" - break - fi - done - -+ initrd= -+ if test -n "${initrd_early}" || test -n "${initrd_real}"; then -+ initrd="${initrd_early} ${initrd_real}" -+ -+ initrd_display= -+ for i in ${initrd}; do -+ initrd_display="${initrd_display} ${dirname}/${i}" -+ done -+ gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2 -+ fi -+ - config= - for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do - if test -e "${i}" ; then -@@ -216,9 +239,7 @@ while [ "x$list" != "x" ] ; do - initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"` - fi - -- if test -n "${initrd}" ; then -- gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 -- elif test -z "${initramfs}" ; then -+ if test -z "${initramfs}" && test -z "${initrd_real}" ; then - # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's - # no initrd or builtin initramfs, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} --- -cgit v1.0-41-gc330 - diff --git a/sys-boot/grub/files/2.02-xfs-sparse-inodes.patch b/sys-boot/grub/files/2.02-xfs-sparse-inodes.patch deleted file mode 100644 index 6c6a750b42f0..000000000000 --- a/sys-boot/grub/files/2.02-xfs-sparse-inodes.patch +++ /dev/null @@ -1,60 +0,0 @@ -From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001 -From: Daniel Kiper <daniel.kiper@oracle.com> -Date: Tue, 29 May 2018 16:16:02 +0200 -Subject: xfs: Accept filesystem with sparse inodes - -The sparse inode metadata format became a mkfs.xfs default in -xfsprogs-4.16.0, and such filesystems are now rejected by grub as -containing an incompatible feature. - -In essence, this feature allows xfs to allocate inodes into fragmented -freespace. (Without this feature, if xfs could not allocate contiguous -space for 64 new inodes, inode creation would fail.) - -In practice, the disk format change is restricted to the inode btree, -which as far as I can tell is not used by grub. If all you're doing -today is parsing a directory, reading an inode number, and converting -that inode number to a disk location, then ignoring this feature -should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED - -I did some brief testing of this patch by hacking up the regression -tests to completely fragment freespace on the test xfs filesystem, and -then write a large-ish number of inodes to consume any existing -contiguous 64-inode chunk. This way any files the grub tests add and -traverse would be in such a fragmented inode allocation. Tests passed, -but I'm not sure how to cleanly integrate that into the test harness. - -Signed-off-by: Eric Sandeen <sandeen@redhat.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> -Tested-by: Chris Murphy <lists@colorremedies.com> ---- - grub-core/fs/xfs.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index c6031bd..3b00c74 100644 ---- a/grub-core/fs/xfs.c -+++ b/grub-core/fs/xfs.c -@@ -79,9 +79,18 @@ GRUB_MOD_LICENSE ("GPLv3+"); - #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ - #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ - --/* We do not currently verify metadata UUID so it is safe to read such filesystem */ -+/* -+ * Directory entries with ftype are explicitly handled by GRUB code. -+ * -+ * We do not currently read the inode btrees, so it is safe to read filesystems -+ * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature. -+ * -+ * We do not currently verify metadata UUID, so it is safe to read filesystems -+ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature. -+ */ - #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ - (XFS_SB_FEAT_INCOMPAT_FTYPE | \ -+ XFS_SB_FEAT_INCOMPAT_SPINODES | \ - XFS_SB_FEAT_INCOMPAT_META_UUID) - - struct grub_xfs_sblock --- -cgit v1.0-41-gc330 - diff --git a/sys-boot/grub/files/2.04-sparc64-bios-boot.patch b/sys-boot/grub/files/2.04-sparc64-bios-boot.patch deleted file mode 100644 index 8fd00d497ad8..000000000000 --- a/sys-boot/grub/files/2.04-sparc64-bios-boot.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 4e75b2ae313b13b5bfb54cc5e5c53368d6eb2a08 Mon Sep 17 00:00:00 2001 -From: James Clarke <jrtc27@jrtc27.com> -Date: Thu, 18 Jul 2019 14:31:55 +0200 -Subject: [PATCH] sparc64: Fix BIOS Boot Partition support - -Currently, gpt_offset is uninitialised when using a BIOS Boot Partition -but is used unconditionally inside save_blocklists. Instead, ensure it -is always initialised to 0 (note that there is already separate code to -do the equivalent adjustment after we call save_blocklists on this code -path). - -This patch has been tested on a T5-2 LDOM. - -Signed-off-by: James Clarke <jrtc27@jrtc27.com> -Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> -Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com> -Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com> - ---- - util/setup.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) ---- - util/setup.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/util/setup.c b/util/setup.c -index 6f88f3c..3be88aa 100644 ---- a/util/setup.c -+++ b/util/setup.c -@@ -271,6 +271,9 @@ SETUP (const char *dir, - bl.current_segment = - GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4); - #endif -+#ifdef GRUB_SETUP_SPARC64 -+ bl.gpt_offset = 0; -+#endif - bl.last_length = 0; - - /* Read the boot image by the OS service. */ -@@ -730,7 +733,6 @@ unable_to_embed: - #ifdef GRUB_SETUP_SPARC64 - { - grub_partition_t container = root_dev->disk->partition; -- bl.gpt_offset = 0; - - if (grub_strstr (container->partmap->name, "gpt")) - bl.gpt_offset = grub_partition_get_start (container); --- -cgit v1.0-41-gc330 - diff --git a/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch index c66ee68dc8de..0d2b96d76c11 100644 --- a/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch +++ b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch @@ -62,6 +62,13 @@ index 859b608..e5ac11d 100644 case "$machine" in i?86) GENKERNEL_ARCH="x86" ;; --- -2.3.0 - +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -252,6 +252,7 @@ + GRUB_BADRAM \ + GRUB_OS_PROBER_SKIP_LIST \ + GRUB_DISABLE_SUBMENU ++export GRUB_LINUX_KERNEL_GLOBS + + if test "x${grub_cfg}" != "x"; then + rm -f "${grub_cfg}.new" diff --git a/sys-boot/grub/files/grub-2.06-test-words.patch b/sys-boot/grub/files/grub-2.06-test-words.patch new file mode 100644 index 000000000000..a3fe0602d2b4 --- /dev/null +++ b/sys-boot/grub/files/grub-2.06-test-words.patch @@ -0,0 +1,25 @@ +From 0f5080a2f3c952e2ee00bd271f42c56bb955dc19 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Sun, 14 Mar 2021 12:44:52 -0400 +Subject: [PATCH] Use /usr/share/dict/words as a 'compressible' file + +--- + tests/util/grub-fs-tester.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in +index bfc425e1f..efd2977b0 100644 +--- a/tests/util/grub-fs-tester.in ++++ b/tests/util/grub-fs-tester.in +@@ -265,7 +265,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do + MASTER="${tempdir}/master" + FSLABEL="grub_;/testé莭莽茝😁киритi urewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurerejiremvreijnvcreivire nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfew" + CFILESRC= +- for cand in /usr/share/dict/american-english /usr/share/dict/linux.words /data/data/com.termux/files/usr/share/hunspell/en_US.dic; do ++ for cand in /usr/share/dict/words; do + if test -f "$cand" ; then + CFILESRC="$cand" + break +-- +2.31.0.rc1 + diff --git a/sys-boot/grub/files/grub-2.12-fwsetup.patch b/sys-boot/grub/files/grub-2.12-fwsetup.patch new file mode 100644 index 000000000000..d328d3f110ae --- /dev/null +++ b/sys-boot/grub/files/grub-2.12-fwsetup.patch @@ -0,0 +1,38 @@ +From 6e0b2277eba062bf7950536cd27f9789c545d20f Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 11 Apr 2024 15:33:45 -0400 +Subject: [PATCH] grub.d: avoid calling fwsetup unconditionally + +This causes grub to enter the firmware setup on boot when using a +grub core that does not support the 'fwsetup --is-supported' option. + +Upstream has rejected attempts to resolve this, so we will carry this as +a distro patch for a bit. + +Bug: https://bugs.gentoo.org/925370 +--- + util/grub.d/30_uefi-firmware.in | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in +index 1c2365ddb..b6041b55e 100644 +--- a/util/grub.d/30_uefi-firmware.in ++++ b/util/grub.d/30_uefi-firmware.in +@@ -32,11 +32,8 @@ gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 + + cat << EOF + if [ "\$grub_platform" = "efi" ]; then +- fwsetup --is-supported +- if [ "\$?" = 0 ]; then +- menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { +- fwsetup +- } +- fi ++ menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { ++ fwsetup ++ } + fi + EOF +-- +2.44.0 + diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-4 index 593b019db7d4..35d3060137a9 100644 --- a/sys-boot/grub/files/grub.default-3 +++ b/sys-boot/grub/files/grub.default-4 @@ -1,9 +1,9 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # To populate all changes in this file you need to regenerate your # grub configuration file afterwards: -# 'grub2-mkconfig -o /boot/grub/grub.cfg' +# 'grub-mkconfig -o /boot/grub/grub.cfg' # # See the grub info page for documentation on possible variables and # their associated values. @@ -58,6 +58,9 @@ GRUB_DISTRIBUTOR="Gentoo" # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel #GRUB_DISABLE_LINUX_UUID=true +# Comment if you don't want GRUB to pass "root=PARTUUID=xxx" parameter to kernel +GRUB_DISABLE_LINUX_PARTUUID=false + # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY=true diff --git a/sys-boot/grub/files/sbat.csv b/sys-boot/grub/files/sbat.csv new file mode 100644 index 000000000000..2b87b532556c --- /dev/null +++ b/sys-boot/grub/files/sbat.csv @@ -0,0 +1,3 @@ +sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md +grub,3,Free Software Foundation,grub,%PV%,https//www.gnu.org/software/grub/ +grub.gentoo,1,Gentoo,grub,%PV%,https://bugs.gentoo.org/ diff --git a/sys-boot/grub/grub-2.02-r4.ebuild b/sys-boot/grub/grub-2.02-r4.ebuild deleted file mode 100644 index 2215a61ff455..000000000000 --- a/sys-boot/grub/grub-2.02-r4.ebuild +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -GRUB_AUTOGEN=1 -GRUB_AUTORECONF=1 - -if [[ -n ${GRUB_AUTOGEN} ]]; then - PYTHON_COMPAT=( python{2_7,3_{5,6,7}} ) - inherit python-any-r1 -fi - -if [[ -n ${GRUB_AUTORECONF} ]]; then - WANT_LIBTOOL=none - inherit autotools -fi - -inherit bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs - -if [[ ${PV} != 9999 ]]; then - 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/_/'~'} - SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - else - SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" - S=${WORKDIR}/${P%_*} - fi - KEYWORDS="amd64 ~arm ~arm64 ppc ppc64 x86" -else - inherit git-r3 - EGIT_REPO_URI="git://git.sv.gnu.org/grub.git - http://git.savannah.gnu.org/r/grub.git" -fi - -PATCHES=( - "${FILESDIR}"/gfxpayload.patch - "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch - "${FILESDIR}"/2.02-multiple-early-initrd.patch - "${FILESDIR}"/2.02-freetype-capitalise-variables.patch - "${FILESDIR}"/2.02-freetype-pkg-config.patch - "${FILESDIR}"/2.02-xfs-sparse-inodes.patch - "${FILESDIR}"/2.02-X86_64_PLT32.patch - "${FILESDIR}"/2.02-gcc8.patch - "${FILESDIR}"/2.02-efi-tsc-pmtimer.patch -) - -DEJAVU=dejavu-sans-ttf-2.37 -UNIFONT=unifont-9.0.06 -SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) - themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" - -DESCRIPTION="GNU GRUB boot loader" -HOMEPAGE="https://www.gnu.org/software/grub/" - -# Includes licenses for dejavu and unifont -LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )" -SLOT="2/${PVR}" -IUSE="device-mapper doc efiemu +fonts mount multislot nls static 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 ) -IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" - -REQUIRED_USE=" - grub_platforms_coreboot? ( fonts ) - grub_platforms_qemu? ( fonts ) - grub_platforms_ieee1275? ( fonts ) - grub_platforms_loongson? ( fonts ) -" - -# os-prober: Used on runtime to detect other OSes -# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue -COMMON_DEPEND=" - app-arch/xz-utils - >=sys-libs/ncurses-5.2-r5:0= - sdl? ( media-libs/libsdl ) - device-mapper? ( >=sys-fs/lvm2-2.02.45 ) - libzfs? ( sys-fs/zfs ) - mount? ( sys-fs/fuse:0 ) - truetype? ( media-libs/freetype:2= ) - ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) - ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) -" -DEPEND="${COMMON_DEPEND} - ${PYTHON_DEPS} - app-misc/pax-utils - sys-devel/flex - sys-devel/bison - sys-apps/help2man - sys-apps/texinfo - fonts? ( - media-libs/freetype:2 - virtual/pkgconfig - ) - grub_platforms_xen? ( app-emulation/xen-tools:= ) - grub_platforms_xen-32? ( app-emulation/xen-tools:= ) - static? ( - app-arch/xz-utils[static-libs(+)] - truetype? ( - app-arch/bzip2[static-libs(+)] - media-libs/freetype[static-libs(+)] - sys-libs/zlib[static-libs(+)] - virtual/pkgconfig - ) - ) - test? ( - app-admin/genromfs - app-arch/cpio - app-arch/lzop - app-emulation/qemu - dev-libs/libisoburn - sys-apps/miscfiles - sys-block/parted - sys-fs/squashfs-tools - ) - themes? ( - app-arch/unzip - media-libs/freetype:2 - virtual/pkgconfig - ) - truetype? ( virtual/pkgconfig ) -" -RDEPEND="${COMMON_DEPEND} - kernel_linux? ( - grub_platforms_efi-32? ( sys-boot/efibootmgr ) - grub_platforms_efi-64? ( sys-boot/efibootmgr ) - ) - !multislot? ( !sys-boot/grub:0 !sys-boot/grub-static ) - nls? ( sys-devel/gettext ) -" - -RESTRICT="strip !test? ( test )" - -QA_EXECSTACK="usr/bin/grub*-emu* usr/lib/grub/*" -QA_WX_LOAD="usr/lib/grub/*" -QA_MULTILIB_PATHS="usr/lib/grub/.*" - -src_unpack() { - if [[ ${PV} == 9999 ]]; then - git-r3_src_unpack - fi - default -} - -src_prepare() { - default - - sed -i -e /autoreconf/d autogen.sh || die - - if use multislot; then - # fix texinfo file name, bug 416035 - sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die - fi - - # Nothing in Gentoo packages 'american-english' in the exact path - # wanted for the test, but all that is needed is a compressible text - # file, and we do have 'words' from miscfiles in the same path. - sed -i \ - -e '/CFILESSRC.*=/s,american-english,words,' \ - tests/util/grub-fs-tester.in \ - || die - - if [[ -n ${GRUB_AUTOGEN} ]]; then - python_setup - bash autogen.sh || die - fi - - if [[ -n ${GRUB_AUTORECONF} ]]; then - autopoint() { :; } - eautoreconf - fi -} - -grub_do() { - multibuild_foreach_variant run_in_build_dir "$@" -} - -grub_do_once() { - multibuild_for_best_variant run_in_build_dir "$@" -} - -grub_configure() { - local platform - - case ${MULTIBUILD_VARIANT} in - efi*) platform=efi ;; - xen*) platform=xen ;; - guessed) ;; - *) platform=${MULTIBUILD_VARIANT} ;; - esac - - case ${MULTIBUILD_VARIANT} in - *-32) - if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then - local CTARGET=i386 - fi ;; - *-64) - if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then - local CTARGET=x86_64 - local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}" - local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" - fi ;; - esac - - local myeconfargs=( - --disable-werror - --program-prefix= - --libdir="${EPREFIX}"/usr/lib - --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html - $(use_enable device-mapper) - $(use_enable mount grub-mount) - $(use_enable nls) - $(use_enable themes grub-themes) - $(use_enable truetype grub-mkfont) - $(use_enable libzfs) - $(use_enable sdl grub-emu-sdl) - ${platform:+--with-platform=}${platform} - - # Let configure detect this where supported - $(usex efiemu '' '--disable-efiemu') - ) - - if use multislot; then - myeconfargs+=( --program-transform-name="s,grub,grub2," ) - fi - - # Set up font symlinks - ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die - if use themes; then - ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die - fi - - local ECONF_SOURCE="${S}" - econf "${myeconfargs[@]}" -} - -src_configure() { - # Bug 508758. - replace-flags -O3 -O2 - - # We don't want to leak flags onto boot code. - export HOST_CCASFLAGS=${CCASFLAGS} - export HOST_CFLAGS=${CFLAGS} - export HOST_CPPFLAGS=${CPPFLAGS} - export HOST_LDFLAGS=${LDFLAGS} - unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS - - use static && HOST_LDFLAGS+=" -static" - - tc-ld-disable-gold #439082 #466536 #526348 - export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}" - unset LDFLAGS - - tc-export CC NM OBJCOPY RANLIB STRIP - tc-export BUILD_CC # Bug 485592 - - MULTIBUILD_VARIANTS=() - local p - for p in "${GRUB_ALL_PLATFORMS[@]}"; do - use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" ) - done - [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed ) - grub_do grub_configure -} - -src_compile() { - # Sandbox bug 404013. - use libzfs && addpredict /etc/dfs:/dev/zfs - - grub_do emake - use doc && grub_do_once emake -C docs html -} - -src_test() { - # The qemu dependency is a bit complex. - # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform. - grub_do emake check -} - -src_install() { - grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" - use doc && grub_do_once emake -C docs install-html DESTDIR="${D}" - - einstalldocs - - if use multislot; then - mv "${ED%/}"/usr/share/info/grub{,2}.info || die - fi - - insinto /etc/default - newins "${FILESDIR}"/grub.default-3 grub -} - -pkg_postinst() { - elog "For information on how to configure GRUB2 please refer to the guide:" - elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" - - 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 [[ -z ${REPLACING_VERSIONS} ]]; then - elog - elog "You may consider installing the following optional packages:" - optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober - optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn - optfeature "Enable RAID device detection" sys-fs/mdadm - fi -} diff --git a/sys-boot/grub/grub-2.04_rc1.ebuild b/sys-boot/grub/grub-2.04_rc1.ebuild deleted file mode 100644 index 5970936ad665..000000000000 --- a/sys-boot/grub/grub-2.04_rc1.ebuild +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -if [[ ${PV} == 9999 ]]; then - GRUB_AUTORECONF=1 - GRUB_BOOTSTRAP=1 -fi - -if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then - PYTHON_COMPAT=( python{2_7,3_{5,6,7}} ) - inherit python-any-r1 -fi - -if [[ -n ${GRUB_AUTORECONF} ]]; then - WANT_LIBTOOL=none - inherit autotools -fi - -inherit bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs - -if [[ ${PV} != 9999 ]]; then - 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/_/'~'} - SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz" - S=${WORKDIR}/${MY_P} - else - SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" - S=${WORKDIR}/${P%_*} - fi - KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" -else - inherit git-r3 - EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" -fi - -PATCHES=( - "${FILESDIR}"/gfxpayload.patch - "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch -) - -DEJAVU=dejavu-sans-ttf-2.37 -UNIFONT=unifont-12.0.01 -SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) - themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" - -DESCRIPTION="GNU GRUB boot loader" -HOMEPAGE="https://www.gnu.org/software/grub/" - -# Includes licenses for dejavu and unifont -LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )" -SLOT="2/${PVR}" -IUSE="device-mapper doc efiemu +fonts mount nls static 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 ) -IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" - -REQUIRED_USE=" - grub_platforms_coreboot? ( fonts ) - grub_platforms_qemu? ( fonts ) - grub_platforms_ieee1275? ( fonts ) - grub_platforms_loongson? ( fonts ) -" - -BDEPEND=" - ${PYTHON_DEPS} - app-misc/pax-utils - sys-devel/flex - sys-devel/bison - sys-apps/help2man - sys-apps/texinfo - fonts? ( - media-libs/freetype:2 - virtual/pkgconfig - ) - test? ( - app-admin/genromfs - app-arch/cpio - app-arch/lzop - app-emulation/qemu - dev-libs/libisoburn - sys-apps/miscfiles - sys-block/parted - sys-fs/squashfs-tools - ) - themes? ( - app-arch/unzip - media-libs/freetype:2 - virtual/pkgconfig - ) - truetype? ( virtual/pkgconfig ) -" -COMMON_DEPEND=" - app-arch/xz-utils - >=sys-libs/ncurses-5.2-r5:0= - sdl? ( media-libs/libsdl ) - device-mapper? ( >=sys-fs/lvm2-2.02.45 ) - libzfs? ( sys-fs/zfs ) - mount? ( sys-fs/fuse:0 ) - truetype? ( media-libs/freetype:2= ) - ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) - ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) - grub_platforms_xen? ( app-emulation/xen-tools:= ) - grub_platforms_xen-32? ( app-emulation/xen-tools:= ) -" -DEPEND="${COMMON_DEPEND} - static? ( - app-arch/xz-utils[static-libs(+)] - truetype? ( - app-arch/bzip2[static-libs(+)] - media-libs/freetype[static-libs(+)] - sys-libs/zlib[static-libs(+)] - virtual/pkgconfig - ) - ) -" -RDEPEND="${COMMON_DEPEND} - kernel_linux? ( - grub_platforms_efi-32? ( sys-boot/efibootmgr ) - grub_platforms_efi-64? ( sys-boot/efibootmgr ) - ) - !sys-boot/grub:0 !sys-boot/grub-static - nls? ( sys-devel/gettext ) -" - -RESTRICT="strip !test? ( test )" - -QA_EXECSTACK="usr/bin/grub*-emu* usr/lib/grub/*" -QA_WX_LOAD="usr/lib/grub/*" -QA_MULTILIB_PATHS="usr/lib/grub/.*" - -src_unpack() { - if [[ ${PV} == 9999 ]]; then - git-r3_src_unpack - pushd "${P}" >/dev/null || die - local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git" - local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}") - git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" - git-r3_checkout "${GNULIB_URI}" gnulib - popd >/dev/null || die - fi - default -} - -src_prepare() { - default - - sed -i -e /autoreconf/d autogen.sh || die - - # Nothing in Gentoo packages 'american-english' in the exact path - # wanted for the test, but all that is needed is a compressible text - # file, and we do have 'words' from miscfiles in the same path. - sed -i \ - -e '/CFILESSRC.*=/s,american-english,words,' \ - tests/util/grub-fs-tester.in \ - || die - - if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then - python_setup - fi - - if [[ -n ${GRUB_BOOTSTRAP} ]]; then - eautopoint --force - AUTOPOINT=: AUTORECONF=: ./bootstrap || die - elif [[ -n ${GRUB_AUTOGEN} ]]; then - ./autogen.sh || die - fi - - if [[ -n ${GRUB_AUTORECONF} ]]; then - eautoreconf - fi -} - -grub_do() { - multibuild_foreach_variant run_in_build_dir "$@" -} - -grub_do_once() { - multibuild_for_best_variant run_in_build_dir "$@" -} - -grub_configure() { - local platform - - case ${MULTIBUILD_VARIANT} in - efi*) platform=efi ;; - xen*) platform=xen ;; - guessed) ;; - *) platform=${MULTIBUILD_VARIANT} ;; - esac - - case ${MULTIBUILD_VARIANT} in - *-32) - if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then - local CTARGET=i386 - fi ;; - *-64) - if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then - local CTARGET=x86_64 - local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}" - local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" - fi ;; - esac - - local myeconfargs=( - --disable-werror - --program-prefix= - --libdir="${EPREFIX}"/usr/lib - --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html - $(use_enable device-mapper) - $(use_enable mount grub-mount) - $(use_enable nls) - $(use_enable themes grub-themes) - $(use_enable truetype grub-mkfont) - $(use_enable libzfs) - $(use_enable sdl grub-emu-sdl) - ${platform:+--with-platform=}${platform} - - # Let configure detect this where supported - $(usex efiemu '' '--disable-efiemu') - ) - - if use fonts; then - ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die - fi - - if use themes; then - ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die - fi - - local ECONF_SOURCE="${S}" - econf "${myeconfargs[@]}" -} - -src_configure() { - # Bug 508758. - replace-flags -O3 -O2 - - # We don't want to leak flags onto boot code. - export HOST_CCASFLAGS=${CCASFLAGS} - export HOST_CFLAGS=${CFLAGS} - export HOST_CPPFLAGS=${CPPFLAGS} - export HOST_LDFLAGS=${LDFLAGS} - unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS - - use static && HOST_LDFLAGS+=" -static" - - tc-ld-disable-gold #439082 #466536 #526348 - export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}" - unset LDFLAGS - - tc-export CC NM OBJCOPY RANLIB STRIP - tc-export BUILD_CC # Bug 485592 - - MULTIBUILD_VARIANTS=() - local p - for p in "${GRUB_ALL_PLATFORMS[@]}"; do - use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" ) - done - [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed ) - grub_do grub_configure -} - -src_compile() { - # Sandbox bug 404013. - use libzfs && addpredict /etc/dfs:/dev/zfs - - grub_do emake - use doc && grub_do_once emake -C docs html -} - -src_test() { - # The qemu dependency is a bit complex. - # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform. - grub_do emake check -} - -src_install() { - grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" - use doc && grub_do_once emake -C docs install-html DESTDIR="${D}" - - einstalldocs - - insinto /etc/default - newins "${FILESDIR}"/grub.default-3 grub -} - -pkg_postinst() { - elog "For information on how to configure GRUB2 please refer to the guide:" - elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" - - 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 [[ -z ${REPLACING_VERSIONS} ]]; then - elog - elog "You may consider installing the following optional packages:" - optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober - optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn - optfeature "Enable RAID device detection" sys-fs/mdadm - fi -} diff --git a/sys-boot/grub/grub-2.04-r1.ebuild b/sys-boot/grub/grub-2.12-r4.ebuild index 81bd769728c9..4be3b08984b6 100644 --- a/sys-boot/grub/grub-2.04-r1.ebuild +++ b/sys-boot/grub/grub-2.12-r4.ebuild @@ -1,61 +1,78 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -if [[ ${PV} == 9999 ]]; then - GRUB_AUTORECONF=1 - GRUB_BOOTSTRAP=1 -fi +# This ebuild uses 3 special global variables: +# 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 +# If gentpl.py or *.def is updated, set GRUB_AUTOGEN=1 +# If gnulib, gentpl.py, *.def, or any autotools files are updated, set GRUB_AUTORECONF=1 +# +# 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 +PYTHON_COMPAT=( python3_{10..12} ) +WANT_LIBTOOL=none +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/dkiper.gpg if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then - PYTHON_COMPAT=( python{2_7,3_{5,6,7}} ) inherit python-any-r1 fi if [[ -n ${GRUB_AUTORECONF} ]]; then - WANT_LIBTOOL=none inherit autotools fi -inherit bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs +inherit bash-completion-r1 flag-o-matic multibuild optfeature 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/_/'~'} - SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz" + SRC_URI=" + https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz + verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig ) + " S=${WORKDIR}/${MY_P} else - SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + 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 - KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + BDEPEND="verify-sig? ( sec-keys/openpgp-keys-danielkiper )" + KEYWORDS="amd64 arm arm64 ~ia64 ~loong ppc ppc64 ~riscv sparc x86" else inherit git-r3 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}"/2.04-sparc64-bios-boot.patch -) - DEJAVU=dejavu-sans-ttf-2.37 -UNIFONT=unifont-12.1.02 +UNIFONT=unifont-15.0.06 SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" -DESCRIPTION="GNU GRUB boot loader" -HOMEPAGE="https://www.gnu.org/software/grub/" - # Includes licenses for dejavu and unifont -LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )" +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 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 ) +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot + qemu qemu-mips pc uboot xen xen-32 xen-pvh ) IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" REQUIRED_USE=" @@ -65,10 +82,9 @@ REQUIRED_USE=" grub_platforms_loongson? ( fonts ) " -BDEPEND=" +BDEPEND+=" ${PYTHON_DEPS} - app-misc/pax-utils - sys-devel/flex + >=sys-devel/flex-2.5.35 sys-devel/bison sys-apps/help2man sys-apps/texinfo @@ -78,7 +94,7 @@ BDEPEND=" ) test? ( app-admin/genromfs - app-arch/cpio + app-alternatives/cpio app-arch/lzop app-emulation/qemu dev-libs/libisoburn @@ -96,32 +112,36 @@ BDEPEND=" DEPEND=" app-arch/xz-utils >=sys-libs/ncurses-5.2-r5:0= - sdl? ( media-libs/libsdl ) + grub_platforms_emu? ( + sdl? ( media-libs/libsdl2 ) + ) device-mapper? ( >=sys-fs/lvm2-2.02.45 ) - libzfs? ( sys-fs/zfs ) - mount? ( sys-fs/fuse:0 ) + libzfs? ( sys-fs/zfs:= ) + mount? ( sys-fs/fuse:3 ) truetype? ( media-libs/freetype:2= ) ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) - grub_platforms_xen? ( app-emulation/xen-tools:= ) - grub_platforms_xen-32? ( app-emulation/xen-tools:= ) " RDEPEND="${DEPEND} kernel_linux? ( grub_platforms_efi-32? ( sys-boot/efibootmgr ) grub_platforms_efi-64? ( sys-boot/efibootmgr ) ) - !sys-boot/grub:0 !sys-boot/grub-static + !sys-boot/grub:0 nls? ( sys-devel/gettext ) " -RESTRICT="!test? ( test )" +RESTRICT="!test? ( test ) test? ( userpriv )" QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*" QA_PRESTRIPPED="usr/lib/grub/.*" QA_MULTILIB_PATHS="usr/lib/grub/.*" QA_WX_LOAD="usr/lib/grub/*" +pkg_setup() { + : +} + src_unpack() { if [[ ${PV} == 9999 ]]; then git-r3_src_unpack @@ -131,37 +151,43 @@ src_unpack() { git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" git-r3_checkout "${GNULIB_URI}" gnulib popd >/dev/null || die + elif use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig} fi default } src_prepare() { - default - - sed -i -e /autoreconf/d autogen.sh || die + local 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 + ) - # Nothing in Gentoo packages 'american-english' in the exact path - # wanted for the test, but all that is needed is a compressible text - # file, and we do have 'words' from miscfiles in the same path. - sed -i \ - -e '/CFILESSRC.*=/s,american-english,words,' \ - tests/util/grub-fs-tester.in \ - || die + default if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then python_setup + else + export PYTHON=true fi if [[ -n ${GRUB_BOOTSTRAP} ]]; then eautopoint --force AUTOPOINT=: AUTORECONF=: ./bootstrap || die elif [[ -n ${GRUB_AUTOGEN} ]]; then - ./autogen.sh || die + FROM_BOOTSTRAP=1 ./autogen.sh || die fi 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() { @@ -177,6 +203,7 @@ grub_configure() { case ${MULTIBUILD_VARIANT} in efi*) platform=efi ;; + xen-pvh) platform=xen_pvh ;; xen*) platform=xen ;; guessed) ;; *) platform=${MULTIBUILD_VARIANT} ;; @@ -199,14 +226,14 @@ grub_configure() { --disable-werror --program-prefix= --libdir="${EPREFIX}"/usr/lib - --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html $(use_enable device-mapper) $(use_enable mount grub-mount) $(use_enable nls) $(use_enable themes grub-themes) $(use_enable truetype grub-mkfont) $(use_enable libzfs) - $(use_enable sdl grub-emu-sdl) + --enable-grub-emu-sdl=no + $(use_enable sdl grub-emu-sdl2) ${platform:+--with-platform=}${platform} # Let configure detect this where supported @@ -229,6 +256,9 @@ src_configure() { # Bug 508758. replace-flags -O3 -O2 + # Workaround for bug 829165. + filter-ldflags -pie + # We don't want to leak flags onto boot code. export HOST_CCASFLAGS=${CCASFLAGS} export HOST_CFLAGS=${CFLAGS} @@ -241,7 +271,11 @@ src_configure() { unset LDFLAGS tc-export CC NM OBJCOPY RANLIB STRIP - tc-export BUILD_CC # Bug 485592 + tc-export BUILD_CC BUILD_PKG_CONFIG + + # Force configure to use flex & bison, bug 887211. + export LEX=flex + unset YACC MULTIBUILD_VARIANTS=() local p @@ -254,7 +288,7 @@ src_configure() { src_compile() { # Sandbox bug 404013. - use libzfs && addpredict /etc/dfs:/dev/zfs + use libzfs && { addpredict /etc/dfs; addpredict /dev/zfs; } grub_do emake use doc && grub_do_once emake -C docs html @@ -263,7 +297,9 @@ src_compile() { src_test() { # The qemu dependency is a bit complex. # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform. - grub_do emake check + local SANDBOX_WRITE=${SANDBOX_WRITE} + addwrite /dev + grub_do emake -j1 check } src_install() { @@ -273,26 +309,51 @@ src_install() { einstalldocs insinto /etc/default - newins "${FILESDIR}"/grub.default-3 grub + newins "${FILESDIR}"/grub.default-4 grub # https://bugs.gentoo.org/231935 dostrip -x /usr/lib/grub + + sed -e "s/%PV%/${PV}/" "${FILESDIR}/sbat.csv" > "${T}/sbat.csv" || die + insinto /usr/share/grub + doins "${T}/sbat.csv" + + if use elibc_musl; then + # https://bugs.gentoo.org/900348 + QA_CONFIG_IMPL_DECL_SKIP=( re_{compile_pattern,match,search,set_syntax} ) + fi } pkg_postinst() { elog "For information on how to configure GRUB2 please refer to the guide:" elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" + if [[ -n ${REPLACING_VERSIONS} ]]; then + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test -gt ${v}; then + ewarn + ewarn "Re-run grub-install to update installed boot code!" + ewarn "Re-run grub-mkconfig to update grub.cfg!" + ewarn + break + fi + done + else + elog + optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "enabling RAID device detection" sys-fs/mdadm + optfeature "automatically updating GRUB's configuration on each kernel installation" "sys-kernel/installkernel[grub]" + 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 [[ -z ${REPLACING_VERSIONS} ]]; then - elog - elog "You may consider installing the following optional packages:" - optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober - optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn - optfeature "Enable RAID device detection" sys-fs/mdadm + 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 } diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild index 07f21fac6705..688a7f51bb8a 100644 --- a/sys-boot/grub/grub-9999.ebuild +++ b/sys-boot/grub/grub-9999.ebuild @@ -1,60 +1,81 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 +# This ebuild uses 3 special global variables: +# 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 +# If gentpl.py or *.def is updated, set GRUB_AUTOGEN=1 +# If gnulib, gentpl.py, *.def, or any autotools files are updated, set GRUB_AUTORECONF=1 +# +# 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_{10..12} ) +WANT_LIBTOOL=none +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/dkiper.gpg + if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then - PYTHON_COMPAT=( python{2_7,3_{5,6,7}} ) inherit python-any-r1 fi if [[ -n ${GRUB_AUTORECONF} ]]; then - WANT_LIBTOOL=none inherit autotools fi -inherit bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs +inherit bash-completion-r1 flag-o-matic multibuild optfeature 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/_/'~'} - SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz" + SRC_URI=" + https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz + verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig ) + " S=${WORKDIR}/${MY_P} else - SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + SRC_URI=" + mirror://gnu/${PN}/${P}.tar.xz + verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig ) + " S=${WORKDIR}/${P%_*} fi - KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" + BDEPEND="verify-sig? ( sec-keys/openpgp-keys-danielkiper )" + KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" else inherit git-r3 EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" fi -PATCHES=( - "${FILESDIR}"/gfxpayload.patch - "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch -) - DEJAVU=dejavu-sans-ttf-2.37 -UNIFONT=unifont-12.1.02 +UNIFONT=unifont-15.0.06 SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" -DESCRIPTION="GNU GRUB boot loader" -HOMEPAGE="https://www.gnu.org/software/grub/" - # Includes licenses for dejavu and unifont -LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )" +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 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 ) +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot + qemu qemu-mips pc uboot xen xen-32 xen-pvh ) IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" REQUIRED_USE=" @@ -64,10 +85,9 @@ REQUIRED_USE=" grub_platforms_loongson? ( fonts ) " -BDEPEND=" +BDEPEND+=" ${PYTHON_DEPS} - app-misc/pax-utils - sys-devel/flex + >=sys-devel/flex-2.5.35 sys-devel/bison sys-apps/help2man sys-apps/texinfo @@ -77,7 +97,7 @@ BDEPEND=" ) test? ( app-admin/genromfs - app-arch/cpio + app-alternatives/cpio app-arch/lzop app-emulation/qemu dev-libs/libisoburn @@ -95,32 +115,36 @@ BDEPEND=" DEPEND=" app-arch/xz-utils >=sys-libs/ncurses-5.2-r5:0= - sdl? ( media-libs/libsdl ) + grub_platforms_emu? ( + sdl? ( media-libs/libsdl2 ) + ) device-mapper? ( >=sys-fs/lvm2-2.02.45 ) - libzfs? ( sys-fs/zfs ) - mount? ( sys-fs/fuse:0 ) + libzfs? ( sys-fs/zfs:= ) + mount? ( sys-fs/fuse:3 ) truetype? ( media-libs/freetype:2= ) ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) - grub_platforms_xen? ( app-emulation/xen-tools:= ) - grub_platforms_xen-32? ( app-emulation/xen-tools:= ) " RDEPEND="${DEPEND} kernel_linux? ( grub_platforms_efi-32? ( sys-boot/efibootmgr ) grub_platforms_efi-64? ( sys-boot/efibootmgr ) ) - !sys-boot/grub:0 !sys-boot/grub-static + !sys-boot/grub:0 nls? ( sys-devel/gettext ) " -RESTRICT="!test? ( test )" +RESTRICT="!test? ( test ) test? ( userpriv )" QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*" QA_PRESTRIPPED="usr/lib/grub/.*" QA_MULTILIB_PATHS="usr/lib/grub/.*" QA_WX_LOAD="usr/lib/grub/*" +pkg_setup() { + : +} + src_unpack() { if [[ ${PV} == 9999 ]]; then git-r3_src_unpack @@ -130,32 +154,32 @@ src_unpack() { git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" git-r3_checkout "${GNULIB_URI}" gnulib popd >/dev/null || die + elif use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.sig} fi default } src_prepare() { - default - - sed -i -e /autoreconf/d autogen.sh || die + local PATCHES=( + "${FILESDIR}"/gfxpayload.patch + "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch + "${FILESDIR}"/grub-2.06-test-words.patch + ) - # Nothing in Gentoo packages 'american-english' in the exact path - # wanted for the test, but all that is needed is a compressible text - # file, and we do have 'words' from miscfiles in the same path. - sed -i \ - -e '/CFILESSRC.*=/s,american-english,words,' \ - tests/util/grub-fs-tester.in \ - || die + default if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then python_setup + else + export PYTHON=true fi if [[ -n ${GRUB_BOOTSTRAP} ]]; then eautopoint --force AUTOPOINT=: AUTORECONF=: ./bootstrap || die elif [[ -n ${GRUB_AUTOGEN} ]]; then - ./autogen.sh || die + FROM_BOOTSTRAP=1 ./autogen.sh || die fi if [[ -n ${GRUB_AUTORECONF} ]]; then @@ -176,6 +200,7 @@ grub_configure() { case ${MULTIBUILD_VARIANT} in efi*) platform=efi ;; + xen-pvh) platform=xen_pvh ;; xen*) platform=xen ;; guessed) ;; *) platform=${MULTIBUILD_VARIANT} ;; @@ -198,14 +223,14 @@ grub_configure() { --disable-werror --program-prefix= --libdir="${EPREFIX}"/usr/lib - --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html $(use_enable device-mapper) $(use_enable mount grub-mount) $(use_enable nls) $(use_enable themes grub-themes) $(use_enable truetype grub-mkfont) $(use_enable libzfs) - $(use_enable sdl grub-emu-sdl) + --enable-grub-emu-sdl=no + $(use_enable sdl grub-emu-sdl2) ${platform:+--with-platform=}${platform} # Let configure detect this where supported @@ -228,6 +253,9 @@ src_configure() { # Bug 508758. replace-flags -O3 -O2 + # Workaround for bug 829165. + filter-ldflags -pie + # We don't want to leak flags onto boot code. export HOST_CCASFLAGS=${CCASFLAGS} export HOST_CFLAGS=${CFLAGS} @@ -240,7 +268,11 @@ src_configure() { unset LDFLAGS tc-export CC NM OBJCOPY RANLIB STRIP - tc-export BUILD_CC # Bug 485592 + tc-export BUILD_CC BUILD_PKG_CONFIG + + # Force configure to use flex & bison, bug 887211. + export LEX=flex + unset YACC MULTIBUILD_VARIANTS=() local p @@ -253,7 +285,7 @@ src_configure() { src_compile() { # Sandbox bug 404013. - use libzfs && addpredict /etc/dfs:/dev/zfs + use libzfs && { addpredict /etc/dfs; addpredict /dev/zfs; } grub_do emake use doc && grub_do_once emake -C docs html @@ -262,7 +294,9 @@ src_compile() { src_test() { # The qemu dependency is a bit complex. # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform. - grub_do emake check + local SANDBOX_WRITE=${SANDBOX_WRITE} + addwrite /dev + grub_do emake -j1 check } src_install() { @@ -272,26 +306,51 @@ src_install() { einstalldocs insinto /etc/default - newins "${FILESDIR}"/grub.default-3 grub + newins "${FILESDIR}"/grub.default-4 grub # https://bugs.gentoo.org/231935 dostrip -x /usr/lib/grub + + sed -e "s/%PV%/${PV}/" "${FILESDIR}/sbat.csv" > "${T}/sbat.csv" || die + insinto /usr/share/grub + doins "${T}/sbat.csv" + + if use elibc_musl; then + # https://bugs.gentoo.org/900348 + QA_CONFIG_IMPL_DECL_SKIP=( re_{compile_pattern,match,search,set_syntax} ) + fi } pkg_postinst() { elog "For information on how to configure GRUB2 please refer to the guide:" elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" + if [[ -n ${REPLACING_VERSIONS} ]]; then + local v + for v in ${REPLACING_VERSIONS}; do + if ver_test -gt ${v}; then + ewarn + ewarn "Re-run grub-install to update installed boot code!" + ewarn "Re-run grub-mkconfig to update grub.cfg!" + ewarn + break + fi + done + else + elog + optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "enabling RAID device detection" sys-fs/mdadm + optfeature "automatically updating GRUB's configuration on each kernel installation" "sys-kernel/installkernel[grub]" + 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 [[ -z ${REPLACING_VERSIONS} ]]; then - elog - elog "You may consider installing the following optional packages:" - optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober - optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn - optfeature "Enable RAID device detection" sys-fs/mdadm + 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 } diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml index 68e6175af8d5..a5ad32e2e733 100644 --- a/sys-boot/grub/metadata.xml +++ b/sys-boot/grub/metadata.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> <email>floppym@gentoo.org</email> @@ -23,14 +23,10 @@ <flag name="libzfs"> Enable support for <pkg>sys-fs/zfs</pkg> </flag> - <flag name="multislot"> - Allow concurrent installation of <pkg>sys-boot/grub</pkg> SLOT 0 and - <pkg>sys-boot/grub</pkg> SLOT 2 by renaming all programs. - </flag> <flag name="themes">Build and install GRUB themes (starfield)</flag> <flag name="truetype">Build and install grub-mkfont conversion utility</flag> </use> <upstream> - <remote-id type="sourceforge">dejavu</remote-id> + <remote-id type="cpe">cpe:/a:gnu:grub</remote-id> </upstream> </pkgmetadata> |