From fce003e5fc9be87e7072b1433ea77f3e61b1e680 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Jan 2019 10:07:50 -0800 Subject: [PATCH] add deprecated sys-boot/grub:0 --- sys-boot/grub/Manifest | 17 + sys-boot/grub/files/2.02-X86_64_PLT32.patch | 75 +++++ .../2.02-freetype-capitalise-variables.patch | 126 +++++++ .../grub/files/2.02-freetype-pkg-config.patch | 194 +++++++++++ sys-boot/grub/files/2.02-gcc8.patch | 72 ++++ .../files/2.02-multiple-early-initrd.patch | 177 ++++++++++ .../grub/files/2.02-xfs-sparse-inodes.patch | 60 ++++ sys-boot/grub/files/gfxpayload.patch | 29 ++ ...d-esp-to-list-of-clobbered-registers.patch | 53 +++ .../files/grub-0.97-ncurses-pkgconfig.patch | 18 + .../files/grub-2.02_beta2-KERNEL_GLOBS.patch | 67 ++++ sys-boot/grub/files/grub.conf.gentoo | 16 + sys-boot/grub/files/grub.default-3 | 73 +++++ sys-boot/grub/grub-0.97-r18.ebuild | 309 ++++++++++++++++++ sys-boot/grub/metadata.xml | 43 +++ 15 files changed, 1329 insertions(+) create mode 100644 sys-boot/grub/Manifest create mode 100644 sys-boot/grub/files/2.02-X86_64_PLT32.patch create mode 100644 sys-boot/grub/files/2.02-freetype-capitalise-variables.patch create mode 100644 sys-boot/grub/files/2.02-freetype-pkg-config.patch create mode 100644 sys-boot/grub/files/2.02-gcc8.patch create mode 100644 sys-boot/grub/files/2.02-multiple-early-initrd.patch create mode 100644 sys-boot/grub/files/2.02-xfs-sparse-inodes.patch create mode 100644 sys-boot/grub/files/gfxpayload.patch create mode 100644 sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch create mode 100644 sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch create mode 100644 sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch create mode 100644 sys-boot/grub/files/grub.conf.gentoo create mode 100644 sys-boot/grub/files/grub.default-3 create mode 100644 sys-boot/grub/grub-0.97-r18.ebuild create mode 100644 sys-boot/grub/metadata.xml diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest new file mode 100644 index 0000000..70f0f3b --- /dev/null +++ b/sys-boot/grub/Manifest @@ -0,0 +1,17 @@ +AUX 2.02-X86_64_PLT32.patch 2615 BLAKE2B db2c7f22a5232ec903bbad2416879d330a9d7c0e529f1135b07deaab4026ae51e6fd60ee6f29cb7cbc4c4422343ec0c56dcd3bb205855c45481ebcfc0e0c9c10 SHA512 d8d52f2e92291d382cff2c50af79634967eb5decba39f5787e311e771bd18763b68e87d93f44419ecc647c0189b7d4246ad4a4f9e3558200e7febf32cd757f5e +AUX 2.02-freetype-capitalise-variables.patch 6454 BLAKE2B 7a05448d42c935b6942f2b9ac98eef2ddc2e7bb7e6584516859cd6586dee57911c83c98402b38cfe9044a3c3a79d41d6a86bb0918d1ca8ccf792d5ef93bad258 SHA512 99c8061453f54af0e95361101f6beb2340baef9b5a66c4c4ba78876b978df4b5686190b642090aae41f2ed2d464e267ba598e94c0926a37df3c36d866911a40c +AUX 2.02-freetype-pkg-config.patch 7359 BLAKE2B 86ee01b2cb833354377aec3db0dcc05c9950169c9e83b9878018debef925a5238ba19b10ee0ce5124d7884deae8023ee03597e6eb56c244030f2492b5b7f0b1b SHA512 20fd57f8410073db7d6ae5c626266a310be65ca2f5cc4a2a9f2e66cb85a421c883b497e5fc7e3cd5a6ec066531f3ca4b8d837bf64007ade99418958aefd2dcf6 +AUX 2.02-gcc8.patch 2514 BLAKE2B 5eb8210441a41a44c4e0c73120d201c4ec5a8db27d0dbf37f991599ee6c2bb3aaf771a201d02829597f34f9a1af76f70dffcc9e25fa079c3e2eb72702d704692 SHA512 8eae4bfdbe595685961ed8f491b8dc8f30632d5d9e338612346a928318d4e4b811c5ffeb38354f698e40dbaa8449fd540a33ff2ca0e2af604cbe08988fc11238 +AUX 2.02-multiple-early-initrd.patch 6771 BLAKE2B 088d1178c51ea7526bd7620ae0f8160c10d3673afd0ae3407e35673cb438875e24e13f8455245c36792814751995df1235d975eb036e97813e677250af403a9d SHA512 41450b475fb83ade629d165ae2c30682e5beb2edbfd148c6388bb720241f0682b20aa0456bc624d5e9f5605616ea27fab32a829ede6c8c673e1c88e6b774a5a8 +AUX 2.02-xfs-sparse-inodes.patch 2548 BLAKE2B c3333b82b678bc0a2bfc6594719c89982f97b14b7a2f012814ce2f75e004cda46b8b7c2d4e668c5a52aee7814114a763c4d853d9c75b4322535096ba3c22e256 SHA512 4723c5dd9fd6e9b6c8677e32e4906c7995d695c7e85e834b1b29eb1d9a024678f8fa75846c7b929d1db9b5911b604c69c1b0379cb3b9adc98d5bb6d6719eb2c4 +AUX gfxpayload.patch 1118 BLAKE2B 4104fc696535b1c3feba5876bccc64f9b2e52319ee992c59e7f17b8310cc9addf7545630fff78c73ca3f4b0dcd44e1bf69f4df5264d6f58777f7e5aeae93cbcb SHA512 00324825c369902a0383b792cd21e161853eadccbdc5abe2420f2d443bf6a74f72be6c15243107b936acd38c3547387c3771dc2cb566003c4c754c9260b4aa00 +AUX grub-0.97-Add-esp-to-list-of-clobbered-registers.patch 1612 BLAKE2B a8169fc73299a2a0bf59d66f0226da436bef249d543d3509d1c45bd355b0beceab66369ea1c5c4b8e78cb8a8084fbabd6fc09da8efdc0ffac427dc67142a5773 SHA512 85241fc4f939cbf6dc9e18b0b68034835bcb4ac7162fa1dc497e169422b66f0320d59d8270bc13c827a325f45d260028276641cff3f12b4d6096e2d33a12261b +AUX grub-0.97-ncurses-pkgconfig.patch 799 BLAKE2B da34dca4e6009b6386d66e0b05264293e4095007239558712a0fa7a0b18a8f05112840f1f25355298a67cffe441621e4dbf14a4373d1fe6d91144fad4b799173 SHA512 9456c422e05e75e4221101d66bf1c1ba3efa195ef67872a75790362da825bffe1bcd74c5ff6e3f5a9ccda6b364f02c631c0d513c0de5aa19a78be9bea525c13f +AUX grub-2.02_beta2-KERNEL_GLOBS.patch 2121 BLAKE2B 398195f59537d40a4f61eadf5be974b8f9eb56a4eb07b798f0dc18e29588b3a9f8daa8d6e64980a835ec1960fab60b8c96d6552ef2920fe6604170abf7d5e7da SHA512 f85bc538ae647c46efbe07d7b87acf49daa7b07e9752af3aa3f77019f48ea24cd1b6a095a6f9c19d50128701753f453c531b9b068e11ee22a259f3fdf8ac205e +AUX grub.conf.gentoo 591 BLAKE2B a6a0b98d3bcc1a053d23e98848aafa45691bca8c18564edc1d3526baced67aae0539fa4906913914ea423799fc1098ab2a7c00effa809493a06df73ee6732290 SHA512 23036b9e558b604082d9ae8c848f18ea552181416937e3ef62287e53c38086b8d7ffef0e67d04af04f05f5b23c6da7aaf1f1f23e0ee1cffd5dbd5320e8648cb1 +AUX grub.default-3 2532 BLAKE2B f59b8e862b7069603a975327d51507aae4568bfc80d7aa237f620008b00520a5a14b0c95e3f9c277360e1dfafc83bcc815970b47a69bf469ad7e594956f47c60 SHA512 2faf5e730331b7d04045ee64d990227ef02f1b14a1cf88b5b71a18c91a9a8cba773a601eb3f5442092f6937935efed02629a278bd6822fac60f9c72045e4b13d +DIST grub-0.97-patches-1.15.tar.bz2 52887 BLAKE2B a571fe3b918cad590880a277df6ef1bdf094fbc11fd25b2dfb0d790a6b1b37839460475aebc3d6e4f09f59f969ab42dfd8e2b7472aba31c296ed5e03ba3f1030 SHA512 729a4b62bd04aca5b15b83e87b799e1c7e592a5a0265ec6b7a4f4d4ebde05e3e57b62fb6eed6ee1b7692d5dc43dd9ad65898332ff806557b62a7174a797c251a +DIST grub-0.97.tar.gz 971783 BLAKE2B a7b6feb6dddb6eeb20e027071091b2d37930e5b40687f8c8ff860839db208f832713db61389014d21842e1e152cad0466dc9722a79cbb81bfa1566a30b6b82cc SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb +DIST splash.xpm.gz 33856 BLAKE2B e8d0ee91a87ed45f47fa58b07a6476b19ddb3f98ffee41adce46fe9bc4926bbefcac5cd01efc41794049b1c905502b18e69b5f0546bcf3cea79bf351e1817574 SHA512 5ae1f786f7d46a95a7061068d5b2b3ad64607c7b190d6f28379508c5dce67e26308325bfd637542a84855dfcf1ea3d143947326fdb189a6a8972208d3ead23da +EBUILD grub-0.97-r18.ebuild 10141 BLAKE2B 7af15e1634c7e96930a7ddaa72d9ab7adae72a0b62729d65d52fd86262d7a7c2a27e2a59c412733463bccc83e9b30d62408d5bebb30f90c99135c05fabc140e7 SHA512 d9c481f77fa1d2f750b64de8cfa02f52be9a0d563607ca50117e4792add79b21e3fb34dc448beebbbb7a99153b9dc5cad01d447209fae154a8205864593c89d6 +MISC metadata.xml 1540 BLAKE2B 9c5d213898703714431a97e9fe758b4a3f0aa312b431644ff7406639d7062292da386eb8500f299d56f057ab987130b0960d655281cebee77154715baeae4258 SHA512 6871afd65e961b0f3e964baeff6c2e96dd470ff1fab076b7040f899fc90d7649ce3f2d304d82745ef38ddef2def7b8a36343722ab3d78bddddcceb41fea8cb88 diff --git a/sys-boot/grub/files/2.02-X86_64_PLT32.patch b/sys-boot/grub/files/2.02-X86_64_PLT32.patch new file mode 100644 index 0000000..2c65cb7 --- /dev/null +++ b/sys-boot/grub/files/2.02-X86_64_PLT32.patch @@ -0,0 +1,75 @@ +From 02702bdfe14d8a04643a45b03715f734ae34dbac Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +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 +Reviewed-by: Daniel Kiper + +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-freetype-capitalise-variables.patch b/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch new file mode 100644 index 0000000..9aa7f54 --- /dev/null +++ b/sys-boot/grub/files/2.02-freetype-capitalise-variables.patch @@ -0,0 +1,126 @@ +From ba84c8d1b4830e9fcb14d9f0e4a36e03ac40a09d Mon Sep 17 00:00:00 2001 +From: Colin Watson +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 new file mode 100644 index 0000000..94437f0 --- /dev/null +++ b/sys-boot/grub/files/2.02-freetype-pkg-config.patch @@ -0,0 +1,194 @@ +From 3eec911197081a63d9dae28f1784ad01a06fb60a Mon Sep 17 00:00:00 2001 +From: Colin Watson +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 +Signed-off-by: Colin Watson + +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 new file mode 100644 index 0000000..51ee7dc --- /dev/null +++ b/sys-boot/grub/files/2.02-gcc8.patch @@ -0,0 +1,72 @@ +From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 +From: Michael Chang +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 +Tested-by: Michael Chang +Tested-by: Paul Menzel +Reviewed-by: Daniel Kiper +--- + 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 new file mode 100644 index 0000000..74b576f --- /dev/null +++ b/sys-boot/grub/files/2.02-multiple-early-initrd.patch @@ -0,0 +1,177 @@ +From a698240df0c43278b2d1d7259c8e7a6926c63112 Mon Sep 17 00:00:00 2001 +From: "Matthew S. Turnbull" +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 +Signed-off-by: Matthew S. Turnbull +Reviewed-by: Daniel Kiper +--- + 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 new file mode 100644 index 0000000..6c6a750 --- /dev/null +++ b/sys-boot/grub/files/2.02-xfs-sparse-inodes.patch @@ -0,0 +1,60 @@ +From cda0a857dd7a27cd5d621747464bfe71e8727fff Mon Sep 17 00:00:00 2001 +From: Daniel Kiper +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 +Reviewed-by: Daniel Kiper +Tested-by: Chris Murphy +--- + 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/gfxpayload.patch b/sys-boot/grub/files/gfxpayload.patch new file mode 100644 index 0000000..6c63ef8 --- /dev/null +++ b/sys-boot/grub/files/gfxpayload.patch @@ -0,0 +1,29 @@ +From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Thu, 16 Oct 2014 23:43:51 -0400 +Subject: [PATCH] 10_linux: Default gfxpayload=keep only when booting using efi + +vesafb seems to be unreliable when using BIOS compat mode. + +--- + util/grub.d/10_linux.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index d2e2a8f..a54b888 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -104,7 +104,9 @@ linux_entry () + echo " load_video" | sed "s/^/$submenu_indentation/" + if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \ + && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then +- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/" ++ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' fi' | sed "s/^/$submenu_indentation/" + fi + else + if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then +-- +2.7.2 + diff --git a/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch new file mode 100644 index 0000000..c550aab --- /dev/null +++ b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch @@ -0,0 +1,53 @@ +From 5a52ee4b5cd152fa4ccd1c1f938ce2eba652af52 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 14 Dec 2015 23:59:17 +0000 +Subject: [PATCH] Add %esp to list of clobbered registers + +GCC assumes that it can combine stacks from +outer + grub_stage2() +and inner + trampoline doit() +functions (optimisation -fcombine-stack-adjustments). + +But doit() function clobbers %esp in inline +assebly statement as: + + asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n" + : "=&r" (realstack) : "r" (simstack)); + +which tricks gcc into computing invalid local variable +offsets from current %esp value. + +Fix by hinting gcc about %esp change in clobber list. + +Signed-off-by: Sergei Trofimovich +--- + grub/asmstub.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub/asmstub.c b/grub/asmstub.c +index 6354806..44b056f 100644 +--- a/grub/asmstub.c ++++ b/grub/asmstub.c +@@ -174,7 +174,7 @@ grub_stage2 (void) + { + /* Make sure our stack lives in the simulated memory area. */ + asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n" +- : "=&r" (realstack) : "r" (simstack)); ++ : "=&r" (realstack) : "r" (simstack) : "%esp"); + + /* Do a setjmp here for the stop command. */ + if (! setjmp (env_for_exit)) +@@ -191,7 +191,7 @@ grub_stage2 (void) + } + + /* Replace our stack before we use any local variables. */ +- asm volatile ("movl %0, %%esp\n" : : "r" (realstack)); ++ asm volatile ("movl %0, %%esp\n" : : "r" (realstack) : "%esp"); + } + + assert (grub_scratch_mem == 0); +-- +2.6.3 + diff --git a/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch new file mode 100644 index 0000000..d62e434 --- /dev/null +++ b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch @@ -0,0 +1,18 @@ +--- a/configure.ac 2015-12-17 11:09:56.807893315 -0500 ++++ b/configure.ac 2015-12-17 11:11:06.697570856 -0500 +@@ -234,10 +234,14 @@ + + # Unless the user specify --without-curses, check for curses. + if test "x$with_curses" != "xno"; then ++ PKG_CHECK_MODULES([NCURSES],[ncurses],[ ++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library]) ++ GRUB_LIBS="$GRUB_LIBS $NCURSES_LIBS" ++ ],[ + AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses" + AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])], + [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses" +- AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])]) ++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])]) + fi + + AC_SUBST(GRUB_LIBS) 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 new file mode 100644 index 0000000..c66ee68 --- /dev/null +++ b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch @@ -0,0 +1,67 @@ +From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001 +From: "Robin H. Johnson" +Date: Tue, 29 Dec 2015 15:29:14 -0800 +Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection + +* util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS +* docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS + +Signed-off-by: Robin H. Johnson +--- + docs/grub.texi | 5 +++++ + util/grub.d/10_linux.in | 21 +++++++++++---------- + 2 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 9a25a0b..d1129ec 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces. + Each module will be loaded as early as possible, at the start of + @file{grub.cfg}. + ++@item GRUB_LINUX_KERNEL_GLOBS ++This option may be set to override the list of path globs used to find Linux ++kernels. The defaults vary by architecture, and generally include both ++@file{/boot} and @file{/}. ++ + @end table + + The following options are still accepted for compatibility with existing +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 859b608..e5ac11d 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -145,18 +145,19 @@ EOF + } + + machine=`uname -m` +-case "x$machine" in ++globs="$GRUB_LINUX_KERNEL_GLOBS" ++[ -z "$globs" ] && case "x$machine" in + xi?86 | xx86_64) +- list= +- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; +- *) +- list= +- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; ++ globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*" ++ ;; ++ *) ++ globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*" ++ ;; + esac ++list= ++for i in ${globs} ; do ++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi ++done + + case "$machine" in + i?86) GENKERNEL_ARCH="x86" ;; +-- +2.3.0 + diff --git a/sys-boot/grub/files/grub.conf.gentoo b/sys-boot/grub/files/grub.conf.gentoo new file mode 100644 index 0000000..984470b --- /dev/null +++ b/sys-boot/grub/files/grub.conf.gentoo @@ -0,0 +1,16 @@ +# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook +# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2 +# If you are not using Genkernel and you need help creating this file, you +# should consult the handbook. Alternatively, consult the grub.conf.sample that +# is included with the Grub documentation. + +default 0 +timeout 30 +#splashimage=(hd0,0)/boot/grub/splash.xpm.gz + +#title Gentoo Linux 3.8.13 +#root (hd0,0) +#kernel /boot/kernel-genkernel-x86-3.8.13-gentoo root=/dev/sda3 +#initrd /boot/initramfs-genkernel-x86-3.8.13 + +# vim:ft=conf: diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-3 new file mode 100644 index 0000000..593b019 --- /dev/null +++ b/sys-boot/grub/files/grub.default-3 @@ -0,0 +1,73 @@ +# Copyright 1999-2015 Gentoo Foundation +# 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' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Gentoo" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +#GRUB_TIMEOUT=5 +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line +#GRUB_CMDLINE_LINUX="" +# +# Examples: +# +# Boot with network interface renaming disabled +# GRUB_CMDLINE_LINUX="net.ifnames=0" +# +# Boot with systemd instead of sysvinit (openrc) +# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" + +# Append parameters to the linux kernel command line for non-recovery entries +#GRUB_CMDLINE_LINUX_DEFAULT="" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +#GRUB_GFXMODE=640x480 + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +#GRUB_GFXPAYLOAD_LINUX= + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +#GRUB_BACKGROUND="/boot/grub/mybackground.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" diff --git a/sys-boot/grub/grub-0.97-r18.ebuild b/sys-boot/grub/grub-0.97-r18.ebuild new file mode 100644 index 0000000..695b074 --- /dev/null +++ b/sys-boot/grub/grub-0.97-r18.ebuild @@ -0,0 +1,309 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# XXX: we need to review menu.lst vs grub.conf handling. We've been converting +# all systems to grub.conf (and symlinking menu.lst to grub.conf), but +# we never updated any of the source code (it still all wants menu.lst), +# and there is no indication that upstream is making the transition. + +# If you need to roll a new grub-static distfile, here is how. +# - Robin H. Johnson - 29 Nov 2010 +# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \ +# USE='static -ncurses -netboot -custom-cflags' \ +# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \ +# grub-${PVR}.ebuild clean package && \ +# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \ +# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2 + +EAPI="6" + +inherit eutils mount-boot toolchain-funcs linux-info flag-o-matic autotools pax-utils + +PATCHVER="1.15" # Should match the revision ideally +DESCRIPTION="GNU GRUB Legacy boot loader" +HOMEPAGE="https://www.gnu.org/software/grub/" +SRC_URI="mirror://gentoo/${P}.tar.gz + mirror://gnu-alpha/${PN}/${P}.tar.gz + mirror://gentoo/splash.xpm.gz + mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2 + https://dev.gentoo.org/~whissi/dist/${PN}/${P}-patches-${PATCHVER}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86 ~x86-fbsd" +IUSE="custom-cflags ncurses netboot static" + +LIB_DEPEND="ncurses? ( >=sys-libs/ncurses-5.9-r3:0[static-libs(+),abi_x86_32(-)] )" +RDEPEND="!static? ( ${LIB_DEPEND//[static-libs(+),/=[} )" +DEPEND="${RDEPEND} + virtual/pkgconfig + static? ( ${LIB_DEPEND} )" +RDEPEND+=" !sys-boot/grub:2[-multislot]" + +pkg_setup() { + case $(tc-arch) in + amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;; + esac +} + +src_prepare() { + # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as + # discovered in bug 160801. We can change this, however, using larger values + # for this variable means that Grub needs more memory to run and boot. For a + # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom + # value in make.conf, it is possible to make kernels ~16Mb in size, but it + # needs the kitchen sink built-in. + local t="custom" + if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then + case $(tc-arch) in + amd64) GRUB_MAX_KERNEL_SIZE=9 ;; + x86) GRUB_MAX_KERNEL_SIZE=5 ;; + esac + t="default" + fi + einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)" + + sed -i \ + -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \ + "${S}"/grub/asmstub.c \ + || die + + # gcc-6 and above doesnt have a '-nopie' option patched in, use upstream's -fno-pie + if [[ tc-is-gcc && $(gcc-major-version) -gt 5 ]]; then + sed -i 's/-nopie/-fno-pie/' \ + "${WORKDIR}"/patch/860_all_grub-0.97-pie-r1.patch \ + || die + fi + + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch + # bug 564890, 566638 + epatch "${FILESDIR}"/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch + epatch "${FILESDIR}"/grub-0.97-ncurses-pkgconfig.patch + + eapply_user + + rm -f "${S}"/aclocal.m4 # seems to keep bug 418287 away + eautoreconf +} + +src_configure() { + filter-flags -fPIE #168834 + + use amd64 && multilib_toolchain_setup x86 + + unset BLOCK_SIZE #73499 + + ### i686-specific code in the boot loader is a bad idea; disabling to ensure + ### at least some compatibility if the hard drive is moved to an older or + ### incompatible system. + + # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2, + # but the objcopy's (faulty) test fails if -fstack-protector is default. + # create a cache telling configure that objcopy is ok, and add -C to econf + # to make use of the cache. + # + # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails. + # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites + # -fno-stack-protector detected by configure, removed from netboot's emake. + use custom-cflags || unset CFLAGS + + tc-ld-disable-gold #439082 #466536 #526348 + + export grub_cv_prog_objcopy_absolute=yes #79734 + use static && append-ldflags -static + + if use amd64 && use static ; then + if [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] ; then + eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This" + eerror "is specifically intended for building the tarballs for the" + eerror "grub-static package via USE='static -ncurses'." + eerror "All bets are now off." + fi + fi + + # build the net-bootable grub first, but only if "netboot" is set + if use netboot ; then + mkdir -p "${WORKDIR}"/netboot + pushd "${WORKDIR}"/netboot >/dev/null + ECONF_SOURCE=${S} \ + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + --enable-diskless \ + --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ + --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ + --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ + --enable-{tulip,via-rhine,w89c840} + popd >/dev/null + fi + + # Now build the regular grub + # Note that FFS and UFS2 support are broken for now - stage1_5 files too big + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + $(use_with ncurses curses) + + # sanity check due to common failure + use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found" +} + +src_compile() { + use netboot && emake -C "${WORKDIR}"/netboot w89c840_o_CFLAGS="-O" + emake +} + +src_test() { + # non-default block size also give false pass/fails. + unset BLOCK_SIZE + emake -j1 check +} + +src_install() { + local _stage2_file="${S}/stage2/stage2" + if [[ -f "${_stage2_file}" ]]; then + local _stage2_filesize=$(stat -c '%s' "${_stage2_file}" 2>/dev/null) + if [[ -z "${_stage2_filesize}" ]]; then + ewarn "Sanity check skipped -- 'stat' returned nothing" + elif [[ "${_stage2_filesize}" -gt 1000000 ]]; then + eerror "Sanity check failed: stage2 (${_stage2_file}) is larger than 1MB (${_stage2_filesize} bytes)!" + eerror "Please check your CFLAGS and/or file a bug report at https://bugs.gentoo.org." + die "stage2 sanity check failed" + else + einfo "stage2 sanity check passed" + fi + else + ewarn "Sanity check skipped -- no stage2 found" + fi + + default + if use netboot ; then + exeinto /usr/lib/grub/${CHOST} + doexe "${WORKDIR}"/netboot/stage2/{nbgrub,pxegrub} + newexe "${WORKDIR}"/netboot/stage2/stage2 stage2.netboot + fi + + pax-mark -m "${D}"/sbin/grub #330745 + + newdoc docs/menu.lst grub.conf.sample + dodoc "${FILESDIR}"/grub.conf.gentoo + + [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] && \ + mv "${D}"/usr/share/doc/{${PF},grub-static-${PF/grub-}} + + insinto /usr/share/grub + doins "${DISTDIR}"/splash.xpm.gz +} + +setup_boot_dir() { + local boot_dir=$1 + local dir=${boot_dir} + + mkdir -p "${dir}" + [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" + dir="${dir}/grub" + if [[ ! -e ${dir} ]] ; then + mkdir "${dir}" || die + fi + + # change menu.lst to grub.conf + if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then + mv -f "${dir}"/menu.lst "${dir}"/grub.conf + ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" + echo + fi + + if [[ ! -e ${dir}/menu.lst ]]; then + einfo "Linking from new grub.conf name to menu.lst" + ln -snf grub.conf "${dir}"/menu.lst + fi + + if [[ -e ${dir}/stage2 ]] ; then + mv "${dir}"/stage2{,.old} + ewarn "*** IMPORTANT NOTE: you must run grub and install" + ewarn "the new version's stage1 to your MBR. Until you do," + ewarn "stage1 and stage2 will still be the old version, but" + ewarn "later stages will be the new version, which could" + ewarn "cause problems such as an unbootable system." + ewarn + ewarn "This means you must use either grub-install or perform" + ewarn "root/setup manually." + ewarn + ewarn "For more help, see the wiki:" + ewarn "https://wiki.gentoo.org/wiki/GRUB" + echo + fi + + einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}" + for x in \ + "${ROOT}"/lib*/grub/*/* \ + "${ROOT}"/usr/share/grub/* ; do + [[ -f ${x} ]] && cp -p "${x}" "${dir}"/ + done + + if [[ ! -e ${dir}/grub.conf ]] ; then + s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" + [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf + [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf + [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf + fi + + # Per bug 218599, we support grub.conf.install for users that want to run a + # specific set of Grub setup commands rather than the default ones. + grub_config=${dir}/grub.conf.install + [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf + if [[ -e ${grub_config} ]] ; then + egrep \ + -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ + "${grub_config}" | \ + /sbin/grub --batch \ + --device-map="${dir}"/device.map \ + > /dev/null + fi + + # the grub default commands silently piss themselves if + # the default file does not exist ahead of time + if [[ ! -e ${dir}/default ]] ; then + grub-set-default --root-directory="${boot_dir}" default + fi + einfo "Grub has been installed to ${boot_dir} successfully." +} + +pkg_postinst() { + mount-boot_mount_boot_partition + + if [[ -n ${DONT_MOUNT_BOOT} ]]; then + elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" + elog "the following instructions for your /boot!" + elog "Neglecting to do so may cause your system to fail to boot!" + elog + else + setup_boot_dir "${ROOT}"/boot + # Trailing output because if this is run from pkg_postinst, it gets mixed into + # the other output. + einfo "" + fi + elog "To interactively install grub files to another device such as a USB" + elog "stick, just run the following and specify the directory as prompted:" + elog " emerge --config =${PF}" + elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" + elog "grub where to install in a non-interactive way." + + # needs to be after we call setup_boot_dir + mount-boot_pkg_postinst +} + +pkg_config() { + local dir + if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then + einfo "Enter the directory where you want to setup grub:" + read dir + else + dir="${GRUB_ALT_INSTALLDIR}" + fi + setup_boot_dir "${dir}" +} diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml new file mode 100644 index 0000000..b624728 --- /dev/null +++ b/sys-boot/grub/metadata.xml @@ -0,0 +1,43 @@ + + + + + floppym@gentoo.org + Mike Gilbert + GRUB2 only - do not assign bugs related to GRUB Legacy (0.97) + + + axs@gentoo.org + Ian Stakenvicius + GRUB-Legacy only - do not assign bugs related to GRUB2 + + + base-system@gentoo.org + Gentoo Base System + + + + Enable support for device-mapper from sys-fs/lvm2 + + + Build and install the efiemu runtimes + + Build and install fonts for the gfxterm module + + Build and install the grub-mount utility + + + Enable support for sys-fs/zfs + + + Allow concurrent installation of sys-boot/grub SLOT 0 and + sys-boot/grub SLOT 2 by renaming all programs. + + Enable network booting + Build and install GRUB themes (starfield) + Build and install grub-mkfont conversion utility + + + dejavu + + -- 2.43.2