diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2014-10-20 17:22:10 +0000 |
---|---|---|
committer | Ian Stakenvicius <axs@gentoo.org> | 2014-10-20 17:22:10 +0000 |
commit | f54cffa371bb0cdf20a4730e2a8ec932688536c0 (patch) | |
tree | 5610ebaaa61004cea15fcc9a8a81e7372770fdd8 /sys-boot | |
parent | dev-vcs/git-cola: Fix borked README, #526096 (diff) | |
download | historical-f54cffa371bb0cdf20a4730e2a8ec932688536c0.tar.gz historical-f54cffa371bb0cdf20a4730e2a8ec932688536c0.tar.bz2 historical-f54cffa371bb0cdf20a4730e2a8ec932688536c0.zip |
revbump of grub:0 , supporting gx86-multilib (bug 510758) and addressing bugs 479296, 466536 and 418287
Package-Manager: portage-2.2.8-r2/cvs/Linux x86_64
Manifest-Sign-Key: 0x2B6559ED
Diffstat (limited to 'sys-boot')
-rw-r--r-- | sys-boot/grub/ChangeLog | 10 | ||||
-rw-r--r-- | sys-boot/grub/Manifest | 12 | ||||
-rw-r--r-- | sys-boot/grub/files/grub-0.97-force-ld.bfd.patch | 12 | ||||
-rw-r--r-- | sys-boot/grub/files/grub.conf.gentoo | 6 | ||||
-rw-r--r-- | sys-boot/grub/grub-0.97-r14.ebuild | 300 |
5 files changed, 331 insertions, 9 deletions
diff --git a/sys-boot/grub/ChangeLog b/sys-boot/grub/ChangeLog index d55947d6ac38..ad8d5930b628 100644 --- a/sys-boot/grub/ChangeLog +++ b/sys-boot/grub/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-boot/grub # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.321 2014/10/19 01:51:58 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.322 2014/10/20 17:22:05 axs Exp $ + +*grub-0.97-r14 (20 Oct 2014) + + 20 Oct 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org> + +files/grub-0.97-force-ld.bfd.patch, +grub-0.97-r14.ebuild, + files/grub.conf.gentoo: + revbump of grub:0 , supporting gx86-multilib (bug 510758) and addressing bugs + 479296, 466536 and 418287 19 Oct 2014; Mike Gilbert <floppym@gentoo.org> grub-9999-r1.ebuild: Update to latest unifont. diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index 89c726c5be58..e613836e480a 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -10,9 +10,10 @@ AUX 2.02_beta2/0006-change-stop-condition-to-avoid-infinite-loops.patch 1080 SHA AUX 2.02_beta2/0007-Improve-LVM-logical_volumes-string-matching.patch 920 SHA256 30c8894c24fa57c73fc8fff74d9ed8e4d02e1e1cc86b335447e4954783f54f25 SHA512 1a912f67439bb565f5207ed41a34a7552047181efa9765356ac79ad6306f015061830e952b0169fb52334110e377b63766213d3866c4bd609ffcecccf387c6d7 WHIRLPOOL 42047c2bf01155fd0520a4d6176396f31b37af6626406c6b951ee294e95c14b4c7509a1936b8c116bba4279a5d2c817170793b710065b4a22dd099fd7c42e4e1 AUX 2.02_beta2/0008-Fix-an-infinite-loop-in-grub-mkconfig.patch 2863 SHA256 1f1f0b764ccb6ea462b18801ba99e87cbdc001a0fe744030189476b05ef3595a SHA512 1bd1cea5624fa74455ef99840daf60c2b97a858e7a1cecd6bd864ddbc53c9a4b71ce9753ed1997ab20c93a5a2d494cfa8a2a8ba1bff93daf0e2064c8642b9a20 WHIRLPOOL d0b72d01652badf8c618b7ac110c832ba7c7b4ce83249798334183055d8b916f475aff1fec868a930e4e7b384462709e9afc876d2f224510beab426789522de7 AUX 2.02_beta2/0009-Fix-incorrect-address-reference-in-btrfs.patch 1325 SHA256 99d180975be674eb36f079a7cf747e58a5753b10f008d4326d98af91a211d5ac SHA512 72d1ea98eab8739e23c2dc8eabb98ceb90f6f378ebd089c80ea6239dcfd7fbb7763b577b4ed4798f63464c439bcc88a9c597156860746f2db19a5f5f6bdbb122 WHIRLPOOL dab297c2fca123c07ea9b07affadd510864f0c261280bc164f46d4231a05526112767f5033a231138726746053c0aefe8efc8123fcf671dbe06181a296d459e9 +AUX grub-0.97-force-ld.bfd.patch 239 SHA256 e5a69a8fac4dc4240320cdf984f591701485392113398ed93d7ea41fa2a9f368 SHA512 7b4edcb013cdc4994c51e8598f63743991013118e6d3d07fd52b1bf0950d51b938981547bf1e488fa9949fdcd3c241b44be17bdb92f556293927e4f5445641ae WHIRLPOOL bf12bbe78947a8706851f5b6fc4cb6f5a821ef82311715c822abff86bbaefe4f6a7528fb2c3cbf9cd1365e20bbed9bac6bbc61bae776ba10f05b64b6361ab48c AUX grub-2.00-freetype-2.5.1.patch 752 SHA256 95ddb348097df2bdf51a36529935118ad4bb51cb780038d149ed0ae3bf0693c9 SHA512 e9d05de956364b923e01d8f71d77f05d6c0815b7ae21ec5d34875de09770ce42b52f7d410314f7e4a273256350d7cbf311cf95a5d83e469c7a83b9b69879caff WHIRLPOOL 67751eaad605cf064106f2a304657bf1fe1ea1f4bb3f6efe436f2d7e6b84e80b56327e51cff4db63a7f34e7f21a456d3c7517d6ee6da5f8f2cbd7816f34d4016 AUX grub-2.02_beta2-libzfs.patch 612 SHA256 f2de3680168e7a88261ac3f0fab6131ad3e22ce732ce969c0dc0efbf583aaddb SHA512 17810d390c90e39df63121af4d8dd670a87703d3f589aa26edde7c7e9f8f6e88dfb93a156040062c6cfe03615126970b3b073d688b3ec52cfb6ae401ad31754c WHIRLPOOL 0f19a0684b04bd7494068686fb6596a5f7c4a2e1dc47edb21c4841342876414b5caf367c0cb777e1b42f82e8db1d8eccb20151f89c36da7050aeb9db1616ad4f -AUX grub.conf.gentoo 627 SHA256 914b15af252210a32776196437cd8013e10e57d5780e66877ef3fe9a2b4b9776 SHA512 5ee586c151b025a153867d2854b73e2e18a6af38e9d65069b7114a55af776803ba947b4901b0806e79fa8f36aeac90daad608b9ec2a4a8526301d1beb36e4ef3 WHIRLPOOL fcaef85cd7c2c446c882874cf4ec8a2241d1fc97720973a0a0cd1add259da599d4dae4d0b429ba2dff0307ed2d4598d5939cbc1b11127a0dedb3a54249ec9f81 +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 @@ -26,16 +27,17 @@ DIST unifont-7.0.01.pcf.gz 1358916 SHA256 7618a96ad50703213848af8ecae816828f528b DIST unifont-7.0.05.pcf.gz 1359030 SHA256 c897bc3796b1c460d13fbed1d6d800027886405efa3715a31275183d3f85ce91 SHA512 d75d810521306e912228e10d7e08749392ade4b9f35199fa43694c57779054f152ba9b30ce6c3b3bd9bb925f60aebbb99f00d3448ed039e748e0353c787d9336 WHIRLPOOL 1af9cb9b6b3a4c46e596228d3231ef160300b0a5545c3e091eaceeb2b522ac1b25721f17f7f2f742a5a1ab92ccedebf4fe2649260284ab208dbd8696fa69594c EBUILD grub-0.97-r12.ebuild 9233 SHA256 d5486666e1f8339a8308489607c9108cd34e8ebc696a956e2ff8dafad1c71815 SHA512 332a89395331ef04654345f960f2939340ce9b47ae6ac755e54f4ecc85f6243060890e7553b515468aaffd8346bbb5a0b7fbd26d23911b847f12c557854e96f1 WHIRLPOOL 1a20c9df999954ce431ca50eaaa5651721c939229b3a55d820445620218ffa64d43ba6251e88b1df6f54163f6914265596698db513a47d3c415ccaa01b51e61d EBUILD grub-0.97-r13.ebuild 9384 SHA256 c694ab37f477548da2b98c9beb2c5432ddd799e40fcbf82273cd2da3fdb072e1 SHA512 615e4d11ba91c7bc2fcb926bfc791d1aa3151a06dd336f9597ccc5b22a4b6a1bbffde5f7622ec6cc4c04216c63d99becfc9cf38bcf8fed476773bd3b7930fad2 WHIRLPOOL 91d94e1f90393bb5137b791bfa2d73b418938091d81ec44b783d749ea08ee3a615a5ca4d07a841c66429f6ff7d480ae2ad4f0626576ddaab459f111106160761 +EBUILD grub-0.97-r14.ebuild 9781 SHA256 cf6579d966fb3f0509920070fa4a931908c1e72819358ee11e3cbae284cdb97e SHA512 969c9d551dff202618e4b09d4c3572fb92d6a67cba019c18ba7a29853ce2be8dbad25cf7c58a77dc4973d7b2109dda15410b75ad27e4dd6325ae3555b2381d95 WHIRLPOOL aee95da509c3aa45b8dc118d705d3051d052ab053cdc2baf906c2f1fb698097c0ecdd1ef279c2a9867e3989d465cf5ea0078c6fe25146475e84edc237268f578 EBUILD grub-2.00_p5107-r2.ebuild 8180 SHA256 1db3f6266e63332ef89d9c32895189fee3307a5ca2f687620df43c5a9d52547a SHA512 f95264d8eff99a1dd8420d64539aef4b7eb464edc8119076af7c175fac418d0e554ee7bb0ae4edb57c3a1a5b82f32da51db6b7ffc4a9a62dc7541d3694b65faa WHIRLPOOL d1dd247120f6de17aaea2899760fd7daf3eb242a3945f6ae2c03eae71c33e3c6bb780639a030d9ba46f4b9b8f23d383fc6559306e40a82be293466ce6d6270a5 EBUILD grub-2.02_beta2-r2.ebuild 8369 SHA256 a642f1d89a6ccf56ef108a0b155258e33a4d40a6247832a4604a4c1b109012ac SHA512 d4ff246cea719df609eab9f17d5b9d16a84cfc5d931ce2d53bd696ee08576bc506f4bf37e23cb6c6046acd534b49af41b5972533067663918db4797426ff3f32 WHIRLPOOL 8b088f40c6cd9cc2451c123fe1f660005792209c83c946b4af91719c4dee04a3eff33c2f0498db985040663c56f6cdf05d49794d1518965efe11465cd52ccf05 EBUILD grub-2.02_beta2.ebuild 8304 SHA256 7c41c4abbb6daef697960d00f9f44f2779095b4918ac975c97799c0fd38b958f SHA512 07ee0e1605e12899d5544db3e3672d4c91f7dcc6b65556d27c32ab1edf9a39a183a6b7be6eeb4ad1f5c4be84dee3a0e18af90867241069c253e4be7185163f54 WHIRLPOOL dc310d7dbea7e310da6f7ee3b1f0563014cba9102f325603cf7d3f7ce6047a93fa4f50777e3b86097c04a372c659eb12ab06ded3293585b0c87c74872c31b5fc EBUILD grub-9999-r1.ebuild 8306 SHA256 5609173790cb6e361c730434a7f050e1bca78423015bf839a3d9cb3c9592e044 SHA512 393dac1f7f638eaa6f6f996042004186cde5bc6cb45241a789579b4529bf56eeaeded86725f5beec564f40e75dd0b10e74189b3aaea571d09679bdeed062792e WHIRLPOOL c91d081afd1b60e0ea018bbfe17d4dcce6b64ac74e60e9dbdbe642ccb8e784d2c7f7e0d50a445aba85dadc96a2e35733f2d5315774f44a67aeffbc2f786d0d7e -MISC ChangeLog 61307 SHA256 4fce216c75961d31d0e07f909a1241787252654bc9d5e9397afed22393101963 SHA512 b310892dd275f16df38780f136964127b8b915d4b741fc35e9aa1f089f33c295f234e2cbb35e98e182e9917d1e3b2fe9f6ead6530150b11e5605ceb62fa4f7cb WHIRLPOOL 02f951af31b583d52039ad1466a945ab50b3182f8dcb8fe9b32aa847446c825cbc4e705ff2cc45aa73ec6fdd7c4e1b5d337ed6268d5f680db4d3673b926587b9 +MISC ChangeLog 61587 SHA256 189d1ef108075cb2eebc96265633b8680848b05b98595d7cd2595fa189dc28d4 SHA512 f7e502812cda6d02f9984aaa8afb82c8f111be1d95e2f596170136c9540cc617b910f1c7c7c036ffcf366a48f85b5f49030c73c486a7acee6236ff65456f6d12 WHIRLPOOL 4b815e5a31491f1207498b553c614bf3edd5a119714219d9c370123ddcc5c19bb0492759f760dd51daefe027eeeadd9eb4276ed215295e3c02ab5be17dbeb4da MISC metadata.xml 838 SHA256 01beea9f20f03e00fdc21576a1311d3c21874980cdd57a9f2ed08a9d7cda1c46 SHA512 f6266f2f77db089d2f9289be079ef5a3637726b0906c5e96a7d8b7e29a8105cb7c48b9739f5607c0fdac2545db0e87f35132769f82b12db11a6f0018cc3c92f2 WHIRLPOOL 528d4f57ca38b0f0d4c34cd6bd60c7aeefc0fabd1e1e7be8efe0fcba04824d047a6e04288f1fbbd8e865c7435b53e84caffe7d4196809b157ee76e0d2be6f8df -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iF4EAREIAAYFAlRDGT8ACgkQC77qH+pIQ6Ru9QEAjF9P27++GzQEjoxOBWvVMeVP -TUx23a52EApGgzluLoMBAJCGmPHfTR/C0pCsTiYnigwdGg9ILzJSaN8ABthANMYX -=DVxd +iF4EAREIAAYFAlRFRMsACgkQ2ugaI38ACPDp5wD/XWkAzTlcd+xiuMkPqdnN3ree +LhUkiJ82ZVczgV686rAA/RfCDCwH5bJSUZeneJdKf7Yl8Ly3q5boweoPjXiegewo +=vNX6 -----END PGP SIGNATURE----- diff --git a/sys-boot/grub/files/grub-0.97-force-ld.bfd.patch b/sys-boot/grub/files/grub-0.97-force-ld.bfd.patch new file mode 100644 index 000000000000..0b3794adbc71 --- /dev/null +++ b/sys-boot/grub/files/grub-0.97-force-ld.bfd.patch @@ -0,0 +1,12 @@ +--- configure.ac 2014-10-20 12:48:18.680041136 -0400 ++++ configure.ac.new 2014-10-20 12:52:11.950045394 -0400 +@@ -54,6 +54,9 @@ + CFLAGS="-m32 $CFLAGS" + fi + ++# Force linking with ld.bfd ++CFLAGS="$CFLAGS -fuse-ld=bfd" ++ + # + # Programs + # diff --git a/sys-boot/grub/files/grub.conf.gentoo b/sys-boot/grub/files/grub.conf.gentoo index 0027099e492a..984470b3860d 100644 --- a/sys-boot/grub/files/grub.conf.gentoo +++ b/sys-boot/grub/files/grub.conf.gentoo @@ -8,9 +8,9 @@ default 0 timeout 30 #splashimage=(hd0,0)/boot/grub/splash.xpm.gz -#title Gentoo Linux 2.6.24-r5 +#title Gentoo Linux 3.8.13 #root (hd0,0) -#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3 -#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5 +#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/grub-0.97-r14.ebuild b/sys-boot/grub/grub-0.97-r14.ebuild new file mode 100644 index 000000000000..b77f24649278 --- /dev/null +++ b/sys-boot/grub/grub-0.97-r14.ebuild @@ -0,0 +1,300 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r14.ebuild,v 1.1 2014/10/20 17:22:05 axs Exp $ + +# XXX: we need to review menu.lst vs grub.conf handling. We've been converting +# all systems to grub.conf (and symlinking menu.lst to grub.conf), but +# we never updated any of the source code (it still all wants menu.lst), +# and there is no indication that upstream is making the transition. + +# If you need to roll a new grub-static distfile, here is how. +# - Robin H. Johnson <robbat2@gentoo.org> - 29 Nov 2010 +# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \ +# USE='static -ncurses -netboot -custom-cflags' \ +# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \ +# grub-${PVR}.ebuild clean package && \ +# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \ +# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2 + +EAPI="4" + +inherit eutils mount-boot toolchain-funcs linux-info flag-o-matic autotools pax-utils multiprocessing + +PATCHVER="1.14" # Should match the revision ideally +DESCRIPTION="GNU GRUB Legacy boot loader" +HOMEPAGE="http://www.gnu.org/software/grub/" +SRC_URI="mirror://gentoo/${P}.tar.gz + mirror://gnu-alpha/${PN}/${P}.tar.gz + mirror://gentoo/splash.xpm.gz + mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-fbsd" +IUSE="custom-cflags ncurses netboot static" + +LIB_DEPEND="ncurses? ( + >=sys-libs/ncurses-5.9-r3[static-libs(+)] + amd64? ( || ( + >=sys-libs/ncurses-5.9-r3[abi_x86_32(-)] + app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] + ) ) + )" +RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)\]/} )" +DEPEND="${RDEPEND} + static? ( ${LIB_DEPEND} )" + +pkg_setup() { + case $(tc-arch) in + amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;; + esac +} + +src_prepare() { + # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as + # discovered in bug 160801. We can change this, however, using larger values + # for this variable means that Grub needs more memory to run and boot. For a + # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom + # value in make.conf, it is possible to make kernels ~16Mb in size, but it + # needs the kitchen sink built-in. + local t="custom" + if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then + case $(tc-arch) in + amd64) GRUB_MAX_KERNEL_SIZE=9 ;; + x86) GRUB_MAX_KERNEL_SIZE=5 ;; + esac + t="default" + fi + einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)" + + sed -i \ + -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \ + "${S}"/grub/asmstub.c \ + || die + + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch + + rm -f "${S}"/aclocal.m4 # seems to keep bug 418287 away + # Force ld.bfd via configure.ac so as to not mess up the CFLAGS stuff in src_configure() + # Note: NOT adding this to the patchset because it's a hack that I don't like. + # bug 466536 + epatch "${FILESDIR}"/${P}-force-ld.bfd.patch + + eautoreconf +} + +src_configure() { + filter-flags -fPIE #168834 + + use amd64 && multilib_toolchain_setup x86 + + unset BLOCK_SIZE #73499 + + ### i686-specific code in the boot loader is a bad idea; disabling to ensure + ### at least some compatibility if the hard drive is moved to an older or + ### incompatible system. + + # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2, + # but the objcopy's (faulty) test fails if -fstack-protector is default. + # create a cache telling configure that objcopy is ok, and add -C to econf + # to make use of the cache. + # + # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails. + # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites + # -fno-stack-protector detected by configure, removed from netboot's emake. + use custom-cflags || unset CFLAGS + + export grub_cv_prog_objcopy_absolute=yes #79734 + use static && append-ldflags -static + + # Per bug 216625, the emul packages do not provide .a libs for performing + # suitable static linking + if use amd64 && use static ; then + if [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] ; then + eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This" + eerror "is specifically intended for building the tarballs for the" + eerror "grub-static package via USE='static -ncurses'." + eerror "All bets are now off." + elif ! has_package ">=sys-libs/ncurses-5.9-r3[abi_x86_32(-),static-libs]"; then + die "You must use the grub-static package if you want a static Grub on amd64!" + fi + fi + + multijob_init + + # build the net-bootable grub first, but only if "netboot" is set + if use netboot ; then + ( + multijob_child_init + mkdir -p "${WORKDIR}"/netboot + pushd "${WORKDIR}"/netboot >/dev/null + ECONF_SOURCE=${S} \ + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + --enable-diskless \ + --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ + --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ + --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ + --enable-{tulip,via-rhine,w89c840} + popd >/dev/null + ) & + multijob_post_fork + fi + + # Now build the regular grub + # Note that FFS and UFS2 support are broken for now - stage1_5 files too big + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + $(use_with ncurses curses) + + # sanity check due to common failure + use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found" + + multijob_finish +} + +src_compile() { + use netboot && emake -C "${WORKDIR}"/netboot w89c840_o_CFLAGS="-O" + emake +} + +src_test() { + # non-default block size also give false pass/fails. + unset BLOCK_SIZE + emake -j1 check +} + +src_install() { + default + if use netboot ; then + exeinto /usr/lib/grub/${CHOST} + doexe "${WORKDIR}"/netboot/stage2/{nbgrub,pxegrub} + newexe "${WORKDIR}"/netboot/stage2/stage2 stage2.netboot + fi + + pax-mark -m "${D}"/sbin/grub #330745 + + newdoc docs/menu.lst grub.conf.sample + dodoc "${FILESDIR}"/grub.conf.gentoo + + [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] && \ + mv "${D}"/usr/share/doc/{${PF},grub-static-${PF/grub-}} + + insinto /usr/share/grub + doins "${DISTDIR}"/splash.xpm.gz +} + +setup_boot_dir() { + local boot_dir=$1 + local dir=${boot_dir} + + mkdir -p "${dir}" + [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" + dir="${dir}/grub" + if [[ ! -e ${dir} ]] ; then + mkdir "${dir}" || die + fi + + # change menu.lst to grub.conf + if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then + mv -f "${dir}"/menu.lst "${dir}"/grub.conf + ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" + echo + fi + + if [[ ! -e ${dir}/menu.lst ]]; then + einfo "Linking from new grub.conf name to menu.lst" + ln -snf grub.conf "${dir}"/menu.lst + fi + + if [[ -e ${dir}/stage2 ]] ; then + mv "${dir}"/stage2{,.old} + ewarn "*** IMPORTANT NOTE: you must run grub and install" + ewarn "the new version's stage1 to your MBR. Until you do," + ewarn "stage1 and stage2 will still be the old version, but" + ewarn "later stages will be the new version, which could" + ewarn "cause problems such as an unbootable system." + ewarn + ewarn "This means you must use either grub-install or perform" + ewarn "root/setup manually." + ewarn + ewarn "For more help, see the handbook:" + ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto" + echo + fi + + einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}" + for x in \ + "${ROOT}"/lib*/grub/*/* \ + "${ROOT}"/usr/share/grub/* ; do + [[ -f ${x} ]] && cp -p "${x}" "${dir}"/ + done + + if [[ ! -e ${dir}/grub.conf ]] ; then + s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" + [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf + [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf + [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf + fi + + # Per bug 218599, we support grub.conf.install for users that want to run a + # specific set of Grub setup commands rather than the default ones. + grub_config=${dir}/grub.conf.install + [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf + if [[ -e ${grub_config} ]] ; then + egrep \ + -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ + "${grub_config}" | \ + /sbin/grub --batch \ + --device-map="${dir}"/device.map \ + > /dev/null + fi + + # the grub default commands silently piss themselves if + # the default file does not exist ahead of time + if [[ ! -e ${dir}/default ]] ; then + grub-set-default --root-directory="${boot_dir}" default + fi + einfo "Grub has been installed to ${boot_dir} successfully." +} + +pkg_postinst() { + mount-boot_mount_boot_partition + + if [[ -n ${DONT_MOUNT_BOOT} ]]; then + elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" + elog "the following instructions for your /boot!" + elog "Neglecting to do so may cause your system to fail to boot!" + elog + else + setup_boot_dir "${ROOT}"/boot + # Trailing output because if this is run from pkg_postinst, it gets mixed into + # the other output. + einfo "" + fi + elog "To interactively install grub files to another device such as a USB" + elog "stick, just run the following and specify the directory as prompted:" + elog " emerge --config =${PF}" + elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" + elog "grub where to install in a non-interactive way." + + # needs to be after we call setup_boot_dir + mount-boot_pkg_postinst +} + +pkg_config() { + local dir + if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then + einfo "Enter the directory where you want to setup grub:" + read dir + else + dir="${GRUB_ALT_INSTALLDIR}" + fi + setup_boot_dir "${dir}" +} |