summaryrefslogtreecommitdiff
path: root/sys-boot/grub
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
commit677b7ba5c317778df2ad7e70df94b9b7eec4adbc (patch)
tree6c418a1546fff5becab5d8b9ed6803323e7f316e /sys-boot/grub
parentfbda87924e6faa7a1919f1a2b4182490bde5ec5c (diff)
gentoo resync : 10.09.2021
Diffstat (limited to 'sys-boot/grub')
-rw-r--r--sys-boot/grub/Manifest9
-rw-r--r--sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch13
-rw-r--r--sys-boot/grub/files/grub-2.06-xfs-v4.patch120
-rw-r--r--sys-boot/grub/grub-2.06-r1.ebuild (renamed from sys-boot/grub/grub-2.06.ebuild)4
-rw-r--r--sys-boot/grub/grub-2.06_rc1.ebuild300
-rw-r--r--sys-boot/grub/grub-9999.ebuild5
6 files changed, 138 insertions, 313 deletions
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
index fa62aec8a582..0ec8a291fe8d 100644
--- a/sys-boot/grub/Manifest
+++ b/sys-boot/grub/Manifest
@@ -1,12 +1,11 @@
AUX gfxpayload.patch 1118 BLAKE2B 4104fc696535b1c3feba5876bccc64f9b2e52319ee992c59e7f17b8310cc9addf7545630fff78c73ca3f4b0dcd44e1bf69f4df5264d6f58777f7e5aeae93cbcb SHA512 00324825c369902a0383b792cd21e161853eadccbdc5abe2420f2d443bf6a74f72be6c15243107b936acd38c3547387c3771dc2cb566003c4c754c9260b4aa00
-AUX grub-2.02_beta2-KERNEL_GLOBS.patch 2121 BLAKE2B 398195f59537d40a4f61eadf5be974b8f9eb56a4eb07b798f0dc18e29588b3a9f8daa8d6e64980a835ec1960fab60b8c96d6552ef2920fe6604170abf7d5e7da SHA512 f85bc538ae647c46efbe07d7b87acf49daa7b07e9752af3aa3f77019f48ea24cd1b6a095a6f9c19d50128701753f453c531b9b068e11ee22a259f3fdf8ac205e
+AUX grub-2.02_beta2-KERNEL_GLOBS.patch 2355 BLAKE2B c120f06d3597a2ff9566778afd69d80a814904726e47766b7582626d182a2703e54fd69ecf00b54bcc5541e22a3d93ff8b85c9cf8d0440623454e8e7da3aaa91 SHA512 23416ac17838f101ed73103af6aa7305609667f47288bfa3bd5ae80d1123da664ba6f9b518451b0bd5f528e069893a51444d203953be0b0644790cea0b4b9cf0
AUX grub-2.06-test-words.patch 2553 BLAKE2B 21d6167945b461be7cc73198451ae0dc15ce0dfe2a301342f1a3bb75d6fcb5d73da9997fb8a93f36dffb43a351f056a1a4db9eed3147b0f3e77c65034b805c64 SHA512 627422377bdad97d0197f178814d6616a0f7ec07357182b00166a455d38ba0c5a60185c5febf4dfb7a11b35f26c7af607508cb5f418acdb7290517240fbd99e4
+AUX grub-2.06-xfs-v4.patch 4440 BLAKE2B 8682d2b9520f96b098160d431906059537a6d09f4af36e4e8453e9fd821f774f49db50b24c16f650eff3ac69848573ed9a988859426829ef5b9f43c7189eead2 SHA512 743203685dca932f2f6c3d6fa85cef8631cfe8dae4afc25e7cfd50de6351e3f5974d4dded5127efb3d7f3b0cf94b60c5435135f05c6c4d9a90eb724b40076dbb
AUX grub.default-3 2528 BLAKE2B c32de43644eca5fae8d8d727ff443600917a93e015f8a83dde555e3bca7506a817b08a2fc926970eeb5b7f40028f4951c6cdcd281f9fc0b6504f26c8e76bf0c5 SHA512 505960e62b44c70af0a90c7ff486bd57101831d7c6e9d80084013e374070ff02b40f77b0790aebb926e1e0854e375867cba1d4977dbb00c2ba54ebaa9f6a1a0b
DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae
DIST grub-2.06.tar.xz 6581924 BLAKE2B 2a40b9b03d7bb3b9e7b1309ab274d686f01b3c42e7035ebc6e5a0e59a59c3b7362ba518341664b314cb0dbc8222bb10ea05ce09f08ce9d58a293207cb909e417 SHA512 4f11c648f3078567e53fc0c74d5026fdc6da4be27d188975e79d9a4df817ade0fe5ad2ddd694238a07edc45adfa02943d83c57767dd51548102b375e529e8efe
-DIST grub-2.06~rc1.tar.xz 6543784 BLAKE2B 2cd322db808e09533aa91db3e03147896f3f8a2fb6bcc932161aace2f1bab9fd1ceb8b56eddf2e531413932c1ef407cdaf5aae49c0b26e7c6c308dbf7916685d SHA512 093890b0af71b0d346afb415dec106681fd9e3f2f5bda14093c060b861d55ee1b50c8fb24afd072d24968ebebedde290f8220b0374cbd2b2e4508dfb00924122
DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0
-EBUILD grub-2.06.ebuild 7362 BLAKE2B dd0a753ecc3b64d295a3851742473b229b9ea81c462b92da5020afa692cf8660027379d6958baf85f9c4e4bd71e4d915f723964ea74ff827c6bfcaa9bcbfcc25 SHA512 5a2242829da3d8dddd318bff2f21199e4a7404aaa422bc26cf6cf611ddc8a25f851854291a9e98bdbd82f41fa61aae37fb73dba4ac9b2ff32b5482bbfab3cc3f
-EBUILD grub-2.06_rc1.ebuild 7363 BLAKE2B 05ad610342f66df2bbe11b95fac11a166cf69bf6bad369b0db969d8373eeb33e21a65059cfb60d282ff92d1a0453a06a7a56ddcd7e9e36a3fc66b052883474ce SHA512 3bf9b3f77426d3bf5c20205a57c14dfe8d8779f3df9ffeaf496e8a4b0608f3194ba63c258a4ae47dab6d9e2997a5efba843d8890f9032e0e75566a4d53b50718
-EBUILD grub-9999.ebuild 7368 BLAKE2B c1141f6d92ae6d72258e3e736cd36c04057b78125d8c78a20b6cc302f6409ba9ac31f6ef889883a81b6062f76d74e64ad1056cc2374845321dc79849c2ca1414 SHA512 a770511ee292233da2499ccc41ca5c6ec5be454ec1fbf76e8d3c7db2cfe7f576fb659d5ec652a1d06b8b6a4b1dff9f645c24694cbb30dd4b4395fe90d7710008
+EBUILD grub-2.06-r1.ebuild 7370 BLAKE2B b8fbde4a4740daf71ad2408640db6e5c632c26a59d6241736f813f6ea9f7676a07b8c7410e1beedd713e8c03d2fa71f815b1b17f6c3efb2931c772a527379324 SHA512 74173d1141e5e1ceee9dc1dc81e53dd25fc8e6c5ccdc34e266b6b3955abe876b0a24e57c492b49983c52f20d393f4bba92d1e7b5ca7ef62aa31cdda99f33fe6b
+EBUILD grub-9999.ebuild 7330 BLAKE2B 008fe6d1b8e3f7ee9f693214a06f769a4fb68c54615a4bf9d6aee0c11bc388e4c0a09a0b277e8c6ae8a321349fcfd26c3a9ac82123bb20e3877bb47f0edf4856 SHA512 900c2039f7ffd1982cb6bdcb9752a24003db825d6e838e1e5f10aa248993a6d9ee88eb40c416feb40acc94e750f74f6331203572da5d0f1c9e45e5b33c3cdc2a
MISC metadata.xml 985 BLAKE2B 36f108b5d3441f8576609c77ab3547c60ac2c508b55472bd0ec0e3af8d0fa018d305d7267c0e2e84c8526affced9ed5ce51738b9fcf05b31ac36c1b4d5c2702a SHA512 bd28dd88d4eb76a32cfa757eb5bf7641d033f670280ab7230b72a66b1bd8fd65c777473b1d7f81257004a215fe5a858a79a6a912e0ceaecd586867e9a76f6b4e
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-xfs-v4.patch b/sys-boot/grub/files/grub-2.06-xfs-v4.patch
new file mode 100644
index 000000000000..fe8223780384
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-xfs-v4.patch
@@ -0,0 +1,120 @@
+From a4b495520e4dc41a896a8b916a64eda9970c50ea Mon Sep 17 00:00:00 2001
+From: Erwan Velu <erwanaliasr1@gmail.com>
+Date: Wed, 25 Aug 2021 15:31:52 +0200
+Subject: fs/xfs: Fix unreadable filesystem with v4 superblock
+
+The commit 8b1e5d193 (fs/xfs: Add bigtime incompat feature support)
+introduced the bigtime support by adding some features in v3 inodes.
+This change extended grub_xfs_inode struct by 76 bytes but also changed
+the computation of XFS_V2_INODE_SIZE and XFS_V3_INODE_SIZE. Prior this
+commit, XFS_V2_INODE_SIZE was 100 bytes. After the commit it's 84 bytes
+XFS_V2_INODE_SIZE becomes 16 bytes too small.
+
+As a result, the data structures aren't properly aligned and the GRUB
+generates "attempt to read or write outside of partition" errors when
+trying to read the XFS filesystem:
+
+ GNU GRUB version 2.11
+ ....
+ grub> set debug=efi,gpt,xfs
+ grub> insmod part_gpt
+ grub> ls (hd0,gpt1)/
+ partmap/gpt.c:93: Read a valid GPT header
+ partmap/gpt.c:115: GPT entry 0: start=4096, length=1953125
+ fs/xfs.c:931: Reading sb
+ fs/xfs.c:270: Validating superblock
+ fs/xfs.c:295: XFS v4 superblock detected
+ fs/xfs.c:962: Reading root ino 128
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:515: Reading inode (739521961424144223) - 344365866970255880, 3840
+ error: attempt to read or write outside of partition.
+
+This commit change the XFS_V2_INODE_SIZE computation by subtracting 76
+bytes instead of 92 bytes from the actual size of grub_xfs_inode struct.
+This 76 bytes value comes from added members:
+ 20 grub_uint8_t unused5
+ 1 grub_uint64_t flags2
+ 48 grub_uint8_t unused6
+
+This patch explicitly splits the v2 and v3 parts of the structure.
+The unused4 is still ending of the v2 structures and the v3 starts
+at unused5. Thanks to this we will avoid future corruptions of v2
+or v3 inodes.
+
+The XFS_V2_INODE_SIZE is returning to its expected size and the
+filesystem is back to a readable state:
+
+ GNU GRUB version 2.11
+ ....
+ grub> set debug=efi,gpt,xfs
+ grub> insmod part_gpt
+ grub> ls (hd0,gpt1)/
+ partmap/gpt.c:93: Read a valid GPT header
+ partmap/gpt.c:115: GPT entry 0: start=4096, length=1953125
+ fs/xfs.c:931: Reading sb
+ fs/xfs.c:270: Validating superblock
+ fs/xfs.c:295: XFS v4 superblock detected
+ fs/xfs.c:962: Reading root ino 128
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:931: Reading sb
+ fs/xfs.c:270: Validating superblock
+ fs/xfs.c:295: XFS v4 superblock detected
+ fs/xfs.c:962: Reading root ino 128
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:515: Reading inode (128) - 64, 0
+ fs/xfs.c:515: Reading inode (131) - 64, 768
+ efi/ fs/xfs.c:515: Reading inode (3145856) - 1464904, 0
+ grub2/ fs/xfs.c:515: Reading inode (132) - 64, 1024
+ grub/ fs/xfs.c:515: Reading inode (139) - 64, 2816
+ grub>
+
+Fixes: 8b1e5d193 (fs/xfs: Add bigtime incompat feature support)
+
+Signed-off-by: Erwan Velu <e.velu@criteo.com>
+Tested-by: Carlos Maiolino <cmaiolino@redhat.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ grub-core/fs/xfs.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
+index 0f524c3a8..e3816d1ec 100644
+--- a/grub-core/fs/xfs.c
++++ b/grub-core/fs/xfs.c
+@@ -192,6 +192,11 @@ struct grub_xfs_time_legacy
+ grub_uint32_t nanosec;
+ } GRUB_PACKED;
+
++/*
++ * The struct grub_xfs_inode layout was taken from the
++ * struct xfs_dinode_core which is described here:
++ * https://mirrors.edge.kernel.org/pub/linux/utils/fs/xfs/docs/xfs_filesystem_structure.pdf
++ */
+ struct grub_xfs_inode
+ {
+ grub_uint8_t magic[2];
+@@ -208,14 +213,15 @@ struct grub_xfs_inode
+ grub_uint32_t nextents;
+ grub_uint16_t unused3;
+ grub_uint8_t fork_offset;
+- grub_uint8_t unused4[37];
++ grub_uint8_t unused4[17]; /* Last member of inode v2. */
++ grub_uint8_t unused5[20]; /* First member of inode v3. */
+ grub_uint64_t flags2;
+- grub_uint8_t unused5[48];
++ grub_uint8_t unused6[48]; /* Last member of inode v3. */
+ } GRUB_PACKED;
+
+ #define XFS_V3_INODE_SIZE sizeof(struct grub_xfs_inode)
+-/* Size of struct grub_xfs_inode until fork_offset (included). */
+-#define XFS_V2_INODE_SIZE (XFS_V3_INODE_SIZE - 92)
++/* Size of struct grub_xfs_inode v2, up to unused4 member included. */
++#define XFS_V2_INODE_SIZE (XFS_V3_INODE_SIZE - 76)
+
+ struct grub_xfs_dirblock_tail
+ {
+--
+cgit v1.2.1
+
diff --git a/sys-boot/grub/grub-2.06.ebuild b/sys-boot/grub/grub-2.06-r1.ebuild
index f5286ca3d6b9..09e5054052a6 100644
--- a/sys-boot/grub/grub-2.06.ebuild
+++ b/sys-boot/grub/grub-2.06-r1.ebuild
@@ -19,7 +19,7 @@ if [[ -n ${GRUB_AUTORECONF} ]]; then
inherit autotools
fi
-inherit bash-completion-r1 flag-o-matic multibuild optfeature pax-utils toolchain-funcs
+inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs
if [[ ${PV} != 9999 ]]; then
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
@@ -38,6 +38,7 @@ else
fi
PATCHES=(
+ "${FILESDIR}"/grub-2.06-xfs-v4.patch
"${FILESDIR}"/gfxpayload.patch
"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
"${FILESDIR}"/grub-2.06-test-words.patch
@@ -68,7 +69,6 @@ REQUIRED_USE="
BDEPEND="
${PYTHON_DEPS}
- app-misc/pax-utils
sys-devel/flex
sys-devel/bison
sys-apps/help2man
diff --git a/sys-boot/grub/grub-2.06_rc1.ebuild b/sys-boot/grub/grub-2.06_rc1.ebuild
deleted file mode 100644
index fc1d54cc1cbd..000000000000
--- a/sys-boot/grub/grub-2.06_rc1.ebuild
+++ /dev/null
@@ -1,300 +0,0 @@
-# Copyright 1999-2021 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_{6,7,8,9}} )
- inherit python-any-r1
-fi
-
-if [[ -n ${GRUB_AUTORECONF} ]]; then
- WANT_LIBTOOL=none
- inherit autotools
-fi
-
-inherit bash-completion-r1 flag-o-matic multibuild optfeature 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="https://alpha.gnu.org/gnu/${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 ~ia64 ppc ppc64 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}"/grub-2.06-test-words.patch
-)
-
-DEJAVU=dejavu-sans-ttf-2.37
-UNIFONT=unifont-12.1.02
-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+ 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 xen-pvh )
-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 )
-"
-DEPEND="
- app-arch/xz-utils
- >=sys-libs/ncurses-5.2-r5:0=
- grub_platforms_emu? (
- 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 )
-"
-RDEPEND="${DEPEND}
- kernel_linux? (
- grub_platforms_efi-32? ( sys-boot/efibootmgr )
- grub_platforms_efi-64? ( sys-boot/efibootmgr )
- )
- !sys-boot/grub:0
- nls? ( sys-devel/gettext )
-"
-
-RESTRICT="!test? ( test )"
-
-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
- 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
-
- 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
- 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-pvh) platform=xen_pvh ;;
- 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
- $(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
-
- 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 BUILD_PKG_CONFIG
-
- 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
-
- # https://bugs.gentoo.org/231935
- dostrip -x /usr/lib/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
- 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
- fi
-
- if has_version sys-boot/os-prober; then
- ewarn "Due to security concerns, os-prober is disabled by default."
- ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
- fi
-}
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index 8046d169817d..119378453e6b 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -8,7 +8,7 @@ if [[ ${PV} == 9999 ]]; then
GRUB_BOOTSTRAP=1
fi
-PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} )
+PYTHON_COMPAT=( python3_{8..10} )
WANT_LIBTOOL=none
if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
@@ -19,7 +19,7 @@ if [[ -n ${GRUB_AUTORECONF} ]]; then
inherit autotools
fi
-inherit bash-completion-r1 flag-o-matic multibuild optfeature pax-utils toolchain-funcs
+inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs
if [[ ${PV} != 9999 ]]; then
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
@@ -68,7 +68,6 @@ REQUIRED_USE="
BDEPEND="
${PYTHON_DEPS}
- app-misc/pax-utils
sys-devel/flex
sys-devel/bison
sys-apps/help2man