chore(sys-boot/grub-static/): import from portage

Change-Id: Ic26c0ab5a8862e5caf0dd32ec3cedf7c49214754
This commit is contained in:
Brandon Philips 2013-02-15 16:35:05 -08:00
parent 67917e41e6
commit b8763c4a01
9 changed files with 947 additions and 0 deletions

View File

@ -0,0 +1,156 @@
# ChangeLog for sys-boot/grub-static
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/ChangeLog,v 1.34 2012/08/08 15:01:59 ago Exp $
08 Aug 2012; Agostino Sarubbo <ago@gentoo.org> grub-static-0.97-r12.ebuild:
Stable for AMD64, wrt bug #418393
23 Jul 2012; Mike Frysinger <vapier@gentoo.org> grub-static-0.96-r1.ebuild,
grub-static-0.97-r10.ebuild, grub-static-0.97-r12.ebuild,
grub-static-0.97-r6.ebuild, grub-static-0.97-r9.ebuild,
grub-static-0.97.ebuild:
Block grub-0.9x versions only #398451 by Duncan.
*grub-static-0.97-r12 (02 Jun 2012)
02 Jun 2012; Mike Frysinger <vapier@gentoo.org> +grub-static-0.97-r12.ebuild:
Version bump.
10 Apr 2011; Ulrich Mueller <ulm@gentoo.org> grub-static-0.96-r1.ebuild,
grub-static-0.97.ebuild, grub-static-0.97-r6.ebuild,
grub-static-0.97-r9.ebuild, grub-static-0.97-r10.ebuild:
Don't PROVIDE virtual/bootloader, bug 359971.
24 Feb 2011; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r10.ebuild:
One more bit for hanno. I_KNOW_WHAT_IM_DOING=1 will now enable you to install
an unusable grub on amd64 systems without IA32_EMULATION, for specific rescue
situations.
24 Feb 2011; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r10.ebuild:
Provide advanced option for hanno to help with system rescues.
21 Feb 2011; Markos Chandras <hwoarang@gentoo.org>
grub-static-0.97-r10.ebuild:
Stable on amd64 wrt bug #355693
09 Jan 2011; Mike Frysinger <vapier@gentoo.org>
grub-static-0.97-r9.ebuild, grub-static-0.97-r10.ebuild:
Use new mount-boot_pkg_postinst helper.
30 Nov 2010; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.96-r1.ebuild, grub-static-0.97.ebuild,
grub-static-0.97-r6.ebuild, grub-static-0.97-r9.ebuild,
grub-static-0.97-r10.ebuild:
QA cleanup for repoman happiness.
*grub-static-0.97-r10 (30 Nov 2010)
30 Nov 2010; Robin H. Johnson <robbat2@gentoo.org>
+grub-static-0.97-r10.ebuild:
Bump grub-static to match grub 0.97-r10.
12 Dec 2009; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r9.ebuild:
Suppress the pre-stripped warning.
12 Dec 2009; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r9.ebuild:
Bug #296537: Increase the warnings and catch where the user does not have
IA32_EMULATION set, by trying to run the binary.
04 Jul 2009; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r9.ebuild:
Port from sys-boot/grub: Bug #261857: easier install with $ROOT usage.
04 Jul 2009; Robin H. Johnson <robbat2@gentoo.org>
grub-static-0.97-r9.ebuild:
Bug #255271: check for IA32_EMULATION on 64-bit, as we are building a
32-bit binary and need to be able to run it.
15 May 2009; Markus Meier <maekke@gentoo.org> grub-static-0.97-r9.ebuild:
amd64 stable, bug #269201
14 May 2009; Christian Faulhammer <fauli@gentoo.org>
grub-static-0.97-r9.ebuild:
x86 stable, bug 269201
11 Jan 2009; Markus Meier <maekke@gentoo.org> grub-static-0.97-r6.ebuild:
amd64 stable, bug #254028
*grub-static-0.97-r9 (03 Jan 2009)
03 Jan 2009; Christoph Mende <angelos@gentoo.org>
+grub-static-0.97-r9.ebuild:
Version bump to match sys-boot/grub
28 Oct 2008; Christoph Mende <angelos@gentoo.org>
grub-static-0.97-r6.ebuild:
Added missing inherit eutils, bug 244706
*grub-static-0.97-r6 (27 Oct 2008)
27 Oct 2008; Robin H. Johnson <robbat2@gentoo.org>
+grub-static-0.97-r6.ebuild:
Bug #239224, version bump to match current non-static build. See bug for
full list of fixes. Beware /boot/grub/splash.xpm.gz sometimes vanishing
due to a Portage bug. Make SURE you follow the upgrade instructions or you
might end up with a non-booting box.
25 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
grub-static-0.97.ebuild:
Sync with sys-boot/grub.
20 Dec 2006; Daniel Drake <dsd@gentoo.org> grub-static-0.97.ebuild:
Stable on amd64, bug #156459
12 Nov 2006; Olivier Crête <tester@gentoo.org> grub-static-0.97.ebuild:
Inherit mount-boot to auto-mount boot partition r/w
03 Nov 2006; Olivier Crête <tester@gentoo.org> grub-static-0.97.ebuild:
Added code to install into /boot in pkg_postinst from grub ebuild, see bug
#153956
*grub-static-0.97 (23 Oct 2006)
23 Oct 2006; Daniel Drake <dsd@gentoo.org> +grub-static-0.97.ebuild:
New version, generated from sys-boot/grub-0.97-r3
16 Sep 2006; <blubb@gentoo.org> -grub-static-0.93.20030118.ebuild:
version cleanups
07 Sep 2006; <blubb@gentoo.org> grub-static-0.96-r1.ebuild:
stable on amd64
*grub-static-0.96-r1 (13 Jun 2006)
13 Jun 2006; Simon Stelling <blubb@gentoo.org> -grub-static-0.96.ebuild,
+grub-static-0.96-r1.ebuild:
fix bug 136594
12 Jun 2006; Olivier Crête <tester@gentoo.org>
files/digest-grub-static-0.96, Manifest:
Fixed digest
*grub-static-0.96 (11 Jun 2006)
11 Jun 2006; Simon Stelling <blubb@gentoo.org>
grub-static-0.93.20030118.ebuild, +grub-static-0.96.ebuild:
clean up KEYWORDS and bump to amore recent version
15 Feb 2006; Olivier Crête <tester@gentoo.org>
grub-static-0.93.20030118.ebuild:
Fix blocker for sys-apps -> sys-boot move
*grub-static-0.93.20030118 (08 Dec 2003)
08 Dec 2003; Seemant Kulleen <seemant@gentoo.org>
grub-static-0.93.20030118.ebuild, metadata.xml:
moved from sys-apps to sys-boot
*grub-static-0.93.20030118 (26 Jul 2003)
26 Jul 2003; Olivier Crete <tester@gentoo.org>
grub-static-0.93.20030118.ebuild:
Initial version of grub static for amd64 since there is no 64-bit bootloader

View File

@ -0,0 +1,28 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
DIST grub-static-0.96.tar.bz2 859179 SHA256 3ece8910e7954ca2c2cbebc4d05cfb22e73455f826508661a5b1a60481dcbd76
DIST grub-static-0.97-r10.tar.bz2 888963 SHA256 812c8113efa13b6bfe254e866204b4763bf889c796835ed0b53cb64920428d82 SHA512 2a18405c9f7b0712dac2246213f723c1a2be6734bff133b7906e7c18e4370faf924f35d3b834d74761cf50b3ab59e969fbff010e13292618187c65a72aa45a87 WHIRLPOOL 418246dacc50d1232b657ed4a81f8ec34149008e4312109ced834cbc8b380bef7ba2cd4339b22dac521d823723e360d6a70f87e8601979e80673510ea597e0b0
DIST grub-static-0.97-r12.tar.bz2 1171586 SHA256 865eb5b3131d30be7ddbbc6969e924f2d199353c076504a2668a8df5be17c51f SHA512 0a4c0b3b556db366df70c7c51a1a26f614f949be4002d7f9a053b7261b80c2c49410e8fd04c7e3717ea560e7cbc6a692d859d07bdfe2099a78a33bce78ac5395 WHIRLPOOL c6e05b297d8cf8c6d84495a122502740d2102c32f14bd2df8b80c9e43a91c7f58f50297dbd4e2ba70fe7aee44a0f06bfff94e597fbddc65fa5b93efd4c2e9fea
DIST grub-static-0.97-r6.tar.bz2 1005650 SHA256 1a17a8df6839401f7d1829aebea45c1654c3fcdd6a6f068100126d2fcbe75698
DIST grub-static-0.97-r9.tar.bz2 937621 SHA256 0d6af53c5380bd37ea67f314236364baebfff52762ea5e52bf2f66941dabe2d1 SHA512 a8b1f7cd416f2c41c88ba5c34889e7afe9615bf985e69b2d1d3ec2a20b7ceb13e53e8b3df91a5077bfa1a217f3274362033d72f9bafe3ad22be378f26728035c WHIRLPOOL 48c3556902369232a3ee5b1a9a0a61ebb951fd8c25590262d1c944170918e9d4e98fcf3ba3ccd47707e52aabca426c328cc7ad38f97baa9052d61d26a90522ab
DIST grub-static-0.97.tar.bz2 954051 SHA256 468ac48823880bd7cb2dd6bf60673adef1313c44a5e3131a0a4a37d2cc1145bc
EBUILD grub-static-0.96-r1.ebuild 524 SHA256 c76bc5b61da0e916e9ed8241cd8261ab2450f0ba114a6f5f47c070a4488257ce SHA512 c3cff2018b4bf5a6b86aa8ce2248cc3464301aa093f6d272057ce8ad1b023c25e2d7be12dbbf934c8e35d723fad30ef9aa9fdf66035a2e2bd503e0f6e76ded55 WHIRLPOOL cf814bf5e7ba99b7dc1238969179f5c761649a2230ee90b46d9fbe5067a7ace0794c0f7649b813e25f09f38b3731c9cfdbdee30176abf551e6ce5407f90b9a11
EBUILD grub-static-0.97-r10.ebuild 5515 SHA256 4b33ef5aade9667391a8d677afe41358249adef6fdf29e1084e327471ee20dc0 SHA512 8a890fb67dacfdebecb0a67fc9a4f16e63bfb71e8a9f526e34ee9b4ec440c0c9b36edfd40fa26c851c348f39a5a5f4d31b02a8aa28dfdd30288cc7c4658367f6 WHIRLPOOL f9b6396984ef10c268cf51850c390937ea4168612ec23bfa989c1da3a885cd6ded3a6c5702a06ac1a8664108e966fbd081be647fbdbdacc6eca8d953832fe297
EBUILD grub-static-0.97-r12.ebuild 5512 SHA256 c980b30540d0e782a72654831d0114f58eb32be0578eec8cf398077e02f65d5c SHA512 fe560b36096406b5dc1cb16c7ead61c72a7fd6352d2e47e03f5dafdba24efbb9a902506873969a35841dd8799c67deae92902a9887db6183a20fc5e4e23bd763 WHIRLPOOL 6240b0dcf9b34f40dc4154668953b0211140d77e51187e9224fa52e4d93a81527c2c8afa86c05f07b2dc2bfd6120d8da6eff642c18d95b4ad73ec1eb6b5c86ee
EBUILD grub-static-0.97-r6.ebuild 4444 SHA256 bcf845e0eaa788351719569b11eaaddf9c058e41abed2745f756f6fbb653be42 SHA512 ce44b4175ca7f1d5f23a8a2e5d67b549a9f2829cbba569c97ccd740d2401d5a1835ae590d84245e0b6319b5a66f0cfe4d71b82b77953e4bdb7878f077db7a5b1 WHIRLPOOL 3e5a4ac3aefb5ec8527538115b59aa2af2c745fcb94fb451622e22949d146c0d9eee8ea33a5feea3feb83458c06348290a061d6321aeba5ecc469b5a91dcd5b4
EBUILD grub-static-0.97-r9.ebuild 5410 SHA256 81967d1bfd6571ffbc3081b70fd83da1a36a8a86152b2eca88a746ce09c21919 SHA512 b0f5b784d85f2e45d19bf2a734f9873d8e9378b0d644544b2bf4c6dc8a019c90b76f0484758418b4763229065a290aa988a5ce164e2b5ab6e9f28807bdb8bbb9 WHIRLPOOL 34fb3114fabdb61d36d24f946f93fa27db0afdbec0f3cbabc922f22dc19cebc08a67d1eadc685d213c5081616324e4c3cde7ccd3495abba82ad350c84d6cf83b
EBUILD grub-static-0.97.ebuild 2035 SHA256 d62c1a79d01ac284eec13d604b827d663966945c5d3209b0cf0358beb9e96e9e SHA512 9b4a940f84b6bf09f8b6404cb1c63bc84830f45610b25fdc58927038bc711b1a1e1602561eeb9bee4a36ca47f5b9f1cf92b1de0c276e242aebef5056641c7c02 WHIRLPOOL 8c7750e5c5cfdc939034651095d545214f28b205c08800ee4c15f37d3c2d30315ea2917b51c9d9bb38920755f94bc45fd35fb2c6bfe7c0d156b585d19c143f87
MISC ChangeLog 5551 SHA256 fd373c083a05ef17a5074741d41801878c868780888a079f7fc200085e2cd90f SHA512 524d7b8cf0fe52981a189151d8be58aa545b36b8938378944aa6d29aaa717b07f449155e44a5a54025292162f72cd7562408808966b88970929826166e54af52 WHIRLPOOL d35df4dfea54ce55500d840f48e21b0a6fadb0f0521108e45849a8354b0bad5528afc635f0e149c2f27dd4dea308f4318b9c1bc322a6d2c88d5bb811b486c07e
MISC metadata.xml 158 SHA256 0df9eb61f6a4e4a3f8fc16386b0204e22e85940533d769d4a0418a4ecec50d90 SHA512 e59c9f002f414c281cb69001ab64a9f772689b4accb0cc9173d94d2164be3c38c72ce6e36c2b522442a3de954cf88d6f2b6fb74bdfe9e2e2735e78c9c583283e WHIRLPOOL aaab4e99a3175a7ccbd5ee673a7646f1a32ff56b1670bde20322f827caaf63e4993ea9ab9c7fd1ca2fd89b06dd4b68b0956ab40515d6fcb5ec6f484621085a44
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQEcBAEBCgAGBQJQIn9wAAoJEOTDgjZ80txdO2wH/3SjLqKw7prhH0pHW2AYOMNy
Sa/qtPWAi4rplk2fmuVMilRzQr4nLswLYAtOZ8fasW7imEUUuMguNhWoztJEjPXm
2TXZxdnIq28cjZDmsaDRFCl+JNaSS8yncd9ggySIoKLSZJ3yk4g1RWTVnhp5Nb84
AgGAkp/HXQDHD0lCiBTHxEo4XJzz5d2L5QpqIbQeBV/bCzyXfLm6BTq28chUck1V
BkSxfSvBQ3r0q1gLTAWDE9jshBQ0xTwDsiZW1E4tV4t7idY5Tg7zxJKafZ/1WTSa
5tBasrQ6vNV98yBY5TsomozUY3Fj4PquCaX/l5HERJraEVMR4ivxNHommJAiL/s=
=HPyp
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,18 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.96-r1.ebuild,v 1.5 2012/07/23 03:49:58 vapier Exp $
DESCRIPTION="Static GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/grub-static-${PV}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
src_install() {
cp -a "${WORKDIR}"/* "${D}"/
}

View File

@ -0,0 +1,176 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r10.ebuild,v 1.8 2012/07/23 03:49:58 vapier 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.
inherit eutils mount-boot toolchain-funcs linux-info
PATCHVER="1.9" # Not used, just for tracking with main grub
DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${PF}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
# These are already stripped since we use a binpkg.
QA_PRESTRIPPED="/sbin/grub /bin/mbchk"
pkg_setup() {
local arch="$(tc-arch)"
case ${arch} in
amd64)
CONFIG_CHECK='~IA32_EMULATION'
WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
check_extra_config
;;
esac
}
src_install() {
cp -a "${WORKDIR}"/* "${D}"/
if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
fi
}
run_test_grub() {
local grub="$1"
local version="$(${grub} \
--read-only --no-pager --no-floppy --no-curses \
--no-config-file --batch --version)"
local error="grub test-run failed"
use amd64 && error="${error} Is IA32_EMULATION set?"
[ "${version/${PV}}" != "${version}" ] || die "${error}"
return 0
}
#
# Below this point, everything is also used in grub-static!
# Please keep in sync!
#
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
run_test_grub /sbin/grub
fi
mkdir -p "${dir}"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
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 "This means you must use either grub-install or perform"
ewarn "root/setup manually! For more help, see the handbook:"
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
ebeep
fi
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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
local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${grub_config}" >"${tmp}"
# Do NOT fail here, only warn.
/sbin/grub --batch \
--device-map="${dir}"/device.map \
>/dev/null <"${tmp}"
rc=$?
[[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
fi
# the grub default commands silently piss themselves if
# the default file does not exist ahead of time
if [[ ! -e ${dir}/default ]] ; then
# This may fail, don't worry about it.
grub-set-default --root-directory="${boot_dir}" default
:
fi
einfo "Grub has been installed to ${boot_dir} successfully."
}
pkg_postinst() {
mount-boot_pkg_postinst
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."
}
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}"
}

View File

@ -0,0 +1,180 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r12.ebuild,v 1.3 2012/08/08 15:01:59 ago 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.
inherit eutils mount-boot toolchain-funcs linux-info
PATCHVER="1.14" # Not used, just for tracking with main grub
DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${PF}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
S=${WORKDIR}
pkg_setup() {
case $(tc-arch) in
amd64)
CONFIG_CHECK='~IA32_EMULATION'
WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
check_extra_config
;;
esac
}
src_install() {
cp -a * "${D}"/
# Make sure the docs get compressed
dodoc usr/share/doc/${PF}/*
if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
fi
}
run_test_grub() {
local grub="$1"
local version="$(${grub} \
--read-only --no-pager --no-floppy --no-curses \
--no-config-file --batch --version)"
local error="grub test-run failed"
use amd64 && error="${error} Is IA32_EMULATION set?"
[ "${version/${PV}}" != "${version}" ] || die "${error}"
return 0
}
#
# Below this point, everything is also used in grub-static!
# Please keep in sync!
#
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
run_test_grub /sbin/grub
fi
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
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
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 "This means you must use either grub-install or perform"
ewarn "root/setup manually! For more help, see the handbook:"
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
ebeep
fi
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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
local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${grub_config}" >"${tmp}"
# Do NOT fail here, only warn.
/sbin/grub --batch \
--device-map="${dir}"/device.map \
>/dev/null <"${tmp}"
rc=$?
[[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
fi
# the grub default commands silently piss themselves if
# the default file does not exist ahead of time
if [[ ! -e ${dir}/default ]] ; then
# This may fail, don't worry about it.
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}"
}

View File

@ -0,0 +1,136 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r6.ebuild,v 1.7 2012/07/23 03:49:58 vapier 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.
inherit eutils mount-boot
PATCHVER="1.7" # Not used, just for tracking with main grub
DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${PF}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
src_install() {
cp -a "${WORKDIR}"/* "${D}"/
}
#
# Below this point, everything is also used in grub-static!
# Please keep in sync!
#
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
[[ ! -e ${dir} ]] && die "${dir} does not exist!"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
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 "This means you must use either grub-install or perform"
ewarn "root/setup manually! For more help, see the handbook:"
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
ebeep
fi
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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() {
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."
}
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}"
}

View File

@ -0,0 +1,172 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r9.ebuild,v 1.12 2012/07/23 03:49:58 vapier 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.
inherit eutils mount-boot toolchain-funcs linux-info
PATCHVER="1.9" # Not used, just for tracking with main grub
DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${PF}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
# These are already stripped since we use a binpkg.
QA_PRESTRIPPED="/sbin/grub /bin/mbchk"
pkg_setup() {
local arch="$(tc-arch)"
case ${arch} in
amd64)
CONFIG_CHECK='~IA32_EMULATION'
WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
check_extra_config
;;
esac
}
src_install() {
cp -a "${WORKDIR}"/* "${D}"/
run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
}
run_test_grub() {
local grub="$1"
local version="$(${grub} \
--read-only --no-pager --no-floppy --no-curses \
--no-config-file --batch --version)"
local error="grub test-run failed"
use amd64 && error="${error} Is IA32_EMULATION set?"
[ "${version/${PV}}" != "${version}" ] || die "${error}"
return 0
}
#
# Below this point, everything is also used in grub-static!
# Please keep in sync!
#
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
run_test_grub /sbin/grub
mkdir -p "${dir}"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
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 "This means you must use either grub-install or perform"
ewarn "root/setup manually! For more help, see the handbook:"
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
ebeep
fi
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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
local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${grub_config}" >"${tmp}"
# Do NOT fail here, only warn.
/sbin/grub --batch \
--device-map="${dir}"/device.map \
>/dev/null <"${tmp}"
rc=$?
[[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
fi
# the grub default commands silently piss themselves if
# the default file does not exist ahead of time
if [[ ! -e ${dir}/default ]] ; then
# This may fail, don't worry about it.
grub-set-default --root-directory="${boot_dir}" default
:
fi
einfo "Grub has been installed to ${boot_dir} successfully."
}
pkg_postinst() {
mount-boot_pkg_postinst
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."
}
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}"
}

View File

@ -0,0 +1,76 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/grub-static-0.97.ebuild,v 1.8 2012/07/23 03:49:58 vapier Exp $
inherit mount-boot
DESCRIPTION="Static GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/grub-static-${PV}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE=""
DEPEND="!<sys-boot/grub-2"
RDEPEND="${DEPEND}"
src_install() {
cp -a "${WORKDIR}"/* "${D}"/
}
#
# Everything below is directly copied from the grub ebuild
# please try to keep it in sync
#
setup_boot_dir() {
local dir="${1}"
[[ ! -e "${dir}" ]] && die "${dir} does not exist!"
[[ ! -e "${dir}"/grub ]] && mkdir "${dir}/grub"
# change menu.lst to grub.conf
if [[ ! -e "${dir}"/grub/grub.conf ]] && [[ -e "${dir}"/grub/menu.lst ]] ; then
mv -f "${dir}"/grub/menu.lst "${dir}"/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
if [[ ! -e "${dir}"/grub/menu.lst ]]; then
einfo "Linking from new grub.conf name to menu.lst"
ln -snf grub.conf "${dir}"/grub/menu.lst
fi
[[ -e "${dir}"/grub/stage2 ]] && mv "${dir}"/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
for x in /lib*/grub/*/* /usr/lib*/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" "${dir}"/grub/
done
if [[ -e "${dir}"/grub/grub.conf ]] ; then
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${dir}"/grub/grub.conf | \
/sbin/grub --batch \
--device-map="${dir}"/grub/device.map \
> /dev/null
fi
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
[[ -n ${DONT_MOUNT_BOOT} ]] && return 0
setup_boot_dir /boot
einfo "To install grub files to another device (like a usb stick), just run:"
einfo " emerge --config =${PF}"
}
pkg_config() {
local dir
einfo "Enter the directory where you want to setup grub:"
read dir
setup_boot_dir "${dir}"
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>amd64</herd>
</pkgmetadata>