From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QLaj1-0002qs-TJ for garchives@archives.gentoo.org; Sun, 15 May 2011 12:47:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B1EA61C022; Sun, 15 May 2011 12:47:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5C0F21C022 for ; Sun, 15 May 2011 12:47:03 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BB68D1B4005 for ; Sun, 15 May 2011 12:47:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 00FDB80504 for ; Sun, 15 May 2011 12:47:02 +0000 (UTC) From: "Tomas Chvatal" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tomas Chvatal" Message-ID: <524abd91dc3dfc13977dffee87e09a1c233055f1.scarabeus@gentoo> Subject: [gentoo-commits] dev/scarabeus:master commit in: sys-boot/grub/ X-VCS-Repository: dev/scarabeus X-VCS-Files: sys-boot/grub/Manifest sys-boot/grub/grub-1.99.ebuild sys-boot/grub/grub-9999.ebuild sys-boot/grub/metadata.xml X-VCS-Directories: sys-boot/grub/ X-VCS-Committer: scarabeus X-VCS-Committer-Name: Tomas Chvatal X-VCS-Revision: 524abd91dc3dfc13977dffee87e09a1c233055f1 Date: Sun, 15 May 2011 12:47:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 7099cc361d098f5d2ff5503f3f4e41a0 commit: 524abd91dc3dfc13977dffee87e09a1c233055f1 Author: Tomas Chvatal gentoo org> AuthorDate: Sun May 15 12:46:49 2011 +0000 Commit: Tomas Chvatal gentoo org> CommitDate: Sun May 15 12:46:49 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/scarabeus.git;= a=3Dcommit;h=3D524abd91 [sys-boot/grub] Add my version of grub2. --- sys-boot/grub/Manifest | 4 + sys-boot/grub/grub-1.99.ebuild | 137 ++++++++++++++++++++++++++++++++++= ++++++ sys-boot/grub/grub-9999.ebuild | 137 ++++++++++++++++++++++++++++++++++= ++++++ sys-boot/grub/metadata.xml | 9 +++ 4 files changed, 287 insertions(+), 0 deletions(-) diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest new file mode 100644 index 0000000..1f1fdcf --- /dev/null +++ b/sys-boot/grub/Manifest @@ -0,0 +1,4 @@ +DIST grub-1.99.tar.xz 2639224 RMD160 d59a47fa40b2be0d5ea5b2b00ff5538cfa1= 47747 SHA1 a5ae9558f30ce7757a76aa130088b053a87e2fb6 SHA256 f308148d4c83c6= f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b +EBUILD grub-1.99.ebuild 3727 RMD160 76994633ddc444cde38a2ac41a13fe6a5362= ac74 SHA1 4c74a17f01716a272dcff339ef4e4526879db957 SHA256 00a3165b63901a0= 9990470ee2d62541250c23d5e3a88a59c3958d39d6effd2a5 +EBUILD grub-9999.ebuild 3716 RMD160 ad966e0da4664a4f062240d069e9aa3169c1= a47e SHA1 d5b68443369e354efa56c4d444cf640a829816cb SHA256 2565f1e432d61ba= 7fd55531f969b742daeeb9e04c193d813ab403370dfff35e5 +MISC metadata.xml 349 RMD160 8e5ecd3c757f94fbccafc8120f4c8a04567135b4 SH= A1 3ff0251dbb2863c4fbf0913b901bc27ed73a1acd SHA256 fcb983296ee15683397726= 68bcf236db0a24aabba6c328343d7bdb790978cbb9 diff --git a/sys-boot/grub/grub-1.99.ebuild b/sys-boot/grub/grub-1.99.ebu= ild new file mode 100644 index 0000000..81b2545 --- /dev/null +++ b/sys-boot/grub/grub-1.99.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# FIXME: somehow depend on python-2 only; using python eclass maybe? +# NOTE: good idea would be to move grub-2 to new package called grub2 + +EAPI=3D4 + +if [[ ${PV} =3D=3D "9999" ]] ; then + EBZR_REPO_URI=3D"http://bzr.savannah.gnu.org/r/grub/trunk/grub/" + LIVE_ECLASS=3D"autotools bzr" + SRC_URI=3D"" +else + MY_P=3D${P/_/\~} + SRC_URI=3D"mirror://gnu/${PN}/${MY_P}.tar.xz + mirror://gentoo/${MY_P}.tar.xz" + S=3D${WORKDIR}/${MY_P} +fi + +inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS} +unset LIVE_ECLASS + +DESCRIPTION=3D"GNU GRUB boot loader" +HOMEPAGE=3D"http://www.gnu.org/software/grub/" + +LICENSE=3D"GPL-3" +SLOT=3D"0" +KEYWORDS=3D"~amd64 ~x86" +IUSE=3D"custom-cflags debug device-mapper static sdl truetype" + +RDEPEND=3D">=3Dsys-libs/ncurses-5.2-r5 + dev-libs/lzo + debug? ( + sdl? ( media-libs/libsdl ) + ) + device-mapper? ( >=3Dsys-fs/lvm2-2.02.45 ) + truetype? ( media-libs/freetype >=3Dmedia-fonts/unifont-5 )" +DEPEND=3D"${RDEPEND} + >=3Ddev-lang/python-2.5.2 +" +if [[ ${PV} =3D=3D "9999" ]]; then + DEPEND+=3D" >=3Dsys-devel/autogen-5.10 sys-apps/help2man" +else + DEPEND+=3D" app-arch/xz-utils" +fi + +export STRIP_MASK=3D"*/grub/*/*.mod" +QA_EXECSTACK=3D" + sbin/grub-probe + sbin/grub-setup + sbin/grub-mkdevicemap + bin/grub-script-check + bin/grub-fstest +" + +DOCS=3D( AUTHORS ChangeLog NEWS README THANKS TODO ) + +src_prepare() { + epatch_user + + # autogen.sh does more than just run autotools + if [[ ${PV} =3D=3D "9999" ]] ; then + sed -i -e '/^autoreconf/s:^:e:' autogen.sh || die + (. ./autogen.sh) || die + fi +} + +src_configure() { + use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS + use static && append-ldflags -static + + econf \ + --disable-werror \ + --sbindir=3D/sbin \ + --bindir=3D/bin \ + --libdir=3D/$(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) +} + +src_install() { + default + + insinto /etc/default + newins "${FILESDIR}"/defaults grub + cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib + GRUB_DISTRIBUTOR=3D"Gentoo" +EOF +} + +setup_boot_dir() { + local dir=3D$1 + + if [[ ! -e ${dir}/grub.cfg ]]; then + # display the link to guide if user didn't set up anything yet. + elog "For informations how to configure grub-2 please reffer to guide:= " + # FIXME: we don't have any guide yet! + # Lets just use archlinux wiki until we have some. + elog " https://wiki.archlinux.org/index.php/GRUB2" + fi + + if [[ ! -e ${dir}/grub.cfg && -e ${dir}/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: grub-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" + grub-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ + ewarn "Running grub-menulst2cfg failed!" + + einfo "Even if we just created configuration for your grub-2 using old= " + einfo "grub-1 configuration file you should migrate to use new style" + einfo "configuration in '${ROOT}/etc/grub.d'." + else + # we need to refresh the grub.cfg everytime just to play it safe + einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'" + grub-mkconfig -o "${dir}/grub.cfg" || \ + ewarn "Running grub-mkconfig failed! Check your configuration files!" + fi + + elog "Remember to run \"grub-mkconfig -o '${dir}/grub.cfg'\" every time= " + elog "you update the configuration files." +} + +pkg_postinst() { + mount-boot_mount_boot_partition + + setup_boot_dir "${ROOT}"boot/grub + + # needs to be called after we call setup_boot_dir + mount-boot_pkg_postinst +} diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebu= ild new file mode 100644 index 0000000..913e512 --- /dev/null +++ b/sys-boot/grub/grub-9999.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# FIXME: somehow depend on python-2 only; using python eclass maybe? +# NOTE: good idea would be to move grub-2 to new package called grub2 + +EAPI=3D4 + +if [[ ${PV} =3D=3D "9999" ]] ; then + EBZR_REPO_URI=3D"http://bzr.savannah.gnu.org/r/grub/trunk/grub/" + LIVE_ECLASS=3D"autotools bzr" + SRC_URI=3D"" +else + MY_P=3D${P/_/\~} + SRC_URI=3D"mirror://gnu/${PN}/${MY_P}.tar.xz + mirror://gentoo/${MY_P}.tar.xz" + S=3D${WORKDIR}/${MY_P} +fi + +inherit mount-boot eutils flag-o-matic toolchain-funcs ${LIVE_ECLASS} +unset LIVE_ECLASS + +DESCRIPTION=3D"GNU GRUB boot loader" +HOMEPAGE=3D"http://www.gnu.org/software/grub/" + +LICENSE=3D"GPL-3" +SLOT=3D"0" +KEYWORDS=3D"" +IUSE=3D"custom-cflags debug device-mapper static sdl truetype" + +RDEPEND=3D">=3Dsys-libs/ncurses-5.2-r5 + dev-libs/lzo + debug? ( + sdl? ( media-libs/libsdl ) + ) + device-mapper? ( >=3Dsys-fs/lvm2-2.02.45 ) + truetype? ( media-libs/freetype >=3Dmedia-fonts/unifont-5 )" +DEPEND=3D"${RDEPEND} + >=3Ddev-lang/python-2.5.2 +" +if [[ ${PV} =3D=3D "9999" ]]; then + DEPEND+=3D" >=3Dsys-devel/autogen-5.10 sys-apps/help2man" +else + DEPEND+=3D" app-arch/xz-utils" +fi + +export STRIP_MASK=3D"*/grub/*/*.mod" +QA_EXECSTACK=3D" + sbin/grub-probe + sbin/grub-setup + sbin/grub-mkdevicemap + bin/grub-script-check + bin/grub-fstest +" + +DOCS=3D( AUTHORS ChangeLog NEWS README THANKS TODO ) + +src_prepare() { + epatch_user + + # autogen.sh does more than just run autotools + if [[ ${PV} =3D=3D "9999" ]] ; then + sed -i -e '/^autoreconf/s:^:e:' autogen.sh || die + (. ./autogen.sh) || die + fi +} + +src_configure() { + use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS + use static && append-ldflags -static + + econf \ + --disable-werror \ + --sbindir=3D/sbin \ + --bindir=3D/bin \ + --libdir=3D/$(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) +} + +src_install() { + default + + insinto /etc/default + newins "${FILESDIR}"/defaults grub + cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib + GRUB_DISTRIBUTOR=3D"Gentoo" +EOF +} + +setup_boot_dir() { + local dir=3D$1 + + if [[ ! -e ${dir}/grub.cfg ]]; then + # display the link to guide if user didn't set up anything yet. + elog "For informations how to configure grub-2 please reffer to guide:= " + # FIXME: we don't have any guide yet! + # Lets just use archlinux wiki until we have some. + elog " https://wiki.archlinux.org/index.php/GRUB2" + fi + + if [[ ! -e ${dir}/grub.cfg && -e ${dir}/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: grub-menulst2cfg '${dir}/menu.lst' '${dir}/grub.cfg'" + grub-menulst2cfg "${dir}/menu.lst" "${dir}/grub.cfg" || \ + ewarn "Running grub-menulst2cfg failed!" + + einfo "Even if we just created configuration for your grub-2 using old= " + einfo "grub-1 configuration file you should migrate to use new style" + einfo "configuration in '${ROOT}/etc/grub.d'." + else + # we need to refresh the grub.cfg everytime just to play it safe + einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'" + grub-mkconfig -o "${dir}/grub.cfg" || \ + ewarn "Running grub-mkconfig failed! Check your configuration files!" + fi + + elog "Remember to run \"grub-mkconfig -o '${dir}/grub.cfg'\" every time= " + elog "you update the configuration files." +} + +pkg_postinst() { + mount-boot_mount_boot_partition + + setup_boot_dir "${ROOT}"boot/grub + + # needs to be called after we call setup_boot_dir + mount-boot_pkg_postinst +} diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml new file mode 100644 index 0000000..a05c330 --- /dev/null +++ b/sys-boot/grub/metadata.xml @@ -0,0 +1,9 @@ + + + +base-system + + Enable support for sys-fs/device-map= per + Allow grub1 and grub2 to be installed simulta= neously + +