Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 399298 Details for
Bug 543840
sys-boot/grub:2 fails to compile against musl
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix compilation against musl
0001-sys-boot-grub-fix-compilation-against-musl.patch (text/plain), 21.91 KB, created by
Travis Tilley
on 2015-03-20 03:20:10 UTC
(
hide
)
Description:
fix compilation against musl
Filename:
MIME Type:
Creator:
Travis Tilley
Created:
2015-03-20 03:20:10 UTC
Size:
21.91 KB
patch
obsolete
>From 9cad62b20ebc9bc3a20deae29177353b2ff31839 Mon Sep 17 00:00:00 2001 >From: layman <layman@localhost> >Date: Thu, 19 Mar 2015 23:14:33 -0400 >Subject: [PATCH] sys-boot/grub: fix compilation against musl > >--- > sys-boot/grub/Manifest | 10 + > sys-boot/grub/files/grub-2.00_musl.patch | 49 +++ > .../grub/files/grub-2.02-musl-no-error.h.patch | 38 +++ > sys-boot/grub/files/grub.conf.gentoo | 16 + > sys-boot/grub/files/grub.default-2 | 46 +++ > sys-boot/grub/files/grub.default-3 | 63 ++++ > sys-boot/grub/grub-2.02_beta2-r7.ebuild | 328 +++++++++++++++++++++ > 7 files changed, 550 insertions(+) > create mode 100644 sys-boot/grub/Manifest > create mode 100644 sys-boot/grub/files/grub-2.00_musl.patch > create mode 100644 sys-boot/grub/files/grub-2.02-musl-no-error.h.patch > create mode 100644 sys-boot/grub/files/grub.conf.gentoo > create mode 100644 sys-boot/grub/files/grub.default-2 > create mode 100644 sys-boot/grub/files/grub.default-3 > create mode 100644 sys-boot/grub/grub-2.02_beta2-r7.ebuild > >diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest >new file mode 100644 >index 0000000..712a6ac >--- /dev/null >+++ b/sys-boot/grub/Manifest >@@ -0,0 +1,10 @@ >+AUX grub-2.00_musl.patch 1728 SHA256 9efd0a83291ed49c30dc82dcc6347ab99c021e7d21e376fbf53f9a5628f6419b SHA512 699aea7d70d62705555c73eb7391c6f8b0b209a2662e21aed886c03c7ae80e9f8023c94434ec5a9c5ec125d8b6bf76b0d506b1b6efe887f216d5e3351d3b5ae8 WHIRLPOOL aaf4cd72019363d27a010766ddf187c46ef9fc9dc55d3cd423d8a501fb807e7d1f8188710825fa2ce4b10acb69ddfcd9b80c9a95b8ad860155e037e4770c72c7 >+AUX grub-2.02-musl-no-error.h.patch 998 SHA256 d17d074f0ee51b9baff417bafdf5a63c96e33ab74aade4ac86ed753c24dec115 SHA512 51278d3c08cb06ed43759d5030df5229b618d6a4bc158f3b98a605ebacfac5172d871518563769987fe857d1730b37d78f84ae09edbd706edbb86860e794d80e WHIRLPOOL 59f9a9a22742a245e5d5d4f993bcbbd17700d975e51b37d71882c7d41b933c2e7d93f8451fc75d9556ad9fa35d1193941895ef4eeda0957d2fff02e2f1ff0a10 >+AUX grub.conf.gentoo 591 SHA256 e656b5716d6a5904a035960b460494431d8c1327df51fcd9ffb39243425fe142 SHA512 23036b9e558b604082d9ae8c848f18ea552181416937e3ef62287e53c38086b8d7ffef0e67d04af04f05f5b23c6da7aaf1f1f23e0ee1cffd5dbd5320e8648cb1 WHIRLPOOL 184284cac00bc039d36c5b2f8d7be0f425e75ba904c4c04c2ec531a094cd191c42cb7382276e73a5d176e1661dcdd1bdc5e3806b9d7abe9b38563575ecb6ee76 >+AUX grub.default-2 1602 SHA256 d1c11fb4decbae9a9827866ec2126b2c11a3d8f6b41278acad139b4dd34338c5 SHA512 15085cdfe706379d931c6841c34403ffcb46765be75425a29b563d69169124447606d8f8444945ed1148ac734da4f12f14a9b18abd6b0501974c1c770ad13c39 WHIRLPOOL 2f72b2a3d4048261cf3d5477b9a33264b3214a803eebcf4b782c33cf71d045e9be878407c64c720c2a7b260a65f8e32a61974c55ebd8d464e0b947133cdf49fd >+AUX grub.default-3 2189 SHA256 9632dad421161562dd3f2535f173b6c91741168232d9ef97af894377545e86d4 SHA512 5537884998a3a6f9d1bd926aabd33bd017e953594539dc85791aad0dc5c996e40109092aa9937a7dff34294c17b831c22677a7727c3027bbf7a9e840907893e7 WHIRLPOOL eaa9d50e1884ccde412803c2e939d328d64e469f7d3345057ce71eeebbf1c7e19ff62063323f62c274b306c56884e85e0d134e5c0fcba3254b7c1d25440e9a3a >+DIST dejavu-sans-ttf-2.34.zip 406977 SHA256 242e8c1cb2bdc7458bece02cca898f962c2bc919dcf67d97428149228290184d SHA512 dcd802b9c83cfa749b7542d0855eb1facb665a035af8c05f58830fce3ce37ba8d4a6f0353c07ae924c7fc25460d330b7312cbaffd34a2cb314a8e222de385c1b WHIRLPOOL d8b3289997cc39aca1c909ac1cae79727a19932f07b116a4a0bcc83e4a2f136d05d18c8ef2b05504a2f1f65eba85f93d61d52b0c913be7bb3e23f6a403eb6a82 >+DIST grub-2.02_beta2-gentoo-r2.tar.xz 14200 SHA256 a8033930576386cda0b86c4e487a652f9556b2068d5ce4988619868112ddf732 SHA512 dc375eb3b3f79c2205fe3528d13693c2d2d0df95dd474e6b737f3cec66be8fc8a139f83254289c27abf1640f73f1fa769c21dc6214ba68fd6eeb116a402bdb55 WHIRLPOOL 93686f4fabf41318b4b01c2969f55644dc2978407da999bdd296713e974ac36f5de11a0e7b3e00588a90c03b36777b49fb7a79988d89b9436f582064faad17ec >+DIST grub-2.02~beta2.tar.xz 5798740 SHA256 f6c702b2a8ea58f27a2b02928bb77973cb5a827af08f63db38c471c0a01b418d SHA512 359903928febce1df53b3bd38aab701b4ea010dfad0dee434e853c865af4bbc60d115e61eac100c79f18d89aa78b2216ef20123f4ef04cc948ecbe226ea1a58c WHIRLPOOL f92e94f43888648484a972a0c82b0a2ac4dc7fbdd6e35ca8b11a6ee92168ac8cf7ee68987b84697ec46ad18189e5c5c9aee8105b91bb131cd7f6f499f45cd58f >+DIST unifont-7.0.06.pcf.gz 1359006 SHA256 acf516b464928244c25dd1afddd02f6f459686b5135685694d875d7eca8bf4f2 SHA512 a62f21366b51a582d2b5a66710c8a6183bc869407867da78e59ecec9dabcff7a2522a8bc454cf511592d336befea812d36622589ef119160fe3014d927fa11b3 WHIRLPOOL 9f431f9b6af23a87e3291e5c66d6f1e56f8c8ce23222821dbf41aa03edac4d80e8e6c5895c024951cf199d41904e6c9f830103427568a9b0386f68adc0a959d7 >+EBUILD grub-2.02_beta2-r7.ebuild 8405 SHA256 0df4fb66bf9f1eed83108e346c7cf119252b11ffff051f566bfa2c789fdac944 SHA512 fb923c5324c78b2614867198ece5ce5dd89e54777c8c691e6eef7efb4ead896e6402bca31de1eac842044c37b728c722b146f1dd96f9de894274508eaf25727b WHIRLPOOL 174f8b45516e5c0904823cc5f6ec0b905f5c83adcbc64a24c0300ede97faafff08a1d6fe5f1877509267808d5c3d0001fc524af3a6ebcd1703c739403c1a78ac >diff --git a/sys-boot/grub/files/grub-2.00_musl.patch b/sys-boot/grub/files/grub-2.00_musl.patch >new file mode 100644 >index 0000000..62b5893 >--- /dev/null >+++ b/sys-boot/grub/files/grub-2.00_musl.patch >@@ -0,0 +1,49 @@ >+diff -Naur a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c >+--- a/grub-core/kern/emu/hostdisk.c 2012-06-25 04:32:04.000000000 -0400 >++++ b/grub-core/kern/emu/hostdisk.c 2014-08-13 17:36:32.301106711 -0400 >+@@ -44,11 +44,6 @@ >+ #ifdef __linux__ >+ # include <sys/ioctl.h> /* ioctl */ >+ # include <sys/mount.h> >+-# if !defined(__GLIBC__) || \ >+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) >+-/* Maybe libc doesn't have large file support. */ >+-# include <linux/unistd.h> /* _llseek */ >+-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ >+ # ifndef BLKFLSBUF >+ # define BLKFLSBUF _IO (0x12,97) /* flush buffer cache */ >+ # endif /* ! BLKFLSBUF */ >+@@ -761,25 +756,6 @@ >+ } >+ #endif /* __linux__ */ >+ >+-#if defined(__linux__) && (!defined(__GLIBC__) || \ >+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) >+- /* Maybe libc doesn't have large file support. */ >+-grub_err_t >+-grub_util_fd_seek (int fd, const char *name, grub_uint64_t off) >+-{ >+- loff_t offset, result; >+- static int _llseek (uint filedes, ulong hi, ulong lo, >+- loff_t *res, uint wh); >+- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, >+- loff_t *, res, uint, wh); >+- >+- offset = (loff_t) off; >+- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) >+- return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"), >+- name, strerror (errno)); >+- return GRUB_ERR_NONE; >+-} >+-#else >+ grub_err_t >+ grub_util_fd_seek (int fd, const char *name, grub_uint64_t off) >+ { >+@@ -790,7 +766,6 @@ >+ name, strerror (errno)); >+ return 0; >+ } >+-#endif >+ >+ static void >+ flush_initial_buffer (const char *os_dev __attribute__ ((unused))) >diff --git a/sys-boot/grub/files/grub-2.02-musl-no-error.h.patch b/sys-boot/grub/files/grub-2.02-musl-no-error.h.patch >new file mode 100644 >index 0000000..e469e94 >--- /dev/null >+++ b/sys-boot/grub/files/grub-2.02-musl-no-error.h.patch >@@ -0,0 +1,38 @@ >+diff --git a/configure.ac b/configure.ac >+index e4369ce..f699dec 100644 >+--- a/configure.ac >++++ b/configure.ac >+@@ -382,6 +382,7 @@ 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([error.h]) >+ >+ AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default >+ #include <sys/param.h> >+diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c >+index 43471b4..2a8ddd7 100644 >+--- a/grub-core/kern/emu/misc.c >++++ b/grub-core/kern/emu/misc.c >+@@ -20,7 +20,21 @@ >+ #include <config.h> >+ >+ #include <errno.h> >++ >++#if defined(HAVE_ERROR_H) >+ #include <error.h> >++#else >++#include <err.h> >++#include <string.h> >++#define _musl_error(S, E, F, ...) do { \ >++ if (E) \ >++ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \ >++ else \ >++ err(S, F, ##__VA_ARGS__); \ >++} while(0) >++#define error _musl_error >++#endif >++ >+ #include <stdio.h> >+ #include <stdlib.h> >+ #include <stdint.h> >diff --git a/sys-boot/grub/files/grub.conf.gentoo b/sys-boot/grub/files/grub.conf.gentoo >new file mode 100644 >index 0000000..984470b >--- /dev/null >+++ b/sys-boot/grub/files/grub.conf.gentoo >@@ -0,0 +1,16 @@ >+# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook >+# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2 >+# If you are not using Genkernel and you need help creating this file, you >+# should consult the handbook. Alternatively, consult the grub.conf.sample that >+# is included with the Grub documentation. >+ >+default 0 >+timeout 30 >+#splashimage=(hd0,0)/boot/grub/splash.xpm.gz >+ >+#title Gentoo Linux 3.8.13 >+#root (hd0,0) >+#kernel /boot/kernel-genkernel-x86-3.8.13-gentoo root=/dev/sda3 >+#initrd /boot/initramfs-genkernel-x86-3.8.13 >+ >+# vim:ft=conf: >diff --git a/sys-boot/grub/files/grub.default-2 b/sys-boot/grub/files/grub.default-2 >new file mode 100644 >index 0000000..5075314 >--- /dev/null >+++ b/sys-boot/grub/files/grub.default-2 >@@ -0,0 +1,46 @@ >+# Copyright 1999-2013 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $ >+# >+# To populate all changes in this file you need to regenerate your >+# grub configuration file afterwards: >+# 'grub2-mkconfig -o /boot/grub/grub.cfg' >+# >+# See the grub info page for documentation on possible variables and >+# their associated values. >+ >+GRUB_DISTRIBUTOR="Gentoo" >+ >+GRUB_DEFAULT=0 >+GRUB_HIDDEN_TIMEOUT=0 >+GRUB_HIDDEN_TIMEOUT_QUIET=true >+GRUB_TIMEOUT=10 >+ >+# Append parameters to the linux kernel command line >+# GRUB_CMDLINE_LINUX="" >+ >+# 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 >+ >+# Path to theme spec txt file. >+# The starfield is by default provided with use truetype. >+# NOTE: when enabling custom theme, ensure you have required font/etc. >+#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" >+ >+# Background image used on graphical terminal. >+# Can be in various bitmap formats. >+#GRUB_BACKGROUND="/boot/grub/mybackground.png" >+ >+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel >+#GRUB_DISABLE_LINUX_UUID=true >+ >+# Uncomment to disable generation of recovery mode menu entries >+#GRUB_DISABLE_RECOVERY=true >diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-3 >new file mode 100644 >index 0000000..f3f7e47 >--- /dev/null >+++ b/sys-boot/grub/files/grub.default-3 >@@ -0,0 +1,63 @@ >+# Copyright 1999-2014 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-3,v 1.4 2014/10/16 04:04:02 floppym Exp $ >+# >+# To populate all changes in this file you need to regenerate your >+# grub configuration file afterwards: >+# 'grub2-mkconfig -o /boot/grub/grub.cfg' >+# >+# See the grub info page for documentation on possible variables and >+# their associated values. >+ >+GRUB_DISTRIBUTOR="Gentoo" >+ >+# Default menu entry >+#GRUB_DEFAULT=0 >+ >+# Boot the default entry this many seconds after the menu is displayed >+#GRUB_TIMEOUT=5 >+#GRUB_TIMEOUT_STYLE=menu >+ >+# Append parameters to the linux kernel command line >+#GRUB_CMDLINE_LINUX="" >+# >+# Examples: >+# >+# Boot with network interface renaming disabled >+# GRUB_CMDLINE_LINUX="net.ifnames=0" >+# >+# Boot with systemd instead of sysvinit (openrc) >+# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" >+ >+# Append parameters to the linux kernel command line for non-recovery entries >+#GRUB_CMDLINE_LINUX_DEFAULT="" >+ >+# Uncomment to disable graphical terminal (grub-pc only) >+#GRUB_TERMINAL=console >+ >+# The resolution used on graphical terminal. >+# Note that you can use only modes which your graphic card supports via VBE. >+# You can see them in real GRUB with the command `vbeinfo'. >+#GRUB_GFXMODE=640x480 >+ >+# Set to 'text' to force the Linux kernel to boot in normal text >+# mode, 'keep' to preserve the graphics mode set using >+# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular >+# graphics mode, or a sequence of these separated by commas or >+# semicolons to try several modes in sequence. >+#GRUB_GFXPAYLOAD_LINUX= >+ >+# Path to theme spec txt file. >+# The starfield is by default provided with use truetype. >+# NOTE: when enabling custom theme, ensure you have required font/etc. >+#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" >+ >+# Background image used on graphical terminal. >+# Can be in various bitmap formats. >+#GRUB_BACKGROUND="/boot/grub/mybackground.png" >+ >+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel >+#GRUB_DISABLE_LINUX_UUID=true >+ >+# Uncomment to disable generation of recovery mode menu entries >+#GRUB_DISABLE_RECOVERY=true >diff --git a/sys-boot/grub/grub-2.02_beta2-r7.ebuild b/sys-boot/grub/grub-2.02_beta2-r7.ebuild >new file mode 100644 >index 0000000..903bb32 >--- /dev/null >+++ b/sys-boot/grub/grub-2.02_beta2-r7.ebuild >@@ -0,0 +1,328 @@ >+# Copyright 1999-2015 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-2.02_beta2-r7.ebuild,v 1.10 2015/03/17 18:51:49 floppym Exp $ >+ >+EAPI=5 >+ >+AUTOTOOLS_AUTORECONF=1 >+GRUB_AUTOGEN=1 >+ >+if [[ -n ${GRUB_AUTOGEN} ]]; then >+ PYTHON_COMPAT=( python{2_6,2_7,3_2,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 >+ http://dev.gentoo.org/~floppym/dist/${P}-gentoo-r2.tar.xz" >+ S=${WORKDIR}/${MY_P} >+ else >+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz >+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz" >+ S=${WORKDIR}/${P%_*} >+ fi >+ KEYWORDS="amd64 x86" >+ PATCHES=() >+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="http://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=( >+ # everywhere: >+ emu >+ # mips only: >+ qemu-mips loongson >+ # amd64, x86, ppc, ppc64: >+ ieee1275 >+ # amd64, x86: >+ coreboot multiboot efi-32 pc qemu xen >+ # amd64, ia64: >+ efi-64 >+) >+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 >+ 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 >+ >+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" >+ >+ 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 >+ >+ epatch "${FILESDIR}/grub-2.02-musl-no-error.h.patch" >+ >+ 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+=" ${LDFLAGS}" >+ unset LDFLAGS >+ >+ tc-export CC NM OBJCOPY STRIP >+ export TARGET_CC=${TARGET_CC:-${CC}} >+ 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 " http://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 >+} >-- >2.0.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 543840
: 399298