From cdc5074beeb601a1bef35d91c18fd8806528834a Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Sat, 30 Aug 2025 09:35:51 +0000 Subject: [PATCH] Bump sys-boot/grub-2.12-r1 --- sys-boot/grub/Manifest | 1 + sys-boot/grub/files/grub-ktype-macaroni.patch | 59 +++++ sys-boot/grub/files/grub.default-4 | 2 +- sys-boot/grub/grub-2.12-r1.ebuild | 218 ++++++++++++++++++ 4 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 sys-boot/grub/files/grub-ktype-macaroni.patch create mode 100644 sys-boot/grub/grub-2.12-r1.ebuild diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index 733296ee74..23bbd933fe 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -1,3 +1,4 @@ DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae DIST grub-2.12.tar.gz 12051818 BLAKE2B b5f44158d0e7b90e9729d65fe94858e640c4485ab637e5fc4f12fe9436f6f7c9565a4aab19a3d1400b93f1eabc3e1114d781eb4324fa971b635ff0321a9b3328 SHA512 029678d9363b5297c79f06fa9f65565986da329636debcd53dc875b727ba1cf4a8d4415915932c513379e6cab7c759bbb4e2bcb9757ece4e4e1b9ecdd4a0d8cf +DIST grub-2.12.tar.xz 6675608 BLAKE2B a678f7fafb945d325c8cf47aa086f48357a8f6335b762f77038c30a3896b3b05491598d9931d5335841d224fffcbe4a9a43ca1479057c1f1ce52b8d2a952c431 SHA512 761c060a4c3da9c0e810b0ea967e3ebc66baa4ddd682a503ae3d30a83707626bccaf49359304a16b3a26fc4435fe6bea1ee90be910c84de3c2b5485a31a15be3 DIST unifont-15.0.06.pcf.gz 1358322 BLAKE2B 81811e3de390ca35d1a2dc1f1dee73464e97f44907ba522c218ba9c5e39ca3c9d767552780a257a97c156eb623c17786d9c0d2b67786d61df5ca33a1e10db7ca SHA512 0a28a406629c604f5cbf51f501528239a7ed50d19f93ea505bc5bdc72639e4b926b03f4b8782a5733041f7cdb4aebb9948ac7cfd5a8ad9a0fe309944e595517b diff --git a/sys-boot/grub/files/grub-ktype-macaroni.patch b/sys-boot/grub/files/grub-ktype-macaroni.patch new file mode 100644 index 0000000000..d6d6ea1d19 --- /dev/null +++ b/sys-boot/grub/files/grub-ktype-macaroni.patch @@ -0,0 +1,59 @@ +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 44a38f0..1cb2699 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -73,7 +73,7 @@ case x"$GRUB_FS" in + GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" + fi;; + xzfs) +- rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` ++ #rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` + bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}" + ;; +@@ -142,7 +142,13 @@ linux_entry () + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi +- message="$(gettext_printf "Loading Linux %s ..." ${version})" ++ ++ if [ -z "${ktype}" ] ; then ++ msg_version=${version} ++ else ++ msg_version=${ktype}-${version} ++ fi ++ message="$(gettext_printf "Loading Linux %s ..." ${msg_version})" + sed "s/^/$submenu_indentation/" << EOF + echo '$(echo "$message" | grub_quote)' + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} +@@ -215,6 +221,7 @@ for linux in ${reverse_sorted_list}; do + rel_dirname=`make_system_path_relative_to_its_root $dirname` + version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` + alt_version=`echo $version | sed -e "s,\.old$,,g"` ++ ktype=$(echo ${basename/kernel-/} | sed -e "s/-${alt_version}//g") + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + + initrd_early= +@@ -227,11 +234,17 @@ for linux in ${reverse_sorted_list}; do + + initrd_real= + for i in "initrd.img-${version}" "initrd-${version}.img" \ +- "initrd-${alt_version}.img.old" "initrd-${version}.gz" \ +- "initrd-${alt_version}.gz.old" "initrd-${version}" \ +- "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \ +- "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ +- "initrd-${alt_version}" "initramfs-${alt_version}.img" \ ++ "initrd-${version}.gz" \ ++ "initrd-${version}" \ ++ "initrd-${alt_version}.img.old" \ ++ "initrd-${alt_version}.gz.old" \ ++ "initramfs-${version}.img" \ ++ "initramfs-${alt_version}.img.old" \ ++ "initrd.img-${alt_version}" \ ++ "initrd-${alt_version}.img" \ ++ "initramfs-${alt_version}.img" \ ++ "initrd-${alt_version}" \ ++ "initramfs-${ktype}-${alt_version}" \ + "initramfs-genkernel-${version}" \ + "initramfs-genkernel-${alt_version}" \ + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ diff --git a/sys-boot/grub/files/grub.default-4 b/sys-boot/grub/files/grub.default-4 index d440475384..e7d794768b 100644 --- a/sys-boot/grub/files/grub.default-4 +++ b/sys-boot/grub/files/grub.default-4 @@ -8,7 +8,7 @@ # See the grub info page for documentation on possible variables and # their associated values. -GRUB_DISTRIBUTOR="Funtoo" +GRUB_DISTRIBUTOR="MacaroniOS" # Default menu entry #GRUB_DEFAULT=0 diff --git a/sys-boot/grub/grub-2.12-r1.ebuild b/sys-boot/grub/grub-2.12-r1.ebuild new file mode 100644 index 0000000000..0d3be97e8b --- /dev/null +++ b/sys-boot/grub/grub-2.12-r1.ebuild @@ -0,0 +1,218 @@ +# Distributed under the terms of the GNU General Public License v2 +# Autogen by MARK Devkit + +EAPI=7 +PYTHON_COMPAT=( python3+ ) +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/*" +WANT_LIBTOOL=none +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson + multiboot qemu qemu-mips pc uboot xen xen-32 xen-pvh ) + +inherit bash-completion-r1 flag-o-matic multibuild optfeature toolchain-funcs autotools + +DESCRIPTION="GNU GRUB boot loader" +HOMEPAGE="https://www.gnu.org/software/grub/" +SRC_URI=" +https://ftp.gnu.org/gnu/grub//grub-2.12.tar.xz -> grub-2.12.tar.xz +fonts? ( https://ftp.gnu.org/gnu/unifont/unifont-15.0.06/unifont-15.0.06.pcf.gz -> unifont-15.0.06.pcf.gz ) +themes? ( https://download.sourceforge.net/dejavu/dejavu-sans-ttf-2.37.zip -> dejavu-sans-ttf-2.37.zip )" +LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )" +SLOT="2" +KEYWORDS="*" +PATCHES=( + "${FILESDIR}/grub-gfxpayload.patch" + "${FILESDIR}/grub-2.02_beta2-KERNEL_GLOBS.patch" + "${FILESDIR}/grub-2.06-test-words.patch" + "${FILESDIR}/grub-2.06-binutils-2.36.patch" + "${FILESDIR}/grub-ktype-macaroni.patch" +) +IUSE="device-mapper doc efiemu +fonts mount nls sdl +themes truetype libzfs +grub_platforms_coreboot grub_platforms_efi-32 grub_platforms_efi-64 +grub_platforms_emu grub_platforms_ieee1275 grub_platforms_loongson +grub_platforms_multiboot grub_platforms_qemu grub_platforms_qemu-mips +grub_platforms_pc grub_platforms_uboot grub_platforms_xen grub_platforms_xen-32 +grub_platforms_xen-pvh +" +REQUIRED_USE="grub_platforms_coreboot? ( fonts ) +grub_platforms_qemu? ( fonts ) +grub_platforms_ieee1275? ( fonts ) +grub_platforms_loongson? ( fonts ) +" +# Commons depends +CDEPEND="app-arch/xz-utils + sys-libs/ncurses:0= + grub_platforms_emu? ( + sdl? ( media-libs/libsdl2 ) + ) + device-mapper? ( >=sys-fs/lvm2-2.02.45 ) + libzfs? ( sys-fs/zfs:= ) + mount? ( sys-fs/fuse:3 ) + truetype? ( media-libs/freetype:2= ) + ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + +" +BDEPEND="${PYTHON_DEPS} + sys-devel/flex + sys-devel/bison + sys-apps/help2man + sys-apps/texinfo + fonts? ( + media-libs/freetype:2 + virtual/pkgconfig + ) + themes? ( + app-arch/unzip + media-libs/freetype:2 + virtual/pkgconfig + ) + truetype? ( virtual/pkgconfig ) + +" +RDEPEND="${CDEPEND} + kernel_linux? ( + grub_platforms_efi-32? ( sys-boot/efibootmgr ) + grub_platforms_efi-64? ( sys-boot/efibootmgr ) + ) + nls? ( sys-devel/gettext ) + +" +DEPEND="${CDEPEND} +" +S="${WORKDIR}/${P%_*}" +pkg_setup() { + : +} +src_prepare() { + default + export PYTHON=true + eautoreconf + # Avoid error due to extra_deps.lst missing from source tarball: + # make[3]: *** No rule to make target 'grub-core/extra_deps.lst', needed by 'syminfo.lst'. Stop. + echo "depends bli part_gpt" > grub-core/extra_deps.lst || die +} + +grub_do() { + 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) + --enable-grub-emu-sdl=no + $(use_enable sdl grub-emu-sdl2) + ${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; Gentoo 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; addpredict /dev/zfs; } + grub_do emake + use doc && grub_do_once emake -C docs html +} + +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-4 grub + # https://bugs.gentoo.org/231935 + dostrip -x /usr/lib/grub +} + +pkg_postinst() { + elog "For information on how to configure GRUB2 please refer to the guide:" + elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" + if has_version 'sys-boot/grub:0'; then + elog "A migration guide for GRUB Legacy users is available:" + elog " https://wiki.gentoo.org/wiki/GRUB2_Migration" + fi + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog + optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "enabling RAID device detection" sys-fs/mdadm + fi + if has_version sys-boot/os-prober; then + ewarn "Due to security concerns, os-prober is disabled by default." + ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it." + fi +} + + +# vim: filetype=ebuild