public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-boot/grub: metadata.xml ChangeLog grub-9999.ebuild grub-1.99.ebuild grub-1.99_rc1.ebuild grub-1.98.ebuild
@ 2011-08-27 11:29 Tomas Chvatal (scarabeus)
  0 siblings, 0 replies; only message in thread
From: Tomas Chvatal (scarabeus) @ 2011-08-27 11:29 UTC (permalink / raw
  To: gentoo-commits

scarabeus    11/08/27 11:29:52

  Modified:             metadata.xml ChangeLog grub-9999.ebuild
  Added:                grub-1.99.ebuild
  Removed:              grub-1.99_rc1.ebuild grub-1.98.ebuild
  Log:
  Bump to grub 1.99. Drop older grub2 versions. Take maintainership of grub:2 series.
  
  (Portage version: 2.2.0_alpha51/cvs/Linux x86_64)

Revision  Changes    Path
1.9                  sys-boot/grub/metadata.xml

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?r1=1.8&r2=1.9

Index: metadata.xml
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/metadata.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- metadata.xml	3 Apr 2011 18:18:12 -0000	1.8
+++ metadata.xml	27 Aug 2011 11:29:52 -0000	1.9
@@ -2,8 +2,12 @@
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 <herd>base-system</herd>
+<maintainer restrict="&gt;=sys-boot/grub-1.99">
+	<email>scarabeus@gentoo.org</email>
+	<name>Tomáš Chvátal</name>
+	<description>Grub 2 maintainer</description>
+</maintainer>
 <use>
   <flag name='device-mapper'>Enable support for <pkg>sys-fs/device-mapper</pkg></flag>
-  <flag name='multislot'>Allow grub1 and grub2 to be installed simultaneously</flag>
 </use>
 </pkgmetadata>



1.159                sys-boot/grub/ChangeLog

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.159&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.159&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?r1=1.158&r2=1.159

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- ChangeLog	21 Aug 2011 04:33:07 -0000	1.158
+++ ChangeLog	27 Aug 2011 11:29:52 -0000	1.159
@@ -1,6 +1,15 @@
 # ChangeLog for sys-boot/grub
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.158 2011/08/21 04:33:07 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.159 2011/08/27 11:29:52 scarabeus Exp $
+
+*grub-1.99 (28 Aug 2011)
+
+  28 Aug 2011; Tomáš Chvátal <scarabeus@gentoo.org>
+  -files/grub-1.96-genkernel.patch, -grub-1.98.ebuild, -grub-1.99_rc1.ebuild,
+  +grub-1.99.ebuild, -files/grub-1.99-genkernel.patch, grub-9999.ebuild,
+  +files/grub.default, -files/defaults, metadata.xml:
+  Bump to grub 1.99. Drop older grub2 versions. Take maintainership of grub:2
+  series.
 
   21 Aug 2011; Mike Frysinger <vapier@gentoo.org> grub-1.98.ebuild,
   grub-1.99_rc1.ebuild, grub-9999.ebuild:



1.37                 sys-boot/grub/grub-9999.ebuild

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?rev=1.37&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?rev=1.37&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?r1=1.36&r2=1.37

Index: grub-9999.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- grub-9999.ebuild	21 Aug 2011 04:33:07 -0000	1.36
+++ grub-9999.ebuild	27 Aug 2011 11:29:52 -0000	1.37
@@ -1,31 +1,54 @@
 # Copyright 1999-2011 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.36 2011/08/21 04:33:07 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.37 2011/08/27 11:29:52 scarabeus Exp $
 
-# XXX: need to implement a grub.conf migration in pkg_postinst before we ~arch
-EAPI="2"
-
-inherit mount-boot eutils flag-o-matic toolchain-funcs
+EAPI=4
 
 if [[ ${PV} == "9999" ]] ; then
 	EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
-	inherit autotools bzr
+	LIVE_ECLASS="autotools bzr"
 	SRC_URI=""
 else
-	SRC_URI="ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz
-		mirror://gentoo/${P}.tar.gz"
+	MY_P=${P/_/\~}
+	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+		mirror://gentoo/${MY_P}.tar.xz"
+	S=${WORKDIR}/${MY_P}
 fi
 
+inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS}
+unset LIVE_ECLASS
+
 DESCRIPTION="GNU GRUB boot loader"
 HOMEPAGE="http://www.gnu.org/software/grub/"
 
 LICENSE="GPL-3"
-use multislot && SLOT="2" || SLOT="0"
-KEYWORDS=""
-IUSE="custom-cflags debug device-mapper multislot static sdl truetype"
-
-RDEPEND=">=sys-libs/ncurses-5.2-r5
+SLOT="2"
+[[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~mips ~x86"
+IUSE="custom-cflags debug device-mapper nls static sdl truetype"
+
+GRUB_PLATFORMS="coreboot efi-32 efi-64 emu ieee1275 multiboot pc qemu qemu-mips loongson"
+# everywhere:
+#     emu
+# mips only:
+#     qemu-mips, loongson
+# amd64, x86, ppc, ppc64
+#     ieee1275
+# amd64, x86
+#     coreboot, multiboot, efi-32, pc, qemu
+# amd64
+#     efi-64
+for i in ${GRUB_PLATFORMS}; do
+	IUSE+=" grub_platforms_${i}"
+done
+unset i
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+	dev-libs/libisoburn
 	dev-libs/lzo
+	sys-boot/os-prober
+	>=sys-libs/ncurses-5.2-r5
 	debug? (
 		sdl? ( media-libs/libsdl )
 	)
@@ -33,18 +56,109 @@
 	truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
 DEPEND="${RDEPEND}
 	>=dev-lang/python-2.5.2
+	sys-devel/flex
 	virtual/yacc
-	sys-devel/flex"
-[[ ${PV} == "9999" ]] && DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
+"
+if [[ ${PV} == "9999" ]]; then
+	DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
+else
+	DEPEND+=" app-arch/xz-utils"
+fi
+
+export STRIP_MASK="*/grub*/*/*.{mod,img}"
+QA_EXECSTACK="
+	lib64/grub2/*/setjmp.mod
+	lib64/grub2/*/kernel.img
+	sbin/grub2-probe
+	sbin/grub2-setup
+	sbin/grub2-mkdevicemap
+	bin/grub2-script-check
+	bin/grub2-fstest
+	bin/grub2-mklayout
+	bin/grub2-menulst2cfg
+	bin/grub2-mkrelpath
+	bin/grub2-mkpasswd-pbkdf2
+	bin/grub2-mkfont
+	bin/grub2-editenv
+	bin/grub2-mkimage
+"
+
+grub_run_phase() {
+	local phase=$1
+	local platform=$2
+	[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
+
+	[[ -d "${WORKDIR}/build-${platform}" ]] || \
+		{ mkdir "${WORKDIR}/build-${platform}" || die ; }
+	pushd "${WORKDIR}/build-${platform}" > /dev/null || die
+
+	echo ">>> Running ${phase} for platform \"${platform}\""
+	echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
 
-export STRIP_MASK="*/grub/*/*.mod"
-QA_EXECSTACK="sbin/grub-probe sbin/grub-setup sbin/grub-mkdevicemap bin/grub-script-check bin/grub-fstest"
+	grub_${phase} ${platform}
+
+	popd > /dev/null || die
+}
+
+grub_src_configure() {
+	local platform=$1
+	local target
+
+	[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
+
+	# if we have no platform then --with-platform=guessed does not work
+	[[ ${platform} == "guessed" ]] && platform=""
+
+	# check if we have to specify the target (EFI)
+	# or just append correct --with-platform
+	if [[ -n ${platform} ]]; then
+		if [[ ${platform} == efi* ]]; then
+			# EFI platform hack
+			[[ ${platform/*-} == 32 ]] && target=i386
+			[[ ${platform/*-} == 64 ]] && target=x86_64
+			# program-prefix is required empty because otherwise it is equal to
+			# target variable, which we do not want at all
+			platform="
+				--with-platform=${platform/-*}
+				--target=${target}
+				--program-prefix=
+			"
+		else
+			platform=" --with-platform=${platform}"
+		fi
+	fi
+
+	ECONF_SOURCE="${WORKDIR}/${P}/" \
+	econf \
+		--disable-werror \
+		--sbindir=/sbin \
+		--bindir=/bin \
+		--libdir=/$(get_libdir) \
+		--disable-efiemu \
+		--program-transform-name=s,grub,grub2, \
+		$(use_enable device-mapper) \
+		$(use_enable truetype grub-mkfont) \
+		$(use_enable nls) \
+		$(use_enable debug mm-debug) \
+		$(use sdl && use_enable debug grub-emu-sdl) \
+		$(use_enable debug grub-emu-usb) \
+		${platform}
+}
+
+grub_src_compile() {
+	default_src_compile
+}
+
+grub_src_install() {
+	default_src_install
+}
 
 src_prepare() {
+	local i j archs
+
 	epatch_user
 
 	# autogen.sh does more than just run autotools
-	# need to eautomake due to weirdness #296013
 	if [[ ${PV} == "9999" ]] ; then
 		sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
 		(. ./autogen.sh) || die
@@ -54,72 +168,95 @@
 	sed -i \
 		-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
 		util/bash-completion.d/Makefile.in || die
+
+	# get enabled platforms
+	GRUB_ENABLED_PLATFORMS=""
+	for i in ${GRUB_PLATFORMS}; do
+		use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
+	done
+	[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
+	einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
 }
 
 src_configure() {
+	local i
+
 	use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
 	use static && append-ldflags -static
 
-	econf \
-		--disable-werror \
-		--sbindir=/sbin \
-		--bindir=/bin \
-		--libdir=/$(get_libdir) \
-		--disable-efiemu \
-		$(use_enable device-mapper) \
-		$(use_enable truetype grub-mkfont) \
-		$(use_enable debug mm-debug) \
-		$(use sdl && use_enable debug grub-emu-sdl) \
-		$(use_enable debug grub-emu-usb)
+	for i in ${GRUB_ENABLED_PLATFORMS}; do
+		grub_run_phase ${FUNCNAME} ${i}
+	done
 }
 
 src_compile() {
-	emake -j1 || die
+	local i
+
+	for i in ${GRUB_ENABLED_PLATFORMS}; do
+		grub_run_phase ${FUNCNAME} ${i}
+	done
 }
 
 src_install() {
-	emake DESTDIR="${D}" install || die
-	dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+	local i
 
-	insinto /etc/defaults
-	doins "${FILESDIR}"/defaults || die
-	cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib
-	GRUB_DISTRIBUTOR="Gentoo"
-	EOF
+	for i in ${GRUB_ENABLED_PLATFORMS}; do
+		grub_run_phase ${FUNCNAME} ${i}
+	done
 
-	if use multislot ; then
-		sed -i "s:grub-install:grub2-install:" "${D}"/sbin/grub-install || die
-		mv "${D}"/sbin/grub{,2}-install || die
-		mv "${D}"/sbin/grub{,2}-set-default || die
-		mv "${D}"/usr/share/man/man8/grub{,2}-install.8 || die
-		mv "${D}"/usr/share/info/grub{,2}.info || die
-	fi
+	# slot all collisions with grub legacy
+	mv "${ED}"/usr/share/info/grub.info \
+		"${ED}"/usr/share/info/grub2.info || die
+
+	# can't be in docs array as we use defualt_src_install in different builddir
+	dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+	insinto /etc/default
+	newins "${FILESDIR}"/grub.default grub
+	cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib
+	GRUB_DISTRIBUTOR="Gentoo"
+EOF
 }
 
 setup_boot_dir() {
-	local boot_dir=$1
-	local dir=${boot_dir}/grub
+	local dir=$1
 
-	if [[ ! -e ${dir}/grub.cfg ]] ; then
-		einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'"
-		grub-mkconfig -o "${dir}/grub.cfg"
+	# display the link to guide if user didn't set up anything yet.
+	elog "For informations how to configure grub-2 please reffer to the guide:"
+	elog "    http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
+
+	if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then
+		# This is first grub2 install and we have old configuraton for
+		# grub1 around. Lets try to generate grub.cfg from it so user
+		# does not loose any stuff when rebooting.
+		# NOTE: in long term he still NEEDS to migrate to grub.d stuff.
+		einfo "Running: grub2-menulst2cfg '${dir/2/}/menu.lst' '${dir}/grub.cfg'"
+		grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \
+			ewarn "Running grub2-menulst2cfg failed!"
+
+		einfo "Even if we just created configuration for your grub2 using old"
+		einfo "grub-legacy configuration file you should migrate to use new style"
+		einfo "configuration in '${ROOT}/etc/grub.d'."
+		einfo
+
+	else
+		# we need to refresh the grub.cfg everytime just to play it safe
+		einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'"
+		grub2-mkconfig -o "${dir}/grub.cfg" || \
+			ewarn "Running grub2-mkconfig failed! Check your configuration files!"
 	fi
 
-	#local install=grub-install
-	#use multislot && install="grub2-install --grub-setup=/bin/true"
-	#einfo "Running: ${install} "
-	#${install}
+	elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time"
+	elog "you update the configuration files!"
+
+	elog "Remember to run grub2-install to install your grub every time"
+	elog "you update this package!"
 }
 
 pkg_postinst() {
 	mount-boot_mount_boot_partition
 
-	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
+	setup_boot_dir "${ROOT}"boot/grub2
 
-	# needs to be after we call setup_boot_dir
+	# needs to be called after we call setup_boot_dir
 	mount-boot_pkg_postinst
 }



1.1                  sys-boot/grub/grub-1.99.ebuild

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-1.99.ebuild?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-1.99.ebuild?rev=1.1&content-type=text/plain

Index: grub-1.99.ebuild
===================================================================
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.99.ebuild,v 1.1 2011/08/27 11:29:52 scarabeus Exp $

EAPI=4

if [[ ${PV} == "9999" ]] ; then
	EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
	LIVE_ECLASS="autotools bzr"
	SRC_URI=""
else
	MY_P=${P/_/\~}
	SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
		mirror://gentoo/${MY_P}.tar.xz"
	S=${WORKDIR}/${MY_P}
fi

inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS}
unset LIVE_ECLASS

DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"

LICENSE="GPL-3"
SLOT="2"
[[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~mips ~x86"
IUSE="custom-cflags debug device-mapper nls static sdl truetype"

GRUB_PLATFORMS="coreboot efi-32 efi-64 emu ieee1275 multiboot pc qemu qemu-mips yeeloong"
# everywhere:
#     emu
# mips only:
#     qemu-mips, yeeloong
# amd64, x86, ppc, ppc64
#     ieee1275
# amd64, x86
#     coreboot, multiboot, efi-32, pc, qemu
# amd64
#     efi-64
for i in ${GRUB_PLATFORMS}; do
	IUSE+=" grub_platforms_${i}"
done
unset i

# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
	dev-libs/libisoburn
	dev-libs/lzo
	sys-boot/os-prober
	>=sys-libs/ncurses-5.2-r5
	debug? (
		sdl? ( media-libs/libsdl )
	)
	device-mapper? ( >=sys-fs/lvm2-2.02.45 )
	truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
DEPEND="${RDEPEND}
	>=dev-lang/python-2.5.2
	sys-devel/flex
	virtual/yacc
"
if [[ ${PV} == "9999" ]]; then
	DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
else
	DEPEND+=" app-arch/xz-utils"
fi

export STRIP_MASK="*/grub*/*/*.{mod,img}"
QA_EXECSTACK="
	lib64/grub2/*/setjmp.mod
	lib64/grub2/*/kernel.img
	sbin/grub2-probe
	sbin/grub2-setup
	sbin/grub2-mkdevicemap
	bin/grub2-script-check
	bin/grub2-fstest
	bin/grub2-mklayout
	bin/grub2-menulst2cfg
	bin/grub2-mkrelpath
	bin/grub2-mkpasswd-pbkdf2
	bin/grub2-mkfont
	bin/grub2-editenv
	bin/grub2-mkimage
"

grub_run_phase() {
	local phase=$1
	local platform=$2
	[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"

	[[ -d "${WORKDIR}/build-${platform}" ]] || \
		{ mkdir "${WORKDIR}/build-${platform}" || die ; }
	pushd "${WORKDIR}/build-${platform}" > /dev/null || die

	echo ">>> Running ${phase} for platform \"${platform}\""
	echo ">>> Working in: \"${WORKDIR}/build-${platform}\""

	grub_${phase} ${platform}

	popd > /dev/null || die
}

grub_src_configure() {
	local platform=$1
	local target

	[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"

	# if we have no platform then --with-platform=guessed does not work
	[[ ${platform} == "guessed" ]] && platform=""

	# check if we have to specify the target (EFI)
	# or just append correct --with-platform
	if [[ -n ${platform} ]]; then
		if [[ ${platform} == efi* ]]; then
			# EFI platform hack
			[[ ${platform/*-} == 32 ]] && target=i386
			[[ ${platform/*-} == 64 ]] && target=x86_64
			# program-prefix is required empty because otherwise it is equal to
			# target variable, which we do not want at all
			platform="
				--with-platform=${platform/-*}
				--target=${target}
				--program-prefix=
			"
		else
			platform=" --with-platform=${platform}"
		fi
	fi

	ECONF_SOURCE="${WORKDIR}/${P}/" \
	econf \
		--disable-werror \
		--sbindir=/sbin \
		--bindir=/bin \
		--libdir=/$(get_libdir) \
		--disable-efiemu \
		--program-transform-name=s,grub,grub2, \
		$(use_enable device-mapper) \
		$(use_enable truetype grub-mkfont) \
		$(use_enable nls) \
		$(use_enable debug mm-debug) \
		$(use sdl && use_enable debug grub-emu-sdl) \
		$(use_enable debug grub-emu-usb) \
		${platform}
}

grub_src_compile() {
	default_src_compile
}

grub_src_install() {
	default_src_install
}

src_prepare() {
	local i j archs

	epatch_user

	# autogen.sh does more than just run autotools
	if [[ ${PV} == "9999" ]] ; then
		sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
		(. ./autogen.sh) || die
	fi

	# install into the right dir for eselect #372735
	sed -i \
		-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
		util/bash-completion.d/Makefile.in || die

	# get enabled platforms
	GRUB_ENABLED_PLATFORMS=""
	for i in ${GRUB_PLATFORMS}; do
		use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
	done
	[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
	einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
}

src_configure() {
	local i

	use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
	use static && append-ldflags -static

	for i in ${GRUB_ENABLED_PLATFORMS}; do
		grub_run_phase ${FUNCNAME} ${i}
	done
}

src_compile() {
	local i

	for i in ${GRUB_ENABLED_PLATFORMS}; do
		grub_run_phase ${FUNCNAME} ${i}
	done
}

src_install() {
	local i

	for i in ${GRUB_ENABLED_PLATFORMS}; do
		grub_run_phase ${FUNCNAME} ${i}
	done

	# slot all collisions with grub legacy
	mv "${ED}"/usr/share/info/grub.info \
		"${ED}"/usr/share/info/grub2.info || die

	# can't be in docs array as we use defualt_src_install in different builddir
	dodoc AUTHORS ChangeLog NEWS README THANKS TODO
	insinto /etc/default
	newins "${FILESDIR}"/grub.default grub
	cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib
	GRUB_DISTRIBUTOR="Gentoo"
EOF
}

setup_boot_dir() {
	local dir=$1

	# display the link to guide if user didn't set up anything yet.
	elog "For informations how to configure grub-2 please reffer to the guide:"
	elog "    http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"

	if [[ ! -e ${dir}/grub.cfg && -e ${dir/2/}/menu.lst ]] ; then
		# This is first grub2 install and we have old configuraton for
		# grub1 around. Lets try to generate grub.cfg from it so user
		# does not loose any stuff when rebooting.
		# NOTE: in long term he still NEEDS to migrate to grub.d stuff.
		einfo "Running: grub2-menulst2cfg '${dir/2/}/menu.lst' '${dir}/grub.cfg'"
		grub2-menulst2cfg "${dir/2/}/menu.lst" "${dir}/grub.cfg" || \
			ewarn "Running grub2-menulst2cfg failed!"

		einfo "Even if we just created configuration for your grub2 using old"
		einfo "grub-legacy configuration file you should migrate to use new style"
		einfo "configuration in '${ROOT}/etc/grub.d'."
		einfo

	else
		# we need to refresh the grub.cfg everytime just to play it safe
		einfo "Running: grub2-mkconfig -o '${dir}/grub.cfg'"
		grub2-mkconfig -o "${dir}/grub.cfg" || \
			ewarn "Running grub2-mkconfig failed! Check your configuration files!"
	fi

	elog "Remember to run \"grub2-mkconfig -o '${dir}/grub.cfg'\" every time"
	elog "you update the configuration files!"

	elog "Remember to run grub2-install to install your grub every time"
	elog "you update this package!"
}

pkg_postinst() {
	mount-boot_mount_boot_partition

	setup_boot_dir "${ROOT}"boot/grub2

	# needs to be called after we call setup_boot_dir
	mount-boot_pkg_postinst
}






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-27 11:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-27 11:29 [gentoo-commits] gentoo-x86 commit in sys-boot/grub: metadata.xml ChangeLog grub-9999.ebuild grub-1.99.ebuild grub-1.99_rc1.ebuild grub-1.98.ebuild Tomas Chvatal (scarabeus)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox