Gentoo Archives: gentoo-commits

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