--- grub.ebuild 2005-02-20 13:34:21 +0100 +++ /usr/local/portage/sys-boot/grub/grub-0.96.ebuild 2005-02-20 15:10:10 +0100 @@ -1,18 +1,20 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.95.20040823.ebuild,v 1.7 2004/12/01 05:55:55 mr_bones_ Exp $ inherit mount-boot eutils flag-o-matic gnuconfig toolchain-funcs +CVS_VER="20050218" DESCRIPTION="GNU GRUB boot loader" HOMEPAGE="http://www.gnu.org/software/grub/" SRC_URI="mirror://gentoo/${P}.tar.gz + mirror://gentoo/${P}-cvs-update-${CVS_VER}.patch.bz2 mirror://gentoo/${P}-splash.patch.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" -IUSE="static netboot" +IUSE="netboot pic static" RDEPEND=">=sys-libs/ncurses-5.2-r5" DEPEND="${RDEPEND} @@ -33,11 +35,16 @@ epatch ${WORKDIR}/${P}-splash.patch - # PIC patch by psm & kevin f. quinn - epatch ${FILESDIR}/${P}-PIC2.patch - - # -fwritable-strings is deprecated - epatch ${FILESDIR}/${P}-warnings.patch + if [[ -z ${CVS_VER} ]] ; then + # PIC patch by psm & kevin f. quinn + epatch ${FILESDIR}/${P}-PIC2.patch + + # -fwritable-strings is deprecated + epatch ${FILESDIR}/${P}-warnings.patch + else + epatch ${WORKDIR}/${P}-cvs-update-${CVS_VER}.patch + epatch ${FILESDIR}/${P}-20050210-pic.patch + fi # disable tests for BSD file systems that always fail (bug #71811) epatch ${FILESDIR}/${P}-bounced-checks.patch @@ -70,18 +77,25 @@ # -fno-stack-protector detected by configure, removed from netboot's emake has_ssp && echo "grub_cv_prog_objcopy_absolute=yes" > config.cache - local myconf="--sbindir=/sbin --disable-auto-linux-mem-opt" + local myconf="-C --sbindir=/sbin --disable-auto-linux-mem-opt" # build the net-bootable grub first, but only if "netboot" is set if use netboot; then CFLAGS="" \ - econf -C ${myconf} \ + econf ${myconf} \ --enable-diskless \ --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ --enable-{tulip,via-rhine,w89c840} || die "netboot econf failed" + #emake w89c840_o_CFLAGS="-O" libdrivers_a_CFLAGS="-fno-pic" || die "making netboot" + if use pic ; then + cd netboot + make libdrivers_a-main.o CC="$(tc-getCC) -fno-pic" + make libdrivers_a-pci.o CC="$(tc-getCC) -fno-pic" + cd .. + fi emake w89c840_o_CFLAGS="-O" || die "making netboot" mv stage2/{nbgrub,pxegrub} ${S} @@ -92,7 +106,7 @@ # Now build the regular grub # Note that FFS and UFS2 support are broken for now - stage1_5 files too big - CFLAGS="" econf -C ${myconf} || die "econf failed" + CFLAGS="" econf ${myconf} || die "econf failed" emake || die "making regular grub" } @@ -133,7 +147,7 @@ fi einfo "Linking grub.conf to menu.lst.." - ln -sf grub.conf /boot/grub/menu.lst + ln -sfn grub.conf /boot/grub/menu.lst [[ -e /boot/grub/stage2 ]] && mv /boot/grub/stage2{,.old} @@ -144,8 +158,15 @@ [[ -x /sbin/chpax ]] && /sbin/chpax -spme /sbin/grub ||: [[ -x /sbin/paxctl ]] && /sbin/paxctl -spme /sbin/grub + # ssp triggers in password_func() if an (md5) password is set in grub.conf + # if built w/ gcc-3.3.5-r1, gcc-3.4.3-r1 does not exhibit this + # if device.map is incorrect, it could nuke the boot manager # Not sure what this is exactly for, but "if it works, don't fix it". - [[ -e /boot/grub/grub.conf ]] \ - && /sbin/grub --batch --device-map=/boot/grub/device.map \ - < /boot/grub/grub.conf > /dev/null 2>&1 + #[[ -e /boot/grub/grub.conf && -e /boot/grub/device.map ]] \ + # && /sbin/grub --batch --device-map=/boot/grub/device.map \ + # < /boot/grub/grub.conf > /dev/null 2>&1 + echo + ewarn "If this is first time install of grub, don't forget to install it" + ewarn "into MBR or the active partition" + echo }