1 |
robbat2 08/11/06 01:28:56 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: grub-0.97-r8.ebuild |
5 |
Log: |
6 |
Patchset version bump, fixes bugs 220687, 245741, 218611 (maybe), 231684 (maybe). In package.mask still, careful testing needed. |
7 |
(Portage version: 2.2_rc13/cvs/Linux 2.6.28-rc2-07920-g65fc716 x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.103 sys-boot/grub/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.103&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.103&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/grub/ChangeLog?r1=1.102&r2=1.103 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v |
19 |
retrieving revision 1.102 |
20 |
retrieving revision 1.103 |
21 |
diff -p -w -b -B -u -u -r1.102 -r1.103 |
22 |
--- ChangeLog 1 Nov 2008 12:46:54 -0000 1.102 |
23 |
+++ ChangeLog 6 Nov 2008 01:28:56 -0000 1.103 |
24 |
@@ -1,6 +1,12 @@ |
25 |
# ChangeLog for sys-boot/grub |
26 |
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.102 2008/11/01 12:46:54 robbat2 Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.103 2008/11/06 01:28:56 robbat2 Exp $ |
29 |
+ |
30 |
+*grub-0.97-r8 (05 Nov 2008) |
31 |
+ |
32 |
+ 05 Nov 2008; Robin H. Johnson <robbat2@g.o> +grub-0.97-r8.ebuild: |
33 |
+ Patchset version bump, fixes bugs 220687, 245741, 218611 (maybe), 231684 |
34 |
+ (maybe). In package.mask still, careful testing needed. |
35 |
|
36 |
01 Nov 2008; Robin H. Johnson <robbat2@g.o> grub-0.97-r6.ebuild: |
37 |
Add a magic flag GRUB_STATIC_PACKAGE_BUILDING which along with USE=static |
38 |
|
39 |
|
40 |
|
41 |
1.1 sys-boot/grub/grub-0.97-r8.ebuild |
42 |
|
43 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/grub/grub-0.97-r8.ebuild?rev=1.1&view=markup |
44 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-boot/grub/grub-0.97-r8.ebuild?rev=1.1&content-type=text/plain |
45 |
|
46 |
Index: grub-0.97-r8.ebuild |
47 |
=================================================================== |
48 |
# Copyright 1999-2008 Gentoo Foundation |
49 |
# Distributed under the terms of the GNU General Public License v2 |
50 |
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r8.ebuild,v 1.1 2008/11/06 01:28:56 robbat2 Exp $ |
51 |
|
52 |
# XXX: we need to review menu.lst vs grub.conf handling. We've been converting |
53 |
# all systems to grub.conf (and symlinking menu.lst to grub.conf), but |
54 |
# we never updated any of the source code (it still all wants menu.lst), |
55 |
# and there is no indication that upstream is making the transition. |
56 |
|
57 |
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools |
58 |
|
59 |
PATCHVER="1.8" # Should match the revision ideally |
60 |
DESCRIPTION="GNU GRUB Legacy boot loader" |
61 |
HOMEPAGE="http://www.gnu.org/software/grub/" |
62 |
SRC_URI="mirror://gentoo/${P}.tar.gz |
63 |
ftp://alpha.gnu.org/gnu/${PN}/${P}.tar.gz |
64 |
mirror://gentoo/splash.xpm.gz |
65 |
mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2" |
66 |
|
67 |
LICENSE="GPL-2" |
68 |
SLOT="0" |
69 |
KEYWORDS="~amd64 ~x86 ~x86-fbsd" |
70 |
IUSE="custom-cflags ncurses netboot static" |
71 |
|
72 |
DEPEND="ncurses? ( |
73 |
>=sys-libs/ncurses-5.2-r5 |
74 |
amd64? ( app-emulation/emul-linux-x86-baselibs ) |
75 |
)" |
76 |
PROVIDE="virtual/bootloader" |
77 |
|
78 |
src_unpack() { |
79 |
unpack ${A} |
80 |
cd "${S}" |
81 |
|
82 |
# patch breaks booting for some people #111885 |
83 |
rm "${WORKDIR}"/patch/400_* |
84 |
|
85 |
# Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as |
86 |
# discovered in bug 160801. We can change this, however, using larger values |
87 |
# for this variable means that Grub needs more memory to run and boot. For a |
88 |
# kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom |
89 |
# value in make.conf, it is possible to make kernels ~16Mb in size, but it |
90 |
# needs the kitchen sink built-in. |
91 |
local t="custom" |
92 |
if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then |
93 |
case $(tc-arch) in |
94 |
amd64) GRUB_MAX_KERNEL_SIZE=7 ;; |
95 |
x86) GRUB_MAX_KERNEL_SIZE=3 ;; |
96 |
esac |
97 |
t="default" |
98 |
fi |
99 |
einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)" |
100 |
|
101 |
sed -i \ |
102 |
-e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \ |
103 |
"${S}"/grub/asmstub.c \ |
104 |
|| die "Failed to hack memory size" |
105 |
|
106 |
if [[ -n ${PATCHVER} ]] ; then |
107 |
EPATCH_SUFFIX="patch" |
108 |
epatch "${WORKDIR}"/patch |
109 |
eautoreconf |
110 |
fi |
111 |
} |
112 |
|
113 |
src_compile() { |
114 |
filter-flags -fPIE #168834 |
115 |
|
116 |
use amd64 && multilib_toolchain_setup x86 |
117 |
|
118 |
unset BLOCK_SIZE #73499 |
119 |
|
120 |
### i686-specific code in the boot loader is a bad idea; disabling to ensure |
121 |
### at least some compatibility if the hard drive is moved to an older or |
122 |
### incompatible system. |
123 |
|
124 |
# grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2, |
125 |
# but the objcopy's (faulty) test fails if -fstack-protector is default. |
126 |
# create a cache telling configure that objcopy is ok, and add -C to econf |
127 |
# to make use of the cache. |
128 |
# |
129 |
# CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails. |
130 |
# STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites |
131 |
# -fno-stack-protector detected by configure, removed from netboot's emake. |
132 |
use custom-cflags || unset CFLAGS |
133 |
|
134 |
export grub_cv_prog_objcopy_absolute=yes #79734 |
135 |
use static && append-ldflags -static |
136 |
|
137 |
# Per bug 216625, the emul packages do not provide .a libs for performing |
138 |
# suitable static linking |
139 |
if use amd64 && use static ; then |
140 |
if [ -z "${GRUB_STATIC_PACKAGE_BUILDING}" ]; then |
141 |
die "You must use the grub-static package if you want a static Grub on amd64!" |
142 |
else |
143 |
eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This" |
144 |
eerror "is specifically intended for building the tarballs for the" |
145 |
eerror "grub-static package via USE='static -ncurses'." |
146 |
eerror "All bets are now off." |
147 |
ebeep 10 |
148 |
fi |
149 |
fi |
150 |
|
151 |
# build the net-bootable grub first, but only if "netboot" is set |
152 |
if use netboot ; then |
153 |
econf \ |
154 |
--libdir=/lib \ |
155 |
--datadir=/usr/lib/grub \ |
156 |
--exec-prefix=/ \ |
157 |
--disable-auto-linux-mem-opt \ |
158 |
--enable-diskless \ |
159 |
--enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ |
160 |
--enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ |
161 |
--enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ |
162 |
--enable-{tulip,via-rhine,w89c840} || die "netboot econf failed" |
163 |
|
164 |
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff" |
165 |
|
166 |
mv -f stage2/{nbgrub,pxegrub} "${S}"/ |
167 |
mv -f stage2/stage2 stage2/stage2.netboot |
168 |
|
169 |
make clean || die "make clean failed" |
170 |
fi |
171 |
|
172 |
# Now build the regular grub |
173 |
# Note that FFS and UFS2 support are broken for now - stage1_5 files too big |
174 |
econf \ |
175 |
--libdir=/lib \ |
176 |
--datadir=/usr/lib/grub \ |
177 |
--exec-prefix=/ \ |
178 |
--disable-auto-linux-mem-opt \ |
179 |
$(use_with ncurses curses) \ |
180 |
|| die "econf failed" |
181 |
|
182 |
# sanity check due to common failure |
183 |
use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found" |
184 |
|
185 |
emake || die "making regular stuff" |
186 |
} |
187 |
|
188 |
src_test() { |
189 |
# non-default block size also give false pass/fails. |
190 |
unset BLOCK_SIZE |
191 |
make check || die "make check failed" |
192 |
} |
193 |
|
194 |
src_install() { |
195 |
emake DESTDIR="${D}" install || die |
196 |
if use netboot ; then |
197 |
exeinto /usr/lib/grub/${CHOST} |
198 |
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install" |
199 |
fi |
200 |
|
201 |
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO |
202 |
newdoc docs/menu.lst grub.conf.sample |
203 |
dodoc "${FILESDIR}"/grub.conf.gentoo |
204 |
prepalldocs |
205 |
|
206 |
[ -n "${GRUB_STATIC_PACKAGE_BUILDING}" ] && \ |
207 |
mv \ |
208 |
"${D}"/usr/share/doc/${PF} \ |
209 |
"${D}"/usr/share/doc/grub-static-${PF/grub-} |
210 |
|
211 |
insinto /usr/share/grub |
212 |
doins "${DISTDIR}"/splash.xpm.gz |
213 |
} |
214 |
|
215 |
setup_boot_dir() { |
216 |
local boot_dir=$1 |
217 |
local dir=${boot_dir} |
218 |
|
219 |
[[ ! -e ${dir} ]] && die "${dir} does not exist!" |
220 |
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" |
221 |
dir="${dir}/grub" |
222 |
if [[ ! -e ${dir} ]] ; then |
223 |
mkdir "${dir}" || die "${dir} does not exist!" |
224 |
fi |
225 |
|
226 |
# change menu.lst to grub.conf |
227 |
if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then |
228 |
mv -f "${dir}"/menu.lst "${dir}"/grub.conf |
229 |
ewarn |
230 |
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" |
231 |
ewarn |
232 |
fi |
233 |
|
234 |
if [[ ! -e ${dir}/menu.lst ]]; then |
235 |
einfo "Linking from new grub.conf name to menu.lst" |
236 |
ln -snf grub.conf "${dir}"/menu.lst |
237 |
fi |
238 |
|
239 |
if [[ -e ${dir}/stage2 ]] ; then |
240 |
mv "${dir}"/stage2{,.old} |
241 |
ewarn "*** IMPORTANT NOTE: you must run grub and install" |
242 |
ewarn "the new version's stage1 to your MBR. Until you do," |
243 |
ewarn "stage1 and stage2 will still be the old version, but" |
244 |
ewarn "later stages will be the new version, which could" |
245 |
ewarn "cause problems such as an unbootable system." |
246 |
ewarn "This means you must use either grub-install or perform" |
247 |
ewarn "root/setup manually! For more help, see the handbook:" |
248 |
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto" |
249 |
ebeep |
250 |
fi |
251 |
|
252 |
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}" |
253 |
for x in \ |
254 |
"${ROOT}"/lib*/grub/*/* \ |
255 |
"${ROOT}"/usr/lib*/grub/*/* \ |
256 |
"${ROOT}"/usr/share/grub/* ; do |
257 |
[[ -f ${x} ]] && cp -p "${x}" "${dir}"/ |
258 |
done |
259 |
|
260 |
if [[ ! -e ${dir}/grub.conf ]] ; then |
261 |
s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" |
262 |
[[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf |
263 |
[[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf |
264 |
[[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf |
265 |
fi |
266 |
|
267 |
# Per bug 218599, we support grub.conf.install for users that want to run a |
268 |
# specific set of Grub setup commands rather than the default ones. |
269 |
grub_config=${dir}/grub.conf.install |
270 |
[[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf |
271 |
if [[ -e ${grub_config} ]] ; then |
272 |
egrep \ |
273 |
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ |
274 |
"${grub_config}" | \ |
275 |
/sbin/grub --batch \ |
276 |
--device-map="${dir}"/device.map \ |
277 |
> /dev/null |
278 |
fi |
279 |
|
280 |
# the grub default commands silently piss themselves if |
281 |
# the default file does not exist ahead of time |
282 |
if [[ ! -e ${dir}/default ]] ; then |
283 |
grub-set-default --root-directory="${boot_dir}" default |
284 |
fi |
285 |
einfo "Grub has been installed to ${boot_dir} successfully." |
286 |
} |
287 |
|
288 |
pkg_postinst() { |
289 |
if [[ -n ${DONT_MOUNT_BOOT} ]]; then |
290 |
elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" |
291 |
elog "the following instructions for your /boot!" |
292 |
elog "Neglecting to do so may cause your system to fail to boot!" |
293 |
elog |
294 |
else |
295 |
setup_boot_dir "${ROOT}"/boot |
296 |
# Trailing output because if this is run from pkg_postinst, it gets mixed into |
297 |
# the other output. |
298 |
einfo "" |
299 |
fi |
300 |
elog "To interactively install grub files to another device such as a USB" |
301 |
elog "stick, just run the following and specify the directory as prompted:" |
302 |
elog " emerge --config =${PF}" |
303 |
elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" |
304 |
elog "grub where to install in a non-interactive way." |
305 |
|
306 |
} |
307 |
|
308 |
pkg_config() { |
309 |
local dir |
310 |
if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then |
311 |
einfo "Enter the directory where you want to setup grub:" |
312 |
read dir |
313 |
else |
314 |
dir="${GRUB_ALT_INSTALLDIR}" |
315 |
fi |
316 |
setup_boot_dir "${dir}" |
317 |
} |