summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-boot/grub-static
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-boot/grub-static')
-rw-r--r--sys-boot/grub-static/Manifest6
-rw-r--r--sys-boot/grub-static/grub-static-0.96-r1.ebuild18
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r10.ebuild176
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r12.ebuild180
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r6.ebuild136
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r9.ebuild172
-rw-r--r--sys-boot/grub-static/grub-static-0.97.ebuild76
-rw-r--r--sys-boot/grub-static/metadata.xml5
8 files changed, 769 insertions, 0 deletions
diff --git a/sys-boot/grub-static/Manifest b/sys-boot/grub-static/Manifest
new file mode 100644
index 000000000000..4e729b6f006e
--- /dev/null
+++ b/sys-boot/grub-static/Manifest
@@ -0,0 +1,6 @@
+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
diff --git a/sys-boot/grub-static/grub-static-0.96-r1.ebuild b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
new file mode 100644
index 000000000000..837694657ecf
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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}"/
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r10.ebuild b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
new file mode 100644
index 000000000000..407ca8c02c89
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# 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}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r12.ebuild b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
new file mode 100644
index 000000000000..f8dcfe748704
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# 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}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r6.ebuild b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
new file mode 100644
index 000000000000..72d86f0906f3
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# 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}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r9.ebuild b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
new file mode 100644
index 000000000000..4212c0759685
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# 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}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97.ebuild b/sys-boot/grub-static/grub-static-0.97.ebuild
new file mode 100644
index 000000000000..4a40ffa9785b
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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}"
+}
diff --git a/sys-boot/grub-static/metadata.xml b/sys-boot/grub-static/metadata.xml
new file mode 100644
index 000000000000..96677fad3cfb
--- /dev/null
+++ b/sys-boot/grub-static/metadata.xml
@@ -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>