summaryrefslogtreecommitdiff
path: root/sys-boot/grub-static
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-boot/grub-static
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-boot/grub-static')
-rw-r--r--sys-boot/grub-static/Manifest15
-rw-r--r--sys-boot/grub-static/grub-static-0.96-r1.ebuild17
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r10.ebuild175
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r12.ebuild179
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r6.ebuild135
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r9.ebuild171
-rw-r--r--sys-boot/grub-static/grub-static-0.97.ebuild75
-rw-r--r--sys-boot/grub-static/metadata.xml8
8 files changed, 775 insertions, 0 deletions
diff --git a/sys-boot/grub-static/Manifest b/sys-boot/grub-static/Manifest
new file mode 100644
index 000000000000..dfe6c8c2a764
--- /dev/null
+++ b/sys-boot/grub-static/Manifest
@@ -0,0 +1,15 @@
+DIST grub-static-0.96.tar.bz2 859179 SHA256 3ece8910e7954ca2c2cbebc4d05cfb22e73455f826508661a5b1a60481dcbd76 SHA512 a623e230c3b2dd632daf65d897261a8b28a609b1adcfba67661cb42f43fe4f06bb4746f5095b41b689c2725f9d3379d03d02bca21b4acbf5faa3dccbad160a27 WHIRLPOOL 445acdfa2b1dfb0d15fc927a65f36ad8f956ea5d2b977695cdb25eef4c04c52686b8bf9278509291d3371bc02630e9a878b6f681a82d6e80f04a0f805316385f
+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 SHA512 a6edc311bcfccdb937c10ca1b4d33ecff52f3ee03ad827ecc849f6bb7d88204bcd29e8b7691bc1c0fd6386ed074ab8817667c0cf25cbb64bdd900fb01338727c WHIRLPOOL 05ea2865a7a48a4bfb8efb31e4420d27c4b0886611b19847440174311a8df18c79d5bd13ce14a93bc4d5d0dd473c82fa1bbc0d54b11fb3c717d63423e67b8d5a
+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 SHA512 e60b1384e60bc1261482f3bc41b98c1595d4377da68b251d93894ae7a1b3b2ca77219ca9b7685d1cc8db950e35afb1b403cb3e9b7df15e0ab96d452341547668 WHIRLPOOL d64f5f98c356848345d8d2c4d381e5027b4214048fd0e5170c94d67ae0f784b1702efaac318bcc6a4b4d2e0419b327ea92bab4d9c148cf71f97ae8bda1d504d2
+EBUILD grub-static-0.96-r1.ebuild 403 SHA256 1b3b5f6eb1d77f30d34fd8466767005abc298c820bc73c14acea008c5ace43c1 SHA512 4a49523d4e47cfbc7228a7b6ed802f190c045abbcf8749580615bdc59233c7a029943e55bae7adf690628a5081b157690d694c8f40926b79d49f645c15781df5 WHIRLPOOL d0690373447a3636966096324158ae24d04374542d94f0a31dd462b0aac7a2ec4b7fc8b7f064752f8d9e39f677210df211a011ffeb3abe212eaa17e8cbf74ab2
+EBUILD grub-static-0.97-r10.ebuild 5394 SHA256 37165e08bf26cd45038017d786efc080bb2e57056d008a5c3992f48299534e31 SHA512 fbc1fc21e85058008d6dfd6b71cba957ca94500474f95e29ed796fac9c9586971145433e8448a3709258fc7bd755a0f936822029f38435c9e39275a82b5162c3 WHIRLPOOL 4e1e9d05ae3f55597b49f20589b98eb84034254eeb8a9f456f1e2e5dcd6958a447bcc2bddbfbaa5b0c76c95b1ec8a8e6a759ec8a8888d0b2903ce3d5d537afd5
+EBUILD grub-static-0.97-r12.ebuild 5394 SHA256 8560911657316197d8bc08367a27b6c1c09d1b7b5b5b4d3189d9e8b4dd51aa12 SHA512 aca73438cf8a7e6760fcd340568b5f0847887eeec229e6b4b470252a95668ad9615be4a60eb33976b2b2cb7347b5595979238c4ccfb2dd5253fd4b78ac756c58 WHIRLPOOL 9c2ce66902399d58cb73147ed02ae5406e2483ed7d17994181d7bed2d423a9b4df3f22d16cea84b1da13b40c6b4e5a9553a86672b6baa1ebe47883368ed0ae16
+EBUILD grub-static-0.97-r6.ebuild 4324 SHA256 afdf7af1593da987ec930a286ad5ed727466d9b51881d452852a6102070d9955 SHA512 3ea6d41fa12d38b0580c1440a25e7ed5a23ac963ccc2746856e7b793186cc14b5d43071e6e338635dcf6bcc8286c73642538557d103eb052349b223aaa2a44b9 WHIRLPOOL 552c72bfefb7c53efab97f6c4a9b609ddcd0b62efbf50158ed15b21e63b5ad76db23e9e4c708f659bad3405db827a5fdc8358fcbfdc796fc059368bfdc74b2ad
+EBUILD grub-static-0.97-r9.ebuild 5289 SHA256 276c7bf803b73efe5c72a83207f2bec0d8b50eb677660f82cc47291efe0100ec SHA512 28be3fc41a6ad107d9a84549e8c49c1a61bf97b0b91ec6613c16434fa00d29fd9ba526eee3aa4c4486f585ddc488331071326ee22cc0b145b97c31b123855726 WHIRLPOOL 572805e671a487676581f080ee9f2bd99246a0944572f52947b83384a45a6e283c20c9a06ef7faa4fd15aeb01d7e008c0856abbc64838ba36157946a97f83ea8
+EBUILD grub-static-0.97.ebuild 1917 SHA256 e739816e2b52ea7a85386b68752496c8cdcfe500dfbb3907f59447fa9295c735 SHA512 64162d6c64e30f555d9bc642a416468911d960ce398f66bc6b36c0319f484dc516d95462ff13f83dab5e16cb75d3e69fff180ef1d1bdc5bd387706da5b197889 WHIRLPOOL 81f6f1db99ab03e8fe26e5fc7b288a113dbf1971ef990fb4f1fbc771b1a746e83d704b0b1e868db025c2c11b703e0fbbea51e427c9f4a6507556315ec5d788f0
+MISC ChangeLog 3188 SHA256 2048117ed63e0c7798841bb5b1ce2d7f50e6eba4703a0d0358c9fee377fe8321 SHA512 1131a8fe641f724a2710b905345d4c0548f6eafce5e50d87b4a37eb49ac4f3f332cf9c909e99caa1ff96a09175aab7963c9541b27c45d38b0a80e999e3efb6dc WHIRLPOOL 96deecaa48bba99425a8b5c7e65798b1d46690936da2f689149bd9b50ef85dd49ed97bdf7fa4f1485133a7a6010df55ba5a304d0696dac3395aa221a0fc20b24
+MISC ChangeLog-2015 5551 SHA256 fd373c083a05ef17a5074741d41801878c868780888a079f7fc200085e2cd90f SHA512 524d7b8cf0fe52981a189151d8be58aa545b36b8938378944aa6d29aaa717b07f449155e44a5a54025292162f72cd7562408808966b88970929826166e54af52 WHIRLPOOL d35df4dfea54ce55500d840f48e21b0a6fadb0f0521108e45849a8354b0bad5528afc635f0e149c2f27dd4dea308f4318b9c1bc322a6d2c88d5bb811b486c07e
+MISC metadata.xml 242 SHA256 aaef542427fe08d52a644c49a357a723fd550a8568e8ffb41aa655e36e0642f2 SHA512 0891a67242a0cd36cac143b427affa9241ec8f8173b79423632349d542f9bc6e2097ffbb8e96b560c41e13b5b43ddf0f822962da98b5d2e58068d7855acb4965 WHIRLPOOL e5a99a2a99090a4826c638ef55a5b813d33e6957c8150142bc14965d72f14aa11bc018d3f35406f9c6917531145e7401aad3661ed5745f57b2fe4df2af38840f
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..5e83aac12082
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="https://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..680b5c2e9d45
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..3923c82a2a05
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..c55d1f53800e
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..d5788c08c0a2
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..f5379a8a95c8
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit mount-boot
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="https://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..0c723031cff1
--- /dev/null
+++ b/sys-boot/grub-static/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>amd64@gentoo.org</email>
+ <name>AMD64 Project</name>
+</maintainer>
+</pkgmetadata>