summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-30 11:35:54 +0000
committerMike Frysinger <vapier@gentoo.org>2008-12-30 11:35:54 +0000
commitf927ee6a60aab7310b07d664d8ab3efbbd6d0174 (patch)
tree27e283287fd9419d506bc43fd9e5b2807ab05ce5 /sys-boot
parentGet ready for xulrunner 1.9.1, patch spotted by loki_val (diff)
downloadgentoo-2-f927ee6a60aab7310b07d664d8ab3efbbd6d0174.tar.gz
gentoo-2-f927ee6a60aab7310b07d664d8ab3efbbd6d0174.tar.bz2
gentoo-2-f927ee6a60aab7310b07d664d8ab3efbbd6d0174.zip
Fix install paths and add support for USE=multislot so people can toy with grub2 while keeping grub1.
(Portage version: 2.2_rc20/cvs/Linux 2.6.28 x86_64)
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/grub/ChangeLog7
-rw-r--r--sys-boot/grub/grub-1.96.ebuild39
-rw-r--r--sys-boot/grub/grub-9999.ebuild39
-rw-r--r--sys-boot/grub/metadata.xml1
4 files changed, 71 insertions, 15 deletions
diff --git a/sys-boot/grub/ChangeLog b/sys-boot/grub/ChangeLog
index 6bb7d7eac97a..390ba4df7a2e 100644
--- a/sys-boot/grub/ChangeLog
+++ b/sys-boot/grub/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-boot/grub
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.107 2008/12/30 02:18:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.108 2008/12/30 11:35:54 vapier Exp $
+
+ 30 Dec 2008; Mike Frysinger <vapier@gentoo.org> metadata.xml,
+ grub-1.96.ebuild, grub-9999.ebuild:
+ Fix install paths and add support for USE=multislot so people can toy with
+ grub2 while keeping grub1.
30 Dec 2008; Mike Frysinger <vapier@gentoo.org> grub-1.96.ebuild,
grub-9999.ebuild:
diff --git a/sys-boot/grub/grub-1.96.ebuild b/sys-boot/grub/grub-1.96.ebuild
index 3fc7686a570a..1ccfb8e38ddd 100644
--- a/sys-boot/grub/grub-1.96.ebuild
+++ b/sys-boot/grub/grub-1.96.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.96.ebuild,v 1.7 2008/12/30 02:18:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.96.ebuild,v 1.8 2008/12/30 11:35:54 vapier Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
@@ -17,15 +17,16 @@ DESCRIPTION="GNU GRUB 2 boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-2"
-SLOT="0"
+use multislot && SLOT="2" || SLOT="0"
KEYWORDS=""
-IUSE="static custom-cflags"
+IUSE="custom-cflags multislot static"
DEPEND=">=sys-libs/ncurses-5.2-r5
dev-libs/lzo"
PROVIDE="virtual/bootloader"
STRIP_MASK="/lib*/grub/*/*.mod"
+QA_EXECSTACK="sbin/grub-probe sbin/grub-setup"
src_compile() {
use amd64 && multilib_toolchain_setup x86
@@ -33,8 +34,9 @@ src_compile() {
use static && append-ldflags -static
econf \
- --prefix=/ \
- --datadir=/usr/lib \
+ --sbindir=/sbin \
+ --bindir=/bin \
+ --libdir=/$(get_libdir) \
|| die "econf failed"
emake -j1 || die "making regular stuff"
}
@@ -42,9 +44,32 @@ src_compile() {
src_install() {
emake DESTDIR="${D}" install || die
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+ if use multislot ; then
+ sed -i s:grub-install:grub2-install: "${D}"/sbin/grub-install
+ mv "${D}"/sbin/grub{,2}-install || die
+ mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
+ fi
+}
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}/grub
+
+ if [[ ! -e ${dir}/grub.cfg ]] ; then
+ einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
+ grub-mkconfig -o "${dir}/grub.cfg"
+ fi
+
+ #local install=grub-install
+ #use multislot && install="grub2-install --grub-setup=/bin/true"
+ #einfo "Running: ${install} "
+ #${install}
}
pkg_postinst() {
- elog "To automatically generate a grub configuration file:"
- elog "# /sbin/grub-mkconfig -o /boot/grub/grub.cfg"
+ if use multislot ; then
+ elog "You have installed grub2 with USE=multislot, so to coexist"
+ elog "with grub1, the grub2 install binary is named grub2-install."
+ fi
+ setup_boot_dir "${ROOT}"boot
}
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild
index 2c62773b4ec8..51b9a4a11d75 100644
--- a/sys-boot/grub/grub-9999.ebuild
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.2 2008/12/30 02:18:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.3 2008/12/30 11:35:54 vapier Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
@@ -17,15 +17,16 @@ DESCRIPTION="GNU GRUB 2 boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-2"
-SLOT="0"
+use multislot && SLOT="2" || SLOT="0"
KEYWORDS=""
-IUSE="static custom-cflags"
+IUSE="custom-cflags multislot static"
DEPEND=">=sys-libs/ncurses-5.2-r5
dev-libs/lzo"
PROVIDE="virtual/bootloader"
STRIP_MASK="/lib*/grub/*/*.mod"
+QA_EXECSTACK="sbin/grub-probe sbin/grub-setup"
src_compile() {
use amd64 && multilib_toolchain_setup x86
@@ -33,8 +34,9 @@ src_compile() {
use static && append-ldflags -static
econf \
- --prefix=/ \
- --datadir=/usr/lib \
+ --sbindir=/sbin \
+ --bindir=/bin \
+ --libdir=/$(get_libdir) \
|| die "econf failed"
emake -j1 || die "making regular stuff"
}
@@ -42,9 +44,32 @@ src_compile() {
src_install() {
emake DESTDIR="${D}" install || die
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+ if use multislot ; then
+ sed -i s:grub-install:grub2-install: "${D}"/sbin/grub-install
+ mv "${D}"/sbin/grub{,2}-install || die
+ mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
+ fi
+}
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}/grub
+
+ if [[ ! -e ${dir}/grub.cfg ]] ; then
+ einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
+ grub-mkconfig -o "${dir}/grub.cfg"
+ fi
+
+ #local install=grub-install
+ #use multislot && install="grub2-install --grub-setup=/bin/true"
+ #einfo "Running: ${install} "
+ #${install}
}
pkg_postinst() {
- elog "To automatically generate a grub configuration file:"
- elog "# /sbin/grub-mkconfig -o /boot/grub/grub.cfg"
+ if use multislot ; then
+ elog "You have installed grub2 with USE=multislot, so to coexist"
+ elog "with grub1, the grub2 install binary is named grub2-install."
+ fi
+ setup_boot_dir "${ROOT}"boot
}
diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml
index 6a65231a2cf2..410891a6f015 100644
--- a/sys-boot/grub/metadata.xml
+++ b/sys-boot/grub/metadata.xml
@@ -4,5 +4,6 @@
<herd>base-system</herd>
<use>
<flag name='custom-cflags'>Enable custom CFLAGS (not supported)</flag>
+ <flag name='multislot'>Allow grub1 and grub2 to be installed simultaneously</flag>
</use>
</pkgmetadata>