Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub2 ebuild 'works'
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
tranquilcool
Veteran
Veteran


Joined: 25 Mar 2005
Posts: 1159

PostPosted: Sun Apr 19, 2009 7:10 am    Post subject: Grub2 ebuild 'works' Reply with quote

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/sys-boot/grub/grub-9999.ebuild cyrillic $

ESVN_REPO_URI="svn://svn.sv.gnu.org/grub/trunk/grub2"
EAPI=2
inherit mount-boot eutils flag-o-matic bzr autotools subversion

IUSE="static netboot custom-cflags"

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

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"

DEPEND=">=sys-libs/ncurses-5.2-r5
=dev-libs/lzo-2*"
PROVIDE="virtual/bootloader"
RESTRICT="strip"

src_compile() {
cd "${S}"
./autogen.sh || die "autogen failed"
use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
use static && append-ldflags -static
chmod +x ./configure
econf || die "configure failed"
emake
}

src_install() {
emake DESTDIR=${D} install || die
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
}


works for me!
_________________
this is a strange strange world.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Apr 19, 2009 7:54 pm    Post subject: Reply with quote

The recent addition of autogen.sh now requires dev-lang/ruby.
This is the ebuild I am using now.
Code:
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /usr/local/portage/sys-boot/grub/grub-9999.ebuild cyrillic $

ESVN_REPO_URI="svn://svn.sv.gnu.org/grub/trunk/grub2"
ESVN_BOOTSTRAP="autogen.sh"

inherit flag-o-matic subversion

# Grub will do its own stripping (broken binaries otherwise)
RESTRICT="strip"

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

EAPI=2
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="custom-cflags minimal static"

DEPEND="dev-lang/ruby
   !minimal? ( sys-libs/ncurses
      media-libs/freetype:2
      dev-libs/libusb )"
PROVIDE="virtual/bootloader"

src_configure() {
   use custom-cflags || unset CFLAGS CXXFLAGS LDFLAGS
   use static && append-ldflags -static
   econf \
   $(use_enable !minimal grub-emu) \
   $(use_enable !minimal grub-fstest) \
   $(use_enable !minimal grub-mkfont) \
   || die
}

src_install() {
   emake DESTDIR=${D} install || die
}
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sun Apr 19, 2009 9:45 pm    Post subject: Reply with quote

Anyone test this under Hardened?
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Apr 19, 2009 10:24 pm    Post subject: Reply with quote

You might have problems compiling it on a hardened toolchain (please try it, and post the results).

But if you compile it on a non-hardened system, it should have no problem booting your hardened kernel.
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sun Apr 19, 2009 10:24 pm    Post subject: Reply with quote

cyrillic wrote:
You might have problems compiling it on a hardened toolchain (please try it, and post the results).

But if you compile it on a non-hardened system, it should have no problem booting your hardened kernel.

I'll try this as soon as hardened-sources-2.6.29 becomes available.
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6108
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Tue Apr 21, 2009 9:20 am    Post subject: Reply with quote

for hardened - as a rule (from my experience) - you might need to disable pie or -D_FORTIFY_SOURCE=2 in order to be able to build grub / that it works properly (e.g. not crashing or segfaulting during setting it up in the mbr) :idea:
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Tue Apr 21, 2009 10:57 am    Post subject: Reply with quote

kernelOfTruth wrote:
for hardened - as a rule (from my experience) - you might need to disable pie or -D_FORTIFY_SOURCE=2 in order to be able to build grub / that it works properly (e.g. not crashing or segfaulting during setting it up in the mbr) :idea:

The original GRUB is booting just fine on my VPS. All I did was remove -fstack-protector-all.
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6108
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Tue Apr 21, 2009 10:59 am    Post subject: Reply with quote

wswartzendruber wrote:
kernelOfTruth wrote:
for hardened - as a rule (from my experience) - you might need to disable pie or -D_FORTIFY_SOURCE=2 in order to be able to build grub / that it works properly (e.g. not crashing or segfaulting during setting it up in the mbr) :idea:

The original GRUB is booting just fine on my VPS. All I did was remove -fstack-protector-all.


oh ! I forgot about that one :wink:

I couldn't get the unmodified grub to work for me so I always had to switch to vanilla spec-profile

so perhaps the nossp_all spec will do it also ...

I'll give that a try in the future - thanks !
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum