Lines 14-20
Link Here
|
14 |
KEYWORDS="~x86 ~amd64" |
14 |
KEYWORDS="~x86 ~amd64" |
15 |
IUSE="static netboot" |
15 |
IUSE="static netboot" |
16 |
|
16 |
|
17 |
DEPEND=">=sys-libs/ncurses-5.2-r5 |
17 |
RDEPEND=">=sys-libs/ncurses-5.2-r5" |
|
|
18 |
DEPEND="${RDEPEND} |
18 |
>=sys-devel/automake-1.7 |
19 |
>=sys-devel/automake-1.7 |
19 |
>=sys-devel/autoconf-2.5" |
20 |
>=sys-devel/autoconf-2.5" |
20 |
PROVIDE="virtual/bootloader" |
21 |
PROVIDE="virtual/bootloader" |
Lines 40-73
Link Here
|
40 |
|
41 |
|
41 |
# -fwritable-strings is deprecated; testing to see if we need it any more |
42 |
# -fwritable-strings is deprecated; testing to see if we need it any more |
42 |
epatch ${FILESDIR}/${P}-warnings.patch |
43 |
epatch ${FILESDIR}/${P}-warnings.patch |
|
|
44 |
|
45 |
epatch ${FILESDIR}/${PN}-0.94-textrel.patch |
43 |
} |
46 |
} |
44 |
|
47 |
|
45 |
src_compile() { |
48 |
src_compile() { |
46 |
### i686-specific code in the boot loader is a bad idea; disabling to ensure |
|
|
47 |
### at least some compatibility if the hard drive is moved to an older or |
48 |
### incompatible system. |
49 |
unset CFLAGS |
50 |
|
51 |
filter-ldflags -pie |
52 |
append-flags -DNDEBUG |
49 |
append-flags -DNDEBUG |
53 |
[ `gcc-major-version` -eq 3 ] && append-flags -minline-all-stringops |
50 |
[ `gcc-major-version` -eq 3 ] && append-flags -minline-all-stringops |
54 |
use static && append-ldflags -static |
51 |
use static && append-ldflags -static |
55 |
|
52 |
|
56 |
has_pie && CC="${tc-getCC} `test_flag -fno-pic` `test_flag -nopie`" |
|
|
57 |
has_ssp && CC="${tc-getCC} `test_flag -fno-stack-protector`" |
58 |
|
59 |
autoconf || die "autoconf failed" |
53 |
autoconf || die "autoconf failed" |
60 |
aclocal || die "aclocal failed" |
54 |
aclocal || die "aclocal failed" |
61 |
WANT_AUTOMAKE=1.7 automake || die "automake failed" |
55 |
WANT_AUTOMAKE=1.7 automake || die "automake failed" |
62 |
|
56 |
|
|
|
57 |
# grub-0.95 got added -fno-stack-protector detection, to disable ssp for stage2 |
58 |
# but the objcopy's (faulty) test fails if -fstack-protector is default |
59 |
# create a cache telling configure that objcopy is ok |
60 |
# added -C to econf to make use of the cache |
61 |
# CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails |
62 |
# STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites |
63 |
# -fno-stack-protector detected by configure, removed from netboot's emake |
64 |
has_ssp && echo "grub_cv_prog_objcopy_absolute=yes" > config.cache |
65 |
|
66 |
local myconf="--sbindir=/sbin --disable-auto-linux-mem-opt" |
67 |
|
63 |
# build the net-bootable grub first, but only if "netboot" is set |
68 |
# build the net-bootable grub first, but only if "netboot" is set |
64 |
if use netboot |
69 |
if use netboot |
65 |
then |
70 |
then |
66 |
CFLAGS="" \ |
71 |
CFLAGS="" \ |
67 |
econf \ |
72 |
econf -C ${myconf} \ |
68 |
--datadir=/usr/lib/grub \ |
|
|
69 |
--exec-prefix=/ \ |
70 |
--disable-auto-linux-mem-opt \ |
71 |
--enable-diskless \ |
73 |
--enable-diskless \ |
72 |
--enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ |
74 |
--enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ |
73 |
--enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ |
75 |
--enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ |
Lines 84-101
Link Here
|
84 |
|
86 |
|
85 |
# Now build the regular grub |
87 |
# Now build the regular grub |
86 |
# Note that FFS and UFS2 support are broken for now - stage1_5 files too big |
88 |
# Note that FFS and UFS2 support are broken for now - stage1_5 files too big |
87 |
CFLAGS="${CFLAGS}" \ |
89 |
CFLAGS="" econf -C ${myconf} || die "econf failed" |
88 |
econf \ |
|
|
89 |
--datadir=/usr/lib/grub \ |
90 |
--exec-prefix=/ \ |
91 |
--disable-auto-linux-mem-opt || die "econf failed" |
92 |
emake || die "making regular stuff" |
90 |
emake || die "making regular stuff" |
93 |
} |
91 |
} |
94 |
|
92 |
|
95 |
src_install() { |
93 |
src_install() { |
96 |
make DESTDIR=${D} install || die |
94 |
make DESTDIR=${D} install || die |
97 |
exeinto /usr/lib/grub |
95 |
exeinto /usr/lib/grub |
98 |
doexe stage2/stage2 |
96 |
#doexe stage2/stage2 |
99 |
use netboot && doexe nbgrub pxegrub stage2/stage2.netboot |
97 |
use netboot && doexe nbgrub pxegrub stage2/stage2.netboot |
100 |
|
98 |
|
101 |
insinto /boot/grub |
99 |
insinto /boot/grub |
Lines 123-132
Link Here
|
123 |
[ -e /boot/grub/stage2 ] && mv /boot/grub/stage2{,.old} |
121 |
[ -e /boot/grub/stage2 ] && mv /boot/grub/stage2{,.old} |
124 |
|
122 |
|
125 |
einfo "Copying files from /usr/lib/grub to /boot" |
123 |
einfo "Copying files from /usr/lib/grub to /boot" |
|
|
124 |
# psm: there are no files either, they are in arch-{vendor,pc,unknown} |
126 |
cp -p /usr/lib/grub/* /boot/grub |
125 |
cp -p /usr/lib/grub/* /boot/grub |
127 |
cp -p /lib/grub/*/* /boot/grub |
126 |
# psm: no files there anymore |
|
|
127 |
#cp -p /lib/grub/*/* /boot/grub |
128 |
cp -p /usr/lib/grub/*/* /boot/grub |
128 |
cp -p /usr/lib/grub/*/* /boot/grub |
129 |
|
129 |
|
|
|
130 |
[ -x /sbin/chpax ] && /sbin/chpax -spm /sbin/grub |
131 |
[ -x /sbin/paxctl ] && /sbin/paxctl -spm /sbin/grub |
132 |
|
130 |
[ -e /boot/grub/grub.conf ] \ |
133 |
[ -e /boot/grub/grub.conf ] \ |
131 |
&& /sbin/grub \ |
134 |
&& /sbin/grub \ |
132 |
--batch \ |
135 |
--batch \ |