public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2018-06-26 14:45 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2018-06-26 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     74dfccb5ec0da32830673621abcce6e156177b83
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 26 14:44:54 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jun 26 14:45:15 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74dfccb5

sys-boot/grub: support XFS sparse inodes

Closes: https://bugs.gentoo.org/659242
Package-Manager: Portage-2.3.40_p15, Repoman-2.3.9_p247

 sys-boot/grub/files/2.02-xfs-sparse-inodes.patch |  60 +++++
 sys-boot/grub/grub-2.02-r2.ebuild                | 312 +++++++++++++++++++++++
 2 files changed, 372 insertions(+)

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 00000000000..6c6a750b42f
--- /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 <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/grub-2.02-r2.ebuild b/sys-boot/grub/grub-2.02-r2.ebuild
new file mode 100644
index 00000000000..bc92a886e21
--- /dev/null
+++ b/sys-boot/grub/grub-2.02-r2.ebuild
@@ -0,0 +1,312 @@
+# Copyright 1999-2018 Gentoo Foundation
+# 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_3,3_4,3_5} )
+	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 ~arm64 ~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
+)
+
+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="debug 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=
+	debug? (
+		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 sys-apps/powerpc-utils )
+	ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+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 debug mm-debug)
+		$(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 sdl && use_enable debug 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
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2024-04-11 19:40 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2024-04-11 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     597323aae87e1857d2c048dde3450e3c3c0c92c7
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 11 19:39:11 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Apr 11 19:40:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=597323aa

sys-boot/grub: add workaround for fwsetup issue

Bug: https://bugs.gentoo.org/925370
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/grub-2.12-fwsetup.patch        | 38 ++++++++++++++++++++++
 .../{grub-2.12-r3.ebuild => grub-2.12-r4.ebuild}   |  1 +
 2 files changed, 39 insertions(+)

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/grub-2.12-r3.ebuild b/sys-boot/grub/grub-2.12-r4.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.12-r3.ebuild
rename to sys-boot/grub/grub-2.12-r4.ebuild
index cfeaf9fca9f8..fe97c8b890c1 100644
--- a/sys-boot/grub/grub-2.12-r3.ebuild
+++ b/sys-boot/grub/grub-2.12-r4.ebuild
@@ -162,6 +162,7 @@ src_prepare() {
 		"${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
 	)
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2023-07-11 14:25 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2023-07-11 14:25 UTC (permalink / raw
  To: gentoo-commits

commit:     71cf29063b3a3fb9d7b548d7ed50d62f1e8845a5
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 11 14:21:44 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jul 11 14:25:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71cf2906

sys-boot/grub: fix grub.d/25_bli on split-usr

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...b.d-25_bli.in-fix-shebang-on-unmerged-usr.patch | 31 ++++++++++++++++++++++
 ...rub-2.12_rc1.ebuild => grub-2.12_rc1-r1.ebuild} |  1 +
 2 files changed, 32 insertions(+)

diff --git a/sys-boot/grub/files/grub-2.12_rc1-util-grub.d-25_bli.in-fix-shebang-on-unmerged-usr.patch b/sys-boot/grub/files/grub-2.12_rc1-util-grub.d-25_bli.in-fix-shebang-on-unmerged-usr.patch
new file mode 100644
index 000000000000..6c5096d35e70
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.12_rc1-util-grub.d-25_bli.in-fix-shebang-on-unmerged-usr.patch
@@ -0,0 +1,31 @@
+From f827aac60d760a026db642b9d5c1ecbf587cfefc Mon Sep 17 00:00:00 2001
+From: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
+Date: Mon, 10 Jul 2023 23:55:43 -0500
+Subject: [PATCH] util/grub.d/25_bli.in: fix shebang on unmerged-usr
+
+On an unmerged-usr system, grub-mkconfig errors out with the following
+error due to /usr/bin/sh not existing:
+
+/usr/sbin/grub-mkconfig: /etc/grub.d/25_bli: /usr/bin/sh: bad interpreter: No such file or directory
+
+Use a /bin/sh shebang to fix the error as well as match the other
+existing files.
+
+Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
+---
+ util/grub.d/25_bli.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/grub.d/25_bli.in b/util/grub.d/25_bli.in
+index 6e4538716..26e27a019 100644
+--- a/util/grub.d/25_bli.in
++++ b/util/grub.d/25_bli.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/sh
++#! /bin/sh
+ set -e
+ 
+ # grub-mkconfig helper script.
+-- 
+2.41.0
+

diff --git a/sys-boot/grub/grub-2.12_rc1.ebuild b/sys-boot/grub/grub-2.12_rc1-r1.ebuild
similarity index 98%
rename from sys-boot/grub/grub-2.12_rc1.ebuild
rename to sys-boot/grub/grub-2.12_rc1-r1.ebuild
index 96f3d98c6f01..ba4eb3b5a34b 100644
--- a/sys-boot/grub/grub-2.12_rc1.ebuild
+++ b/sys-boot/grub/grub-2.12_rc1-r1.ebuild
@@ -54,6 +54,7 @@ PATCHES=(
 	"${FILESDIR}"/gfxpayload.patch
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
 	"${FILESDIR}"/grub-2.06-test-words.patch
+	"${FILESDIR}"/grub-2.12_rc1-util-grub.d-25_bli.in-fix-shebang-on-unmerged-usr.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.37


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2023-05-09 20:23 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2023-05-09 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     939f10540fec60b4b22708ebd89610d95ff2097d
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue May  9 20:22:13 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue May  9 20:22:13 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=939f1054

sys-boot/grub: backport build fix for RISCV

Closes: https://bugs.gentoo.org/905785
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/grub-2.06-riscv.patch | 49 +++++++++++++++++++++++++++++++
 sys-boot/grub/grub-2.06-r6.ebuild         |  1 +
 2 files changed, 50 insertions(+)

diff --git a/sys-boot/grub/files/grub-2.06-riscv.patch b/sys-boot/grub/files/grub-2.06-riscv.patch
new file mode 100644
index 000000000000..83c54375704b
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-riscv.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/905785
+
+From 049efdd72eb7baa7b2bf8884391ee7fe650da5a0 Mon Sep 17 00:00:00 2001
+From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
+Date: Sat, 29 Jan 2022 13:36:55 +0100
+Subject: RISC-V: Adjust -march flags for binutils 2.38
+
+As of version 2.38 binutils defaults to ISA specification version
+2019-12-13. This version of the specification has has separated the
+the csr read/write (csrr*/csrw*) instructions and the fence.i from
+the I extension and put them into separate Zicsr and Zifencei
+extensions.
+
+This implies that we have to adjust the -march flag passed to the
+compiler accordingly.
+
+Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ configure.ac | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 4f649ed..5c01af0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -870,11 +870,19 @@ if test x"$platform" != xemu ; then
+        CFLAGS="$TARGET_CFLAGS -march=rv32imac -mabi=ilp32 -Werror"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ 		         [grub_cv_target_cc_soft_float="-march=rv32imac -mabi=ilp32"], [])
++       # ISA spec version 20191213 factored out extensions Zicsr and Zifencei
++       CFLAGS="$TARGET_CFLAGS -march=rv32imac_zicsr_zifencei -mabi=ilp32 -Werror"
++       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++		         [grub_cv_target_cc_soft_float="-march=rv32imac_zicsr_zifencei -mabi=ilp32"], [])
+     fi
+     if test "x$target_cpu" = xriscv64; then
+        CFLAGS="$TARGET_CFLAGS -march=rv64imac -mabi=lp64 -Werror"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ 		         [grub_cv_target_cc_soft_float="-march=rv64imac -mabi=lp64"], [])
++       # ISA spec version 20191213 factored out extensions Zicsr and Zifencei
++       CFLAGS="$TARGET_CFLAGS -march=rv64imac_zicsr_zifencei -mabi=lp64 -Werror"
++       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++		         [grub_cv_target_cc_soft_float="-march=rv64imac_zicsr_zifencei -mabi=lp64"], [])
+     fi
+     if test "x$target_cpu" = xia64; then
+        CFLAGS="$TARGET_CFLAGS -mno-inline-float-divide -mno-inline-sqrt -Werror"
+-- 
+cgit v1.1
+

diff --git a/sys-boot/grub/grub-2.06-r6.ebuild b/sys-boot/grub/grub-2.06-r6.ebuild
index ee01fcc6bfeb..707acec900be 100644
--- a/sys-boot/grub/grub-2.06-r6.ebuild
+++ b/sys-boot/grub/grub-2.06-r6.ebuild
@@ -62,6 +62,7 @@ PATCHES=(
 	"${FILESDIR}"/grub-2.06-grub-mkconfig-restore-umask.patch
 	"${FILESDIR}"/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch
 	"${FILESDIR}"/grub-2.06-fs-ext2-ignore-checksum-seed.patch
+	"${FILESDIR}"/grub-2.06-riscv.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.37


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2023-02-13 16:47 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2023-02-13 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     0df5fa7bfab97bfa594d214a78960f44a491bb22
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 13 16:30:22 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Feb 13 16:47:30 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0df5fa7b

sys-boot/grub: backport fix for ext4 checksum seed feature

Closes: https://bugs.gentoo.org/894200
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../grub-2.06-fs-ext2-ignore-checksum-seed.patch   | 62 ++++++++++++++++++++++
 .../{grub-2.06-r5.ebuild => grub-2.06-r6.ebuild}   |  1 +
 2 files changed, 63 insertions(+)

diff --git a/sys-boot/grub/files/grub-2.06-fs-ext2-ignore-checksum-seed.patch b/sys-boot/grub/files/grub-2.06-fs-ext2-ignore-checksum-seed.patch
new file mode 100644
index 000000000000..9024b479a878
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-fs-ext2-ignore-checksum-seed.patch
@@ -0,0 +1,62 @@
+https://bugs.gentoo.org/894200
+https://git.savannah.gnu.org/cgit/grub.git/patch/?id=7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763
+
+From 7fd5feff97c4b1f446f8fcf6d37aca0c64e7c763 Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javierm@redhat.com>
+Date: Fri, 11 Jun 2021 21:36:16 +0200
+Subject: fs/ext2: Ignore checksum seed incompat feature
+
+This incompat feature is used to denote that the filesystem stored its
+metadata checksum seed in the superblock. This is used to allow tune2fs
+changing the UUID on a mounted metdata_csum filesystem without having
+to rewrite all the disk metadata. However, the GRUB doesn't use the
+metadata checksum at all. So, it can just ignore this feature if it
+is enabled. This is consistent with the GRUB filesystem code in general
+which just does a best effort to access the filesystem's data.
+
+The checksum seed incompat feature has to be removed from the ignore
+list if the support for metadata checksum verification is added to the
+GRUB ext2 driver later.
+
+Suggested-by: Eric Sandeen <esandeen@redhat.com>
+Suggested-by: Lukas Czerner <lczerner@redhat.com>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Reviewed-by: Lukas Czerner <lczerner@redhat.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ grub-core/fs/ext2.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c
+index e7dd78e..4953a15 100644
+--- a/grub-core/fs/ext2.c
++++ b/grub-core/fs/ext2.c
+@@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
+ #define EXT4_FEATURE_INCOMPAT_64BIT		0x0080
+ #define EXT4_FEATURE_INCOMPAT_MMP		0x0100
+ #define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
++#define EXT4_FEATURE_INCOMPAT_CSUM_SEED		0x2000
+ #define EXT4_FEATURE_INCOMPAT_ENCRYPT          0x10000
+ 
+ /* The set of back-incompatible features this driver DOES support. Add (OR)
+@@ -123,10 +124,15 @@ GRUB_MOD_LICENSE ("GPLv3+");
+  * mmp:            Not really back-incompatible - was added as such to
+  *                 avoid multiple read-write mounts. Safe to ignore for this
+  *                 RO driver.
++ * checksum seed:  Not really back-incompatible - was added to allow tools
++ *                 such as tune2fs to change the UUID on a mounted metadata
++ *                 checksummed filesystem. Safe to ignore for now since the
++ *                 driver doesn't support checksum verification. However, it
++ *                 has to be removed from this list if the support is added later.
+  */
+ #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER \
+-				     | EXT4_FEATURE_INCOMPAT_MMP)
+-
++				     | EXT4_FEATURE_INCOMPAT_MMP \
++				     | EXT4_FEATURE_INCOMPAT_CSUM_SEED)
+ 
+ #define EXT3_JOURNAL_MAGIC_NUMBER	0xc03b3998U
+ 
+-- 
+cgit v1.1
+

diff --git a/sys-boot/grub/grub-2.06-r5.ebuild b/sys-boot/grub/grub-2.06-r6.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.06-r5.ebuild
rename to sys-boot/grub/grub-2.06-r6.ebuild
index 06b35f228a26..ce30e75b634b 100644
--- a/sys-boot/grub/grub-2.06-r5.ebuild
+++ b/sys-boot/grub/grub-2.06-r6.ebuild
@@ -61,6 +61,7 @@ PATCHES=(
 	"${FILESDIR}"/grub-2.06-test-words.patch
 	"${FILESDIR}"/grub-2.06-grub-mkconfig-restore-umask.patch
 	"${FILESDIR}"/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch
+	"${FILESDIR}"/grub-2.06-fs-ext2-ignore-checksum-seed.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.37


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2023-01-17 16:03 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2023-01-17 16:03 UTC (permalink / raw
  To: gentoo-commits

commit:     1087cf3bbb5bd0ae7fef283497aa19575a5e85e4
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 17 16:01:49 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 16:03:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1087cf3b

sys-boot/grub: set GRUB_DISABLE_LINUX_PARTUUID=false by default

Closes: https://bugs.gentoo.org/711072
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/grub.default-4 | 76 ++++++++++++++++++++++++++++++++++++++
 sys-boot/grub/grub-2.06-r5.ebuild  |  2 +-
 sys-boot/grub/grub-9999.ebuild     |  2 +-
 3 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/sys-boot/grub/files/grub.default-4 b/sys-boot/grub/files/grub.default-4
new file mode 100644
index 000000000000..35d3060137a9
--- /dev/null
+++ b/sys-boot/grub/files/grub.default-4
@@ -0,0 +1,76 @@
+# 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:
+#     'grub-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
+
+# 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
+
+# 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-2.06-r5.ebuild b/sys-boot/grub/grub-2.06-r5.ebuild
index 7267ddc5002b..06b35f228a26 100644
--- a/sys-boot/grub/grub-2.06-r5.ebuild
+++ b/sys-boot/grub/grub-2.06-r5.ebuild
@@ -297,7 +297,7 @@ 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

diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index cc531c4c9010..359da219ea62 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -290,7 +290,7 @@ 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


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2023-01-17 16:03 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2023-01-17 16:03 UTC (permalink / raw
  To: gentoo-commits

commit:     c382388940b194bf1a8bb1c4392394a699108165
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 17 15:53:27 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jan 17 16:03:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3823889

sys-boot/grub: backport fix for MBR images with clang

Closes: https://bugs.gentoo.org/889432
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...py-Remove-.interp-section-from-.img-files.patch |  31 ++
 sys-boot/grub/grub-2.06-r5.ebuild                  | 336 +++++++++++++++++++++
 2 files changed, 367 insertions(+)

diff --git a/sys-boot/grub/files/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch b/sys-boot/grub/files/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch
new file mode 100644
index 000000000000..8d543d4ea9b9
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.patch
@@ -0,0 +1,31 @@
+From 28ad1f9b95799afc94fa178ec935e297da94cced Mon Sep 17 00:00:00 2001
+From: Nicholas Vinson <nvinson234@gmail.com>
+Date: Fri, 13 Jan 2023 02:56:35 -0500
+Subject: [PATCH] gentpl.py: Remove .interp section from .img files.
+
+Whn building .img files, a .interp section from the .image files will
+sometimes be copied into the .img file. This additional section pushes
+the .img file beyond the 512-byte limit and causes grub-install to fail
+to run for i386-pc platforms.
+
+Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
+---
+ gentpl.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gentpl.py b/gentpl.py
+index c86550d4f..823a8b5f8 100644
+--- a/gentpl.py
++++ b/gentpl.py
+@@ -766,7 +766,7 @@ def image(defn, platform):
+ if test x$(TARGET_APPLE_LINKER) = x1; then \
+   $(MACHO2IMG) $< $@; \
+ else \
+-  $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property -R .ARM.exidx $< $@; \
++  $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .note.gnu.property -R .ARM.exidx -R .interp $< $@; \
+ fi
+ """)
+ 
+-- 
+2.39.0
+

diff --git a/sys-boot/grub/grub-2.06-r5.ebuild b/sys-boot/grub/grub-2.06-r5.ebuild
new file mode 100644
index 000000000000..7267ddc5002b
--- /dev/null
+++ b/sys-boot/grub/grub-2.06-r5.ebuild
@@ -0,0 +1,336 @@
+# Copyright 1999-2023 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
+
+GRUB_AUTOGEN=1
+GRUB_AUTORECONF=1
+PYTHON_COMPAT=( python3_{8..11} )
+WANT_LIBTOOL=none
+
+if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
+	inherit python-any-r1
+fi
+
+if [[ -n ${GRUB_AUTORECONF} ]]; then
+	inherit autotools
+fi
+
+inherit bash-completion-r1 flag-o-matic multibuild optfeature 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 ~riscv ~sparc ~x86"
+else
+	inherit git-r3
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git"
+fi
+
+SRC_URI+=" https://dev.gentoo.org/~floppym/dist/${P}-backports-r2.tar.xz"
+
+PATCHES=(
+	"${WORKDIR}/${P}-backports"
+	"${FILESDIR}"/gfxpayload.patch
+	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+	"${FILESDIR}"/grub-2.06-test-words.patch
+	"${FILESDIR}"/grub-2.06-grub-mkconfig-restore-umask.patch
+	"${FILESDIR}"/grub-2.06-gentpl.py-Remove-.interp-section-from-.img-files.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}
+	>=sys-devel/flex-2.5.35
+	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
+
+	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
+		FROM_BOOTSTRAP=1 ./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
+
+	# 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}
+	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
+
+	# Force configure to use flex & bison, bug 887211.
+	export LEX=flex
+	unset YACC
+
+	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 [[ -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
+				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
+	fi
+
+	if has_version 'sys-boot/grub:0'; then
+		elog "A migration guide for GRUB Legacy users is available:"
+		elog "    https://wiki.gentoo.org/wiki/GRUB2_Migration"
+	fi
+
+	if has_version sys-boot/os-prober; then
+		ewarn "Due to security concerns, os-prober is disabled by default."
+		ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it."
+	fi
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2022-09-16 23:10 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2022-09-16 23:10 UTC (permalink / raw
  To: gentoo-commits

commit:     012331665f6d5c6f2a48b6619c54f509cd791485
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 16 23:08:57 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Sep 16 23:10:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01233166

sys-boot/grub: backport fix for CVE-2021-3981

Bug: https://bugs.gentoo.org/835082
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../grub-2.06-grub-mkconfig-restore-umask.patch    | 41 ++++++++++++++++++++++
 .../{grub-2.06-r2.ebuild => grub-2.06-r3.ebuild}   |  1 +
 2 files changed, 42 insertions(+)

diff --git a/sys-boot/grub/files/grub-2.06-grub-mkconfig-restore-umask.patch b/sys-boot/grub/files/grub-2.06-grub-mkconfig-restore-umask.patch
new file mode 100644
index 000000000000..e2a6414ef05b
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.06-grub-mkconfig-restore-umask.patch
@@ -0,0 +1,41 @@
+From 0adec29674561034771c13e446069b41ef41e4d4 Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Fri, 3 Dec 2021 16:13:28 +0800
+Subject: grub-mkconfig: Restore umask for the grub.cfg
+
+The commit ab2e53c8a (grub-mkconfig: Honor a symlink when generating
+configuration by grub-mkconfig) has inadvertently discarded umask for
+creating grub.cfg in the process of running grub-mkconfig. The resulting
+wrong permission (0644) would allow unprivileged users to read GRUB
+configuration file content. This presents a low confidentiality risk
+as grub.cfg may contain non-secured plain-text passwords.
+
+This patch restores the missing umask and sets the creation file mode
+to 0600 preventing unprivileged access.
+
+Fixes: CVE-2021-3981
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ util/grub-mkconfig.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index c3ea761..62335d0 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -301,7 +301,10 @@ and /etc/grub.d/* files or please file a bug report with
+     exit 1
+   else
+     # none of the children aborted with error, install the new grub.cfg
++    oldumask=$(umask)
++    umask 077
+     cat ${grub_cfg}.new > ${grub_cfg}
++    umask $oldumask
+     rm -f ${grub_cfg}.new
+   fi
+ fi
+-- 
+cgit v1.1
+

diff --git a/sys-boot/grub/grub-2.06-r2.ebuild b/sys-boot/grub/grub-2.06-r3.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.06-r2.ebuild
rename to sys-boot/grub/grub-2.06-r3.ebuild
index 6373aeeb54b7..3331ce3f9b71 100644
--- a/sys-boot/grub/grub-2.06-r2.ebuild
+++ b/sys-boot/grub/grub-2.06-r3.ebuild
@@ -57,6 +57,7 @@ PATCHES=(
 	"${FILESDIR}"/gfxpayload.patch
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
 	"${FILESDIR}"/grub-2.06-test-words.patch
+	"${FILESDIR}"/grub-2.06-grub-mkconfig-restore-umask.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.37


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2021-09-07 17:28 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2021-09-07 17:28 UTC (permalink / raw
  To: gentoo-commits

commit:     e30b449f5df55dbb7b036639a39afc17972df03a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  7 17:08:24 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Sep  7 17:27:45 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e30b449f

sys-boot/grub: fix issue with XFS v4 superblocks

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/grub-2.06-xfs-v4.patch         | 120 +++++++++++++++++++++
 .../grub/{grub-2.06.ebuild => grub-2.06-r1.ebuild} |   1 +
 2 files changed, 121 insertions(+)

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 00000000000..fe822378038
--- /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
similarity index 99%
rename from sys-boot/grub/grub-2.06.ebuild
rename to sys-boot/grub/grub-2.06-r1.ebuild
index f5286ca3d6b..3c49ad5db1f 100644
--- a/sys-boot/grub/grub-2.06.ebuild
+++ b/sys-boot/grub/grub-2.06-r1.ebuild
@@ -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


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2021-03-14 18:36 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2021-03-14 18:36 UTC (permalink / raw
  To: gentoo-commits

commit:     d9d869c189d7475c5893e9cb56028784eede8e84
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 14 18:13:50 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Mar 14 18:36:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9d869c1

sys-boot/grub: bump to 2.06_rc1

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/Manifest                             |  1 +
 sys-boot/grub/files/grub-2.06-test-words.patch     | 25 ++++++++++++++++++++++
 .../{grub-9999.ebuild => grub-2.06_rc1.ebuild}     | 11 ++--------
 sys-boot/grub/grub-9999.ebuild                     | 11 ++--------
 4 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
index a3833c2a78f..34314f59641 100644
--- a/sys-boot/grub/Manifest
+++ b/sys-boot/grub/Manifest
@@ -1,4 +1,5 @@
 DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae
 DIST grub-2.04.tar.xz 6393864 BLAKE2B 413ffb9aaeae1ee3128032914ca426a1a5adb3737895dfe563fdde5a7e0386ac2dbc2f7ddfc4e0a67b3ad90494985d6886c20054b038701feb743e67e2eed9d0 SHA512 9c15c42d0cf5d61446b752194e3b628bb04be0fe6ea0240ab62b3d753784712744846e1f7c3651d8e0968d22012e6d713c38c44936d4004ded3ca4d4007babbb
 DIST grub-2.05_alpha20200310.tar.xz 6671372 BLAKE2B 2b9006fe486bb3195f34a3e5d34eaa923e1f295fbb7b815b0adf70ca3000531ff0c250c300f21103cf24144f9e51b96cefc860b7a46c6e31b96d4566db08b027 SHA512 7ddcb7524a4fa60754e3053aae4b033b17ffd740f220d3cbc1e25167ce823c42b1795b4767dabb8920027134769de8cacdafc9a6fe26b4d242590809e3db8725
+DIST grub-2.06~rc1.tar.xz 6543784 BLAKE2B 2cd322db808e09533aa91db3e03147896f3f8a2fb6bcc932161aace2f1bab9fd1ceb8b56eddf2e531413932c1ef407cdaf5aae49c0b26e7c6c308dbf7916685d SHA512 093890b0af71b0d346afb415dec106681fd9e3f2f5bda14093c060b861d55ee1b50c8fb24afd072d24968ebebedde290f8220b0374cbd2b2e4508dfb00924122
 DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0

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 00000000000..a3fe0602d2b
--- /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 nverivnreivrevnureiorfnfrvoeoiroireoireoifrefoieroifoireoifoirefoireoifoijfoirereoireoivoioirevoinvoinreoinvnoieoinreoinveoinveoinreoinvoineoinoinoineoinernoiveoinvreoiioewdioewoirvnoireoivfoirewfewoifoijewoijfoijewfoijfewoijoijoijoijoijoijoijfewrewfceniuewruevrewnuuireurevueurnievrewfnerfcnevirivinrewvnirewnivrewiuvcrewvnuewvrrrewniuerwreiuviurewiuviurewnuvewnvrenurnunuvrevuurer
 ejiremvreijnvcreivire 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/grub-9999.ebuild b/sys-boot/grub/grub-2.06_rc1.ebuild
similarity index 95%
copy from sys-boot/grub/grub-9999.ebuild
copy to sys-boot/grub/grub-2.06_rc1.ebuild
index 3ffe45ea343..bae070420bf 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-2.06_rc1.ebuild
@@ -9,7 +9,7 @@ if [[ ${PV} == 9999  ]]; then
 fi
 
 if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
-	PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
+	PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} )
 	inherit python-any-r1
 fi
 
@@ -39,6 +39,7 @@ 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
@@ -139,14 +140,6 @@ src_prepare() {
 
 	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

diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index 3ffe45ea343..bae070420bf 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -9,7 +9,7 @@ if [[ ${PV} == 9999  ]]; then
 fi
 
 if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then
-	PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
+	PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} )
 	inherit python-any-r1
 fi
 
@@ -39,6 +39,7 @@ 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
@@ -139,14 +140,6 @@ src_prepare() {
 
 	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


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2020-03-15 18:34 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2020-03-15 18:34 UTC (permalink / raw
  To: gentoo-commits

commit:     3233be5c67aa0e2569fc7fff05f6ac464bef2014
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 15 18:31:10 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Mar 15 18:34:44 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3233be5c

sys-boot/grub: remove old

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/Manifest                             |   4 -
 sys-boot/grub/files/2.02-X86_64_PLT32.patch        |  75 -----
 sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch     |  32 ---
 .../files/2.02-freetype-capitalise-variables.patch | 126 ---------
 sys-boot/grub/files/2.02-freetype-pkg-config.patch | 194 -------------
 sys-boot/grub/files/2.02-gcc8.patch                |  72 -----
 .../grub/files/2.02-multiple-early-initrd.patch    | 177 ------------
 sys-boot/grub/files/2.02-xfs-sparse-inodes.patch   |  60 ----
 sys-boot/grub/grub-2.02-r4.ebuild                  | 309 ---------------------
 sys-boot/grub/grub-2.05_alpha20200110.ebuild       | 287 -------------------
 sys-boot/grub/grub-2.05_alpha20200228.ebuild       | 287 -------------------
 sys-boot/grub/metadata.xml                         |   4 -
 12 files changed, 1627 deletions(-)

diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
index 6493cd098a8..a3833c2a78f 100644
--- a/sys-boot/grub/Manifest
+++ b/sys-boot/grub/Manifest
@@ -1,8 +1,4 @@
 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.05_alpha20200110.tar.xz 5452588 BLAKE2B ccf95644bc76f6be8e73a25e1b5f05e052ea5bc0c61896454c211fccaec6a714dbae10f7398aa1e9d7bf864efc68655708c102ba20cc1e40fecd3fa7d3d961f7 SHA512 b6e609edc4dcee5d9348d1d6d9ecfec5a759a284a1f82970b38f8aab0c8fa6b5dc69e532a1a264815208df5dae3bf409c2f73846893a8e3cb97187d0e0c7295c
-DIST grub-2.05_alpha20200228.tar.xz 6619176 BLAKE2B 15f45495bfffab71f9e4bccd0c60b48dcedfec7da650ceb3bc66f64ad7331e8ab1f786d04893d81b6c2e61dab6fa1ff47a29afcaa7f92bb478c4b18312311604 SHA512 28e42b0125283d0ef3d415a69699416e83e3ee32d60ffe092b0d03765d150579bd3fb218ed2bbf4877bd802012b409a502e86e825c0d22265252097d20449957
 DIST grub-2.05_alpha20200310.tar.xz 6671372 BLAKE2B 2b9006fe486bb3195f34a3e5d34eaa923e1f295fbb7b815b0adf70ca3000531ff0c250c300f21103cf24144f9e51b96cefc860b7a46c6e31b96d4566db08b027 SHA512 7ddcb7524a4fa60754e3053aae4b033b17ffd740f220d3cbc1e25167ce823c42b1795b4767dabb8920027134769de8cacdafc9a6fe26b4d242590809e3db8725
 DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0
-DIST unifont-9.0.06.pcf.gz 1360354 BLAKE2B 09b96e1711c729ef159d62e3ea7b289ca2d01dc0ea417e35a18b73dc02a23f62ce7821d9761bceee4002d9eeaabd91cfb69bbacc6fbdfdfa00445d18fe8f1d66 SHA512 dd0a1afa72f5204c62055d83f22750c74af38ffafdb8eda8e1f1cf7292e572a14969b8a9a6a2cb336d5bed4ab633f6b5a962c59117a590e4238788959cb82774

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 2c65cb78a5d..00000000000
--- 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 f20845d5a34..00000000000
--- 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 9aa7f54f32a..00000000000
--- 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 94437f073c4..00000000000
--- 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 51ee7dc86c2..00000000000
--- 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 74b576f8b00..00000000000
--- 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 6c6a750b42f..00000000000
--- 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/grub-2.02-r4.ebuild b/sys-boot/grub/grub-2.02-r4.ebuild
deleted file mode 100644
index e52a12f5f20..00000000000
--- a/sys-boot/grub/grub-2.02-r4.ebuild
+++ /dev/null
@@ -1,309 +0,0 @@
-# Copyright 1999-2020 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_{6,7}} )
-	inherit python-any-r1
-fi
-
-if [[ -n ${GRUB_AUTORECONF} ]]; then
-	WANT_LIBTOOL=none
-	inherit autotools
-fi
-
-inherit bash-completion-r1 eutils 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 ia64 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+ 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 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
-	)
-	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
-		$(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.05_alpha20200110.ebuild b/sys-boot/grub/grub-2.05_alpha20200110.ebuild
deleted file mode 100644
index b0e9cfe178b..00000000000
--- a/sys-boot/grub/grub-2.05_alpha20200110.ebuild
+++ /dev/null
@@ -1,287 +0,0 @@
-# Copyright 1999-2020 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}} )
-	inherit python-any-r1
-fi
-
-if [[ -n ${GRUB_AUTORECONF} ]]; then
-	WANT_LIBTOOL=none
-	inherit autotools
-fi
-
-inherit bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs
-
-if [[ ${PV} != 9999 ]]; then
-	SRC_URI="https://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
-	KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~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.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=
-	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 !sys-boot/grub-static
-	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/*"
-
-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-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 # 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
-
-	# 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
-		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.05_alpha20200228.ebuild b/sys-boot/grub/grub-2.05_alpha20200228.ebuild
deleted file mode 100644
index d11a7ec3e89..00000000000
--- a/sys-boot/grub/grub-2.05_alpha20200228.ebuild
+++ /dev/null
@@ -1,287 +0,0 @@
-# Copyright 1999-2020 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}} )
-	inherit python-any-r1
-fi
-
-if [[ -n ${GRUB_AUTORECONF} ]]; then
-	WANT_LIBTOOL=none
-	inherit autotools
-fi
-
-inherit bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs
-
-if [[ ${PV} != 9999 ]]; then
-	SRC_URI="https://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
-	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
-)
-
-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=
-	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 !sys-boot/grub-static
-	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/*"
-
-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-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 # 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
-
-	# 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
-		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/metadata.xml b/sys-boot/grub/metadata.xml
index 68e6175af8d..3e1c75953e4 100644
--- a/sys-boot/grub/metadata.xml
+++ b/sys-boot/grub/metadata.xml
@@ -23,10 +23,6 @@
 	<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>


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2019-07-23 13:21 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2019-07-23 13:21 UTC (permalink / raw
  To: gentoo-commits

commit:     d81d6a345cffb89a68d71df891c908c633f51d37
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 13:20:29 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 13:21:21 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d81d6a34

sys-boot/grub: backport fix for bios boot partition on sparc64

Package-Manager: Portage-2.3.68, Repoman-2.3.16_p2
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/2.04-sparc64-bios-boot.patch   | 50 ++++++++++++++++++++++
 .../grub/{grub-2.04.ebuild => grub-2.04-r1.ebuild} |  1 +
 2 files changed, 51 insertions(+)

diff --git a/sys-boot/grub/files/2.04-sparc64-bios-boot.patch b/sys-boot/grub/files/2.04-sparc64-bios-boot.patch
new file mode 100644
index 00000000000..8fd00d497ad
--- /dev/null
+++ b/sys-boot/grub/files/2.04-sparc64-bios-boot.patch
@@ -0,0 +1,50 @@
+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/grub-2.04.ebuild b/sys-boot/grub/grub-2.04-r1.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.04.ebuild
rename to sys-boot/grub/grub-2.04-r1.ebuild
index 07f21fac670..81bd769728c 100644
--- a/sys-boot/grub/grub-2.04.ebuild
+++ b/sys-boot/grub/grub-2.04-r1.ebuild
@@ -39,6 +39,7 @@ 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


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2019-06-24 18:34 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2019-06-24 18:34 UTC (permalink / raw
  To: gentoo-commits

commit:     cc7c5c7c914a5a240a3f15788ad125c58ab7271c
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 18:34:16 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 18:34:16 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc7c5c7c

sys-boot/grub: backport fix for efi

Closes: https://bugs.gentoo.org/688622
Package-Manager: Portage-2.3.67_p12, Repoman-2.3.14_p7
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch     | 32 ++++++++++++++++++++++
 .../{grub-2.02-r3.ebuild => grub-2.02-r4.ebuild}   |  1 +
 2 files changed, 33 insertions(+)

diff --git a/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch b/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch
new file mode 100644
index 00000000000..f20845d5a34
--- /dev/null
+++ b/sys-boot/grub/files/2.02-efi-tsc-pmtimer.patch
@@ -0,0 +1,32 @@
+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/grub-2.02-r3.ebuild b/sys-boot/grub/grub-2.02-r4.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.02-r3.ebuild
rename to sys-boot/grub/grub-2.02-r4.ebuild
index 343fae3197d..e7fdf86942f 100644
--- a/sys-boot/grub/grub-2.02-r3.ebuild
+++ b/sys-boot/grub/grub-2.02-r4.ebuild
@@ -44,6 +44,7 @@ PATCHES=(
 	"${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


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2018-09-01 22:07 Thomas Deutschmann
  0 siblings, 0 replies; 21+ messages in thread
From: Thomas Deutschmann @ 2018-09-01 22:07 UTC (permalink / raw
  To: gentoo-commits

commit:     3a9f20b6a3b8d98097de02d997defcbda65edc50
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  1 22:06:36 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Sep  1 22:06:51 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a9f20b6

sys-boot/grub: treat R_X86_64_PLT32 as R_X86_64_PC32

Closes: https://bugs.gentoo.org/665066
Package-Manager: Portage-2.3.48, Repoman-2.3.10
RepoMan-Options: --force

 sys-boot/grub/files/2.02-X86_64_PLT32.patch |  75 +++++++
 sys-boot/grub/grub-2.02-r3.ebuild           | 313 ++++++++++++++++++++++++++++
 2 files changed, 388 insertions(+)

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 00000000000..2c65cb78a5d
--- /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" <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/grub-2.02-r3.ebuild b/sys-boot/grub/grub-2.02-r3.ebuild
new file mode 100644
index 00000000000..d4640dd767b
--- /dev/null
+++ b/sys-boot/grub/grub-2.02-r3.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2018 Gentoo Foundation
+# 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_3,3_4,3_5,3_6} )
+	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 ~arm64 ~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
+)
+
+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="debug 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=
+	debug? (
+		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 debug mm-debug)
+		$(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 sdl && use_enable debug 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
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2018-05-04 16:28 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2018-05-04 16:28 UTC (permalink / raw
  To: gentoo-commits

commit:     bdb2b41526b488a76a41ce55ab3a20f13b9a5cbf
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri May  4 16:27:28 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri May  4 16:27:28 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdb2b415

sys-boot/grub: replace pkg-config patch with a series from Debian

Package-Manager: Portage-2.3.31_p60, Repoman-2.3.9_p116

 .../files/2.02-freetype-capitalise-variables.patch | 126 ++++++++++++
 sys-boot/grub/files/2.02-freetype-pkg-config.patch | 225 ++++++++++++++++-----
 sys-boot/grub/grub-2.02-r1.ebuild                  |   8 +-
 3 files changed, 301 insertions(+), 58 deletions(-)

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 00000000000..9aa7f54f32a
--- /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 <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
index bc2f91759be..94437f073c4 100644
--- a/sys-boot/grub/files/2.02-freetype-pkg-config.patch
+++ b/sys-boot/grub/files/2.02-freetype-pkg-config.patch
@@ -1,73 +1,194 @@
-From 3b0a266dead87906bcf440fd9ef12e1a514320ab Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Fri, 4 May 2018 13:43:59 +0200
-Subject: [PATCH] Use pkg-config to find freetype
+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
 
-As of freetype-2.9.1 the freetype-config script has been deprecated and
-is no longer shipped by default.
+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.
 
-Based on a patch by Lars Wendler <polynomial-c@gentoo.org>.
+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
 ---
- configure.ac | 27 +++++++++++++++++++--------
- 1 file changed, 19 insertions(+), 8 deletions(-)
+ 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 c7888e40f..220f5ffc1 100644
+index 85c23bd62..f102b7024 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1510,7 +1510,8 @@ fi
+@@ -50,6 +50,10 @@ AC_PREREQ(2.60)
+ AC_CONFIG_SRCDIR([include/grub/dl.h])
+ AC_CONFIG_HEADER([config-util.h])
  
- if test x"$grub_mkfont_excuse" = x ; then
-   # Check for freetype libraries.
++# 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])
-+  PKG_PROG_PKG_CONFIG
-+  PKG_CHECK_MODULES(FREETYPE2, freetype2, FREETYPE=yes)
-   if test "x$FREETYPE" = x ; then
-     grub_mkfont_excuse=["need freetype2 library"]
-   fi
-@@ -1520,8 +1521,8 @@ unset ac_cv_header_ft2build_h
+-  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`
-+  freetype_cflags="$FREETYPE2_CFLAGS"
-+  freetype_libs="$FREETYPE2_LIBS"
-   SAVED_CPPFLAGS="$CPPFLAGS"
-   SAVED_LIBS="$LIBS"
-   CPPFLAGS="$CPPFLAGS $freetype_cflags"
-@@ -1573,16 +1574,26 @@ AC_SUBST([BUILD_WORDS_BIGENDIAN])
+-  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"]
-+  if test -z "$BUILD_FREETYPE2_CFLAGS" || test -z "$BUILD_FREETYPE2_LIBS" ; then
-+    AC_CHECK_PROGS([BUILD_PKGCONFIG], [pkg-config])
-+    if test -z "$BUILD_PKGCONFIG" ; then
-+      grub_build_mkfont_excuse=["need pkg-config"]
-+    elif ! "$BUILD_PKGCONFIG" --exists freetype2 ; then
-+      grub_build_mkfont_excuse=["need freetype2 library"]
-+    fi
+-  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
  
- 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`
-+  if test -z "$BUILD_FREETYPE2_CFLAGS" ; then
-+    BUILD_FREETYPE2_CFLAGS=`$BUILD_PKGCONFIG --cflags freetype2`
-+  fi
-+  if test -z "$BUILD_FREETYPE2_LIBS" ; then
-+    BUILD_FREETYPE2_LIBS=`$BUILD_PKGCONFIG --libs freetype2`
-+  fi
-+  build_freetype_cflags="$BUILD_FREETYPE2_CFLAGS"
-+  build_freetype_libs="$BUILD_FREETYPE2_LIBS"
-   SAVED_CPPFLAGS_2="$CPPFLAGS"
-   SAVED_LIBS="$LIBS"
-   CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
--- 
-2.17.0
-
+-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/grub-2.02-r1.ebuild b/sys-boot/grub/grub-2.02-r1.ebuild
index a82ceccfbd2..d18b6e78cb6 100644
--- a/sys-boot/grub/grub-2.02-r1.ebuild
+++ b/sys-boot/grub/grub-2.02-r1.ebuild
@@ -3,12 +3,7 @@
 
 EAPI=6
 
-if [[ ${PV} == 9999  ]]; then
-	GRUB_AUTOGEN=1
-	GRUB_AUTORECONF=1
-fi
-
-# 2.02-grub-pkg-config.patch modifies configure.ac
+GRUB_AUTOGEN=1
 GRUB_AUTORECONF=1
 
 if [[ -n ${GRUB_AUTOGEN} ]]; then
@@ -44,6 +39,7 @@ 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
 )
 


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2018-04-01 18:18 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2018-04-01 18:18 UTC (permalink / raw
  To: gentoo-commits

commit:     4ce63f8b85aa62e485eaebc34b36024f80866106
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  1 18:17:04 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Apr  1 18:18:14 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ce63f8b

sys-boot/grub: backport early microcode patch

Closes: https://bugs.gentoo.org/645088
Package-Manager: Portage-2.3.24, Repoman-2.3.6_p81

 .../grub/files/2.02-multiple-early-initrd.patch    | 177 ++++++++++++
 sys-boot/grub/grub-2.02-r1.ebuild                  | 299 +++++++++++++++++++++
 2 files changed, 476 insertions(+)

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 00000000000..74b576f8b00
--- /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" <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/grub-2.02-r1.ebuild b/sys-boot/grub/grub-2.02-r1.ebuild
new file mode 100644
index 00000000000..7b3b5251bc1
--- /dev/null
+++ b/sys-boot/grub/grub-2.02-r1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == 9999  ]]; then
+	GRUB_AUTOGEN=1
+fi
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+	PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+	WANT_LIBTOOL=none
+	inherit autotools python-any-r1
+fi
+
+inherit autotools bash-completion-r1 flag-o-matic multibuild pax-utils toolchain-funcs versionator
+
+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 ~arm64 ~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
+)
+
+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="debug 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
+RDEPEND="
+	app-arch/xz-utils
+	>=sys-libs/ncurses-5.2-r5:0=
+	debug? (
+		sdl? ( media-libs/libsdl )
+	)
+	device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+	libzfs? ( sys-fs/zfs )
+	mount? ( sys-fs/fuse )
+	truetype? ( media-libs/freetype:2= )
+	ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+	ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+	${PYTHON_DEPS}
+	app-misc/pax-utils
+	sys-devel/flex
+	sys-devel/bison
+	sys-apps/help2man
+	sys-apps/texinfo
+	fonts? ( media-libs/freetype:2 )
+	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(+)]
+		)
+	)
+	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
+	)
+"
+RDEPEND+="
+	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 )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+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
+		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 debug mm-debug)
+		$(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 sdl && use_enable debug 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
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2016-10-05 14:22 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2016-10-05 14:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ec629c23a6e8cf6c18fa51d69ae11932c7ada3cc
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  5 14:16:20 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Oct  5 14:22:44 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec629c23

sys-boot/grub: Install an example grub.cfg

Package-Manager: portage-2.3.1_p6

 sys-boot/grub/files/grub.cfg.example    | 90 +++++++++++++++++++++++++++++++++
 sys-boot/grub/grub-2.02_beta3-r1.ebuild |  5 ++
 2 files changed, 95 insertions(+)

diff --git a/sys-boot/grub/files/grub.cfg.example b/sys-boot/grub/files/grub.cfg.example
new file mode 100644
index 00000000..4c6e464
--- /dev/null
+++ b/sys-boot/grub/files/grub.cfg.example
@@ -0,0 +1,90 @@
+# Example configuration for GRUB
+# Much of this example configuration was taken from the GRUB manual.
+
+# Menu timeout
+timeout=5
+
+# Default menu entry
+default=0
+
+# If we have a font available, start graphical output.
+if loadfont unifont; then
+	# Output resolution for GRUB (eg. 1024x768 or 'auto').
+	gfxmode=auto
+
+	# Output resolution for Linux (VESAFB only).
+	# 'keep' means use the same resolution as GRUB.
+	# For other framebuffer drivers, pass a resolution using the video= kernel param.
+	gfxpayload=keep
+
+	# Load all video drivers.
+	insmod all_video
+
+	# Switch to graphical output.
+	terminal_output gfxterm
+fi
+
+# Load modules necessary to find any boot files (/boot).
+
+# Partition table(s).
+insmod part_msdos
+#insmod part_gpt
+
+menuentry "Gentoo Linux 4.7.2" {
+	# Filesystem for /boot
+	#insmod btrfs
+	insmod ext2
+	#insmod xfs
+	#inmod zfs
+
+	# Search all block devices for a matching UUID (for /boot)
+	search --set=root --fs-uuid 33d4013a-ec25-4462-a540-8078aeb8ed17
+
+	# Load a linux kernel, passing the root filesystem and init process as parameters
+	echo "Loading kernel..."
+	linux /vmlinuz-4.7.2 root=UUID=e1fce3ad-d7e4-4e2f-a1f5-537642bbccd5 rootfstype=btrfs init=/usr/lib/systemd/systemd
+
+	echo "Loading initramfs..."
+	initrd /initramfs-4.7.2.img
+}
+
+menuentry "Windows XP" {
+	insmod ntfs
+	search --set=root --label WINDOWS_XP --hint hd0,msdos1
+	ntldr /ntldr
+}
+
+menuentry "Windows 7" {
+	insmod ntfs
+	search --set=root --label WINDOWS_7 --hint hd0,msdos2
+	ntldr /bootmgr
+}
+
+menuentry "FreeBSD" {
+	insmod zfs
+	search --set=root --label freepool --hint hd0,msdos7
+	kfreebsd /freebsd@/boot/kernel/kernel
+	kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
+	kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
+	kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
+	set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd
+	set kFreeBSD.hw.psm.synaptics_support=1
+}
+
+menuentry "Fedora 16 installer" {
+	search --set=root --label GRUB --hint hd0,msdos5
+	linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800
+	initrd /fedora/initrd.img
+}
+
+menuentry "Fedora rawhide installer" {
+	search --set=root --label GRUB --hint hd0,msdos5
+	linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800
+	initrd /fedora/initrd.img
+}
+
+menuentry "Debian sid installer" {
+	search --set=root --label GRUB --hint hd0,msdos5
+	linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz
+	initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz
+}

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index f54eadb..45fcb98 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -264,6 +264,8 @@ src_install() {
 
 	einstalldocs
 
+	dodoc "${FILESDIR}/grub.cfg.example"
+
 	if use multislot; then
 		mv "${ED%/}"/usr/share/info/grub{,2}.info || die
 	fi
@@ -275,8 +277,11 @@ src_install() {
 pkg_postinst() {
 	elog "For information on how to configure GRUB2 please refer to the guide:"
 	elog "    https://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+	elog
+	elog "For manual configuration, see /usr/share/doc/${PF}/grub.cfg.example"
 
 	if has_version 'sys-boot/grub:0'; then
+		elog
 		elog "A migration guide for GRUB Legacy users is available:"
 		elog "    https://wiki.gentoo.org/wiki/GRUB2_Migration"
 	fi


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2016-05-21 18:19 Magnus Granberg
  0 siblings, 0 replies; 21+ messages in thread
From: Magnus Granberg @ 2016-05-21 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     2e55308331d26b93a2dd2a0b6be1760db27e40d4
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 17:57:34 2016 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Sat May 21 17:59:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e553083

sys-boot/grub-2.02_beta3 Add fix for gcc-6.1.0[pie] #583042

Package-Manager: portage-2.2.27

 .../grub/files/2.02_beta3-gcc6-ld-no-pie.patch     | 57 ++++++++++++++++++++++
 sys-boot/grub/grub-2.02_beta3-r1.ebuild            |  1 +
 2 files changed, 58 insertions(+)

diff --git a/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch b/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch
new file mode 100644
index 0000000..0d81415
--- /dev/null
+++ b/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch
@@ -0,0 +1,57 @@
+2016-05-21  Magnus Granberg  <zorry@gentoo.org>
+
+	#583042 sys-boot/grub-2.02_beta3-r1: building w/gcc-6[pie]: error:
+	x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
+
+	* acinclude.m4: Add -no-pie check.
+	* configure.ac: Add -no-pie to TARGET_LDFLAGS if needed.
+
+--- a/acinclude.m4	2015-11-11 20:56:52.000000000 +0100
++++ b/acinclude.m4	2016-05-17 00:08:22.000000000 +0200
+@@ -390,6 +390,24 @@ else
+ [fi]
+ ])
+ 
++dnl Check if the Linker supports `-no-pie'.
++AC_DEFUN([grub_CHECK_NO_PIE],
++[AC_MSG_CHECKING([whether linker accepts -no-pie])
++AC_CACHE_VAL(grub_cv_cc_ld_nopie,
++[save_LDFLAGS="$LDFLAGS"
++LDFLAGS="$LDFLAGS -no-pie"
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	       [grub_cv_cc_ld_no_pie=yes],
++	       [grub_cv_cc_ld_no_pie=no])
++LDFLAGS="$save_LDFLAGS"
++])
++AC_MSG_RESULT([$grub_cv_cc_ld_no_pie])
++nopie_possible=no
++if test "x$grub_cv_cc_ld_no_pie" = xyes ; then
++  nopie_possible=yes
++fi
++])
++
+ dnl Check if the C compiler supports `-fPIC'.
+ AC_DEFUN([grub_CHECK_PIC],[
+ [# Position independent executable.
+--- a/configure.ac	2016-02-27 13:40:56.000000000 +0100
++++ b/configure.ac	2016-05-17 00:57:29.471000000 +0200
+@@ -1184,13 +1184,18 @@ CFLAGS="$TARGET_CFLAGS"
+ 
+ # Position independent executable.
+ grub_CHECK_PIE
++grub_CHECK_NO_PIE
+ [# Need that, because some distributions ship compilers that include
+-# `-fPIE' in the default specs.
++# `-fPIE' and '-pie' in the default specs.
+ if [ x"$pie_possible" = xyes ]; then
+   TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
++fi
++if [ x"$nopie_possible" = xyes ] &&  [ x"$pie_possible" = xyes ]; then
++  TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie"
+ fi]
+ 
+ CFLAGS="$TARGET_CFLAGS"
++LDFLAGS="$TARGET_LDFLAGS"
+ 
+ # Position independent executable.
+ grub_CHECK_PIC

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index ab05794..7fd67ee 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -35,6 +35,7 @@ PATCHES=(
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
 	"${FILESDIR}"/2.02_beta3-10_linux-UUID.patch
 	"${FILESDIR}"/2.02_beta3-sysmacros.patch
+	"${FILESDIR}"/2.02_beta3-gcc6-ld-no-pie.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.35


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2016-04-24 15:30 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2016-04-24 15:30 UTC (permalink / raw
  To: gentoo-commits

commit:     8fa466c0ac9da67c50cb8400197c37d0a5fef33b
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 24 15:29:25 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Apr 24 15:30:22 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fa466c0

sys-boot/grub: backport sysmacros fix

Bug: https://bugs.gentoo.org/580172

Package-Manager: portage-2.2.28_p71

 sys-boot/grub/files/2.02_beta3-sysmacros.patch | 107 +++++++++++++++++++++++++
 sys-boot/grub/grub-2.02_beta3-r1.ebuild        |   1 +
 2 files changed, 108 insertions(+)

diff --git a/sys-boot/grub/files/2.02_beta3-sysmacros.patch b/sys-boot/grub/files/2.02_beta3-sysmacros.patch
new file mode 100644
index 0000000..8610f3a
--- /dev/null
+++ b/sys-boot/grub/files/2.02_beta3-sysmacros.patch
@@ -0,0 +1,107 @@
+From 7a5b301e3adb8e054288518a325135a1883c1c6c Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 19 Apr 2016 14:27:22 -0400
+Subject: [PATCH] build: Use AC_HEADER_MAJOR to find device macros
+
+Depending on the OS/libc, device macros are defined in different
+headers. This change ensures we include the right one.
+
+sys/types.h - BSD
+sys/mkdev.h - Sun
+sys/sysmacros.h - glibc (Linux)
+
+glibc currently pulls sys/sysmacros.h into sys/types.h, but this may
+change in a future release.
+
+https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
+---
+ configure.ac                         | 3 ++-
+ grub-core/osdep/devmapper/getroot.c  | 6 ++++++
+ grub-core/osdep/devmapper/hostdisk.c | 5 +++++
+ grub-core/osdep/linux/getroot.c      | 6 ++++++
+ grub-core/osdep/unix/getroot.c       | 4 +++-
+ 5 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 57e1713..9ddfc53 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -388,7 +388,8 @@ fi
+ 
+ # Check for functions and headers.
+ AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
+-AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
++AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
++AC_HEADER_MAJOR
+ 
+ AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
+ #include <sys/param.h>
+diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c
+index 05eda50..72e5582 100644
+--- a/grub-core/osdep/devmapper/getroot.c
++++ b/grub-core/osdep/devmapper/getroot.c
+@@ -40,6 +40,12 @@
+ #include <limits.h>
+ #endif
+ 
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #include <libdevmapper.h>
+ 
+ #include <grub/types.h>
+diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c
+index 19c1101..a697bcb 100644
+--- a/grub-core/osdep/devmapper/hostdisk.c
++++ b/grub-core/osdep/devmapper/hostdisk.c
+@@ -24,6 +24,11 @@
+ #include <errno.h>
+ #include <limits.h>
+ 
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
+ 
+ #ifdef HAVE_DEVICE_MAPPER
+ # include <libdevmapper.h>
+diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
+index 10480b6..09e7e6e 100644
+--- a/grub-core/osdep/linux/getroot.c
++++ b/grub-core/osdep/linux/getroot.c
+@@ -35,6 +35,12 @@
+ #include <limits.h>
+ #endif
+ 
++#if defined(MAJOR_IN_MKDEV)
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #include <grub/types.h>
+ #include <sys/ioctl.h>         /* ioctl */
+ #include <sys/mount.h>
+diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
+index 1079a91..4bf37b0 100644
+--- a/grub-core/osdep/unix/getroot.c
++++ b/grub-core/osdep/unix/getroot.c
+@@ -51,8 +51,10 @@
+ #endif
+ 
+ #include <sys/types.h>
+-#if defined(HAVE_SYS_MKDEV_H)
++#if defined(MAJOR_IN_MKDEV)
+ #include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
+ #endif
+ 
+ #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
+-- 
+2.8.1
+

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index 87d786d..43291a0 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -34,6 +34,7 @@ PATCHES=(
 	"${FILESDIR}"/gfxpayload.patch
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
 	"${FILESDIR}"/2.02_beta3-10_linux-UUID.patch
+	"${FILESDIR}"/2.02_beta3-sysmacros.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.35


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2016-03-05 22:36 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2016-03-05 22:36 UTC (permalink / raw
  To: gentoo-commits

commit:     20850e98766f137b01b6df134ed90bef9bc3d5e0
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  5 22:36:11 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Mar  5 22:36:34 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20850e98

sys-boot/grub: Make GRUB_DISABLE_LINUX_UUID work again

Bug: https://bugs.gentoo.org/576528

Package-Manager: portage-2.2.27_p64

 sys-boot/grub/files/2.02_beta3-10_linux-UUID.patch | 27 ++++++++++++++++++++++
 ...2.02_beta3.ebuild => grub-2.02_beta3-r1.ebuild} |  1 +
 2 files changed, 28 insertions(+)

diff --git a/sys-boot/grub/files/2.02_beta3-10_linux-UUID.patch b/sys-boot/grub/files/2.02_beta3-10_linux-UUID.patch
new file mode 100644
index 0000000..1dcf3b5
--- /dev/null
+++ b/sys-boot/grub/files/2.02_beta3-10_linux-UUID.patch
@@ -0,0 +1,27 @@
+From ea8de5d2ee58178381e5809e4d5fe79861e61b04 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sat, 5 Mar 2016 17:21:15 -0500
+Subject: [PATCH] [2.02] 10_linux: Fix grouping of tests for GRUB_DEVICE
+
+Commit 7290bb562 causes GRUB_DISABLE_LINUX_UUID to be ignored due to
+mixing of || and && operators. Add some parens to help with that.
+---
+ util/grub.d/10_linux.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 5a78513..de9044c 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -47,7 +47,7 @@ esac
+ # and mounting btrfs requires user space scanning, so force UUID in this case.
+ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+     || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+-    || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then
++    || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
+   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ else
+   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+-- 
+2.7.2
+

diff --git a/sys-boot/grub/grub-2.02_beta3.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
similarity index 99%
rename from sys-boot/grub/grub-2.02_beta3.ebuild
rename to sys-boot/grub/grub-2.02_beta3-r1.ebuild
index 350857b..87d786d 100644
--- a/sys-boot/grub/grub-2.02_beta3.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -33,6 +33,7 @@ fi
 PATCHES=(
 	"${FILESDIR}"/gfxpayload.patch
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+	"${FILESDIR}"/2.02_beta3-10_linux-UUID.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.35


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
@ 2015-12-15 18:30 Mike Gilbert
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Gilbert @ 2015-12-15 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     bb354734b6b31239b78614a28f0ebd94affeb6d2
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 15 18:29:54 2015 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Dec 15 18:30:33 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb354734

sys-boot/grub: Security bump for CVE-2015-8370

Bug: https://bugs.gentoo.org/568326

Package-Manager: portage-2.2.26_p32

 sys-boot/grub/files/CVE-2015-8370.patch |  45 +++++
 sys-boot/grub/grub-2.02_beta2-r8.ebuild | 313 ++++++++++++++++++++++++++++++++
 2 files changed, 358 insertions(+)

diff --git a/sys-boot/grub/files/CVE-2015-8370.patch b/sys-boot/grub/files/CVE-2015-8370.patch
new file mode 100644
index 0000000..5701b54
--- /dev/null
+++ b/sys-boot/grub/files/CVE-2015-8370.patch
@@ -0,0 +1,45 @@
+From 88c9657960a6c5d3673a25c266781e876c181add Mon Sep 17 00:00:00 2001
+From: Hector Marco-Gisbert <hecmargi@upv.es>
+Date: Fri, 13 Nov 2015 16:21:09 +0100
+Subject: [PATCH] Fix security issue when reading username and password
+
+  This patch fixes two integer underflows at:
+    * grub-core/lib/crypto.c
+    * grub-core/normal/auth.c
+
+Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
+Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
+---
+ grub-core/lib/crypto.c  | 2 +-
+ grub-core/normal/auth.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
+index 010e550..524a3d8 100644
+--- a/grub-core/lib/crypto.c
++++ b/grub-core/lib/crypto.c
+@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned buf_size)
+ 	  break;
+ 	}
+ 
+-      if (key == '\b')
++      if (key == '\b' && cur_len)
+ 	{
+ 	  cur_len--;
+ 	  continue;
+diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
+index c6bd96e..5782ec5 100644
+--- a/grub-core/normal/auth.c
++++ b/grub-core/normal/auth.c
+@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size)
+ 	  break;
+ 	}
+ 
+-      if (key == '\b')
++      if (key == '\b' && cur_len)
+ 	{
+ 	  cur_len--;
+ 	  grub_printf ("\b");
+-- 
+1.9.1
+

diff --git a/sys-boot/grub/grub-2.02_beta2-r8.ebuild b/sys-boot/grub/grub-2.02_beta2-r8.ebuild
new file mode 100644
index 0000000..c617cab
--- /dev/null
+++ b/sys-boot/grub/grub-2.02_beta2-r8.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+GRUB_AUTOGEN=1
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+	PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+	inherit python-any-r1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+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
+			https://dev.gentoo.org/~floppym/dist/${P}-gentoo-r3.tar.xz"
+		S=${WORKDIR}/${MY_P}
+	else
+		SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+			https://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+		S=${WORKDIR}/${P%_*}
+	fi
+	KEYWORDS="~amd64 ~x86"
+else
+	inherit git-r3
+	EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+		http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-7.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"
+IUSE="debug 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 )
+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
+RDEPEND="
+	app-arch/xz-utils
+	>=sys-libs/ncurses-5.2-r5:0=
+	debug? (
+		sdl? ( media-libs/libsdl )
+	)
+	device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+	libzfs? ( sys-fs/zfs )
+	mount? ( sys-fs/fuse )
+	truetype? ( media-libs/freetype:2= )
+	ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+	ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+	${PYTHON_DEPS}
+	app-misc/pax-utils
+	sys-devel/flex
+	sys-devel/bison
+	sys-apps/help2man
+	sys-apps/texinfo
+	fonts? ( media-libs/freetype:2 )
+	grub_platforms_xen? ( 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(+)]
+		)
+	)
+	test? (
+		dev-libs/libisoburn
+		app-emulation/qemu
+	)
+	themes? (
+		app-arch/unzip
+		media-libs/freetype:2
+	)
+"
+RDEPEND+="
+	kernel_linux? (
+		grub_platforms_efi-32? ( sys-boot/efibootmgr )
+		grub_platforms_efi-64? ( sys-boot/efibootmgr )
+	)
+	!multislot? ( !sys-boot/grub:0 )
+	nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+	usr/bin/grub*-emu*
+	usr/lib*/grub/*/*.mod
+	usr/lib*/grub/*/*.module
+	usr/lib*/grub/*/kernel.exec
+	usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+	usr/lib*/grub/*/kernel.exec
+	usr/lib*/grub/*/kernel.img
+	usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+	usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]]; then
+		git-r3_src_unpack
+	fi
+	default_src_unpack
+}
+
+src_prepare() {
+	EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
+
+	epatch "${FILESDIR}"/CVE-2015-8370.patch
+
+	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
+
+	epatch_user
+
+	if [[ -n ${GRUB_AUTOGEN} ]]; then
+		python_setup
+		bash autogen.sh || die
+	fi
+
+	if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+		autopoint() { return 0; }
+		eautoreconf
+	fi
+}
+
+setup_fonts() {
+	ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+	if use themes; then
+		ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+	fi
+}
+
+grub_configure() {
+	local platform
+
+	case ${MULTIBUILD_VARIANT} in
+		efi-32)
+			platform=efi
+			if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+				local CTARGET=${CTARGET:-i386}
+			fi ;;
+		efi-64)
+			platform=efi
+			if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+				local CTARGET=${CTARGET:-x86_64}
+				local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+				local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+				export TARGET_CFLAGS TARGET_CPPFLAGS
+			fi ;;
+		guessed) ;;
+		*)	platform=${MULTIBUILD_VARIANT} ;;
+	esac
+
+	local myeconfargs=(
+		--disable-werror
+		--program-prefix=
+		--libdir="${EPREFIX}"/usr/lib
+		--htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+		$(use_enable debug mm-debug)
+		$(use_enable debug grub-emu-usb)
+		$(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 sdl && use_enable debug 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
+
+	mkdir -p "${BUILD_DIR}" || die
+	run_in_build_dir setup_fonts
+
+	autotools-utils_src_configure
+}
+
+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
+
+	# Portage will take care of cleaning up GRUB_PLATFORMS
+	MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+	multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+	# Sandbox bug 404013.
+	use libzfs && addpredict /etc/dfs:/dev/zfs
+
+	multibuild_foreach_variant autotools-utils_src_compile
+
+	use doc && multibuild_for_best_variant \
+		autotools-utils_src_compile -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.
+	multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+	multibuild_foreach_variant autotools-utils_src_install \
+		bashcompletiondir="$(get_bashcompdir)"
+
+	local grub=grub
+	if use multislot; then
+		grub=grub2
+		mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+		mv "${ED%/}"/$(get_bashcompdir)/grub{,2} || die
+	fi
+
+	bashcomp_alias ${grub} ${grub}-{install,set-default,mkrescue,reboot,script-check,editenv,sparc64-setup,mkfont,mkpasswd-pbkdf2,mkimage,bios-setup,mkconfig,probe}
+
+	use doc && multibuild_for_best_variant run_in_build_dir \
+		emake -C docs DESTDIR="${D}" install-html
+
+	insinto /etc/default
+	newins "${FILESDIR}"/grub.default-3 grub
+}
+
+pkg_postinst() {
+	mount-boot_mount_boot_partition
+
+	if [[ -e "${ROOT%/}/boot/grub2/grub.cfg"  ]]; then
+		ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+		ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+
+		if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+			mkdir -p "${ROOT%/}/boot/grub"
+			ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+		fi
+	fi
+
+	mount-boot_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
+}


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-04-11 19:40 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 14:45 [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/ Mike Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2024-04-11 19:40 Mike Gilbert
2023-07-11 14:25 Mike Gilbert
2023-05-09 20:23 Mike Gilbert
2023-02-13 16:47 Mike Gilbert
2023-01-17 16:03 Mike Gilbert
2023-01-17 16:03 Mike Gilbert
2022-09-16 23:10 Mike Gilbert
2021-09-07 17:28 Mike Gilbert
2021-03-14 18:36 Mike Gilbert
2020-03-15 18:34 Mike Gilbert
2019-07-23 13:21 Mike Gilbert
2019-06-24 18:34 Mike Gilbert
2018-09-01 22:07 Thomas Deutschmann
2018-05-04 16:28 Mike Gilbert
2018-04-01 18:18 Mike Gilbert
2016-10-05 14:22 Mike Gilbert
2016-05-21 18:19 Magnus Granberg
2016-04-24 15:30 Mike Gilbert
2016-03-05 22:36 Mike Gilbert
2015-12-15 18:30 Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox