Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/
Date: Sun, 31 Dec 2017 21:49:19
Message-Id: 1514756915.b7ceb900b3d131f4293ef3c62f00683e0d10cb04.mgorny@gentoo
1 commit: b7ceb900b3d131f4293ef3c62f00683e0d10cb04
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 31 10:23:15 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 31 21:48:35 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7ceb900
7
8 sys-boot/grub: Drop interim old version (redudant)
9
10 sys-boot/grub/grub-0.97-r17.ebuild | 300 -------------------------------------
11 1 file changed, 300 deletions(-)
12
13 diff --git a/sys-boot/grub/grub-0.97-r17.ebuild b/sys-boot/grub/grub-0.97-r17.ebuild
14 deleted file mode 100644
15 index b34191f7346..00000000000
16 --- a/sys-boot/grub/grub-0.97-r17.ebuild
17 +++ /dev/null
18 @@ -1,300 +0,0 @@
19 -# Copyright 1999-2017 Gentoo Foundation
20 -# Distributed under the terms of the GNU General Public License v2
21 -
22 -# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
23 -# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
24 -# we never updated any of the source code (it still all wants menu.lst),
25 -# and there is no indication that upstream is making the transition.
26 -
27 -# If you need to roll a new grub-static distfile, here is how.
28 -# - Robin H. Johnson <robbat2@g.o> - 29 Nov 2010
29 -# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \
30 -# USE='static -ncurses -netboot -custom-cflags' \
31 -# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \
32 -# grub-${PVR}.ebuild clean package && \
33 -# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \
34 -# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2
35 -
36 -EAPI="5"
37 -
38 -inherit eutils mount-boot toolchain-funcs linux-info flag-o-matic autotools pax-utils multiprocessing
39 -
40 -PATCHVER="1.14" # Should match the revision ideally
41 -DESCRIPTION="GNU GRUB Legacy boot loader"
42 -HOMEPAGE="https://www.gnu.org/software/grub/"
43 -SRC_URI="mirror://gentoo/${P}.tar.gz
44 - mirror://gnu-alpha/${PN}/${P}.tar.gz
45 - mirror://gentoo/splash.xpm.gz
46 - mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2"
47 -
48 -LICENSE="GPL-2"
49 -SLOT="0"
50 -KEYWORDS="~amd64 ~x86 ~x86-fbsd"
51 -IUSE="custom-cflags ncurses netboot static"
52 -
53 -LIB_DEPEND="ncurses? ( >=sys-libs/ncurses-5.9-r3:0[static-libs(+),abi_x86_32(-)] )"
54 -RDEPEND="!static? ( ${LIB_DEPEND//[static-libs(+),/=[} )"
55 -DEPEND="${RDEPEND}
56 - virtual/pkgconfig
57 - static? ( ${LIB_DEPEND} )"
58 -RDEPEND+=" !sys-boot/grub:2[-multislot]"
59 -
60 -pkg_setup() {
61 - case $(tc-arch) in
62 - amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
63 - esac
64 -}
65 -
66 -src_prepare() {
67 - # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as
68 - # discovered in bug 160801. We can change this, however, using larger values
69 - # for this variable means that Grub needs more memory to run and boot. For a
70 - # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom
71 - # value in make.conf, it is possible to make kernels ~16Mb in size, but it
72 - # needs the kitchen sink built-in.
73 - local t="custom"
74 - if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then
75 - case $(tc-arch) in
76 - amd64) GRUB_MAX_KERNEL_SIZE=9 ;;
77 - x86) GRUB_MAX_KERNEL_SIZE=5 ;;
78 - esac
79 - t="default"
80 - fi
81 - einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)"
82 -
83 - sed -i \
84 - -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \
85 - "${S}"/grub/asmstub.c \
86 - || die
87 -
88 - # gcc-6 and above doesnt have a '-nopie' option patched in, use upstream's -no-pie
89 - if (( $(gcc-major-version) > 5 )); then
90 - sed -i 's/-nopie/-no-pie/' \
91 - "${WORKDIR}"/patch/860_all_grub-0.97-pie.patch \
92 - || die
93 - fi
94 -
95 - EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
96 - # bug 564890, 566638
97 - epatch "${FILESDIR}"/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch
98 - epatch "${FILESDIR}"/grub-0.97-ncurses-pkgconfig.patch
99 -
100 - epatch_user
101 -
102 - rm -f "${S}"/aclocal.m4 # seems to keep bug 418287 away
103 - eautoreconf
104 -}
105 -
106 -src_configure() {
107 - filter-flags -fPIE #168834
108 -
109 - use amd64 && multilib_toolchain_setup x86
110 -
111 - unset BLOCK_SIZE #73499
112 -
113 - ### i686-specific code in the boot loader is a bad idea; disabling to ensure
114 - ### at least some compatibility if the hard drive is moved to an older or
115 - ### incompatible system.
116 -
117 - # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2,
118 - # but the objcopy's (faulty) test fails if -fstack-protector is default.
119 - # create a cache telling configure that objcopy is ok, and add -C to econf
120 - # to make use of the cache.
121 - #
122 - # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails.
123 - # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites
124 - # -fno-stack-protector detected by configure, removed from netboot's emake.
125 - use custom-cflags || unset CFLAGS
126 -
127 - tc-ld-disable-gold #439082 #466536 #526348
128 -
129 - export grub_cv_prog_objcopy_absolute=yes #79734
130 - use static && append-ldflags -static
131 -
132 - if use amd64 && use static ; then
133 - if [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] ; then
134 - eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This"
135 - eerror "is specifically intended for building the tarballs for the"
136 - eerror "grub-static package via USE='static -ncurses'."
137 - eerror "All bets are now off."
138 - fi
139 - fi
140 -
141 - multijob_init
142 -
143 - # build the net-bootable grub first, but only if "netboot" is set
144 - if use netboot ; then
145 - (
146 - multijob_child_init
147 - mkdir -p "${WORKDIR}"/netboot
148 - pushd "${WORKDIR}"/netboot >/dev/null
149 - ECONF_SOURCE=${S} \
150 - econf \
151 - --libdir=/lib \
152 - --datadir=/usr/lib/grub \
153 - --exec-prefix=/ \
154 - --disable-auto-linux-mem-opt \
155 - --enable-diskless \
156 - --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \
157 - --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \
158 - --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \
159 - --enable-{tulip,via-rhine,w89c840}
160 - popd >/dev/null
161 - ) &
162 - multijob_post_fork
163 - fi
164 -
165 - # Now build the regular grub
166 - # Note that FFS and UFS2 support are broken for now - stage1_5 files too big
167 - econf \
168 - --libdir=/lib \
169 - --datadir=/usr/lib/grub \
170 - --exec-prefix=/ \
171 - --disable-auto-linux-mem-opt \
172 - $(use_with ncurses curses)
173 -
174 - # sanity check due to common failure
175 - use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found"
176 -
177 - multijob_finish
178 -}
179 -
180 -src_compile() {
181 - use netboot && emake -C "${WORKDIR}"/netboot w89c840_o_CFLAGS="-O"
182 - emake
183 -}
184 -
185 -src_test() {
186 - # non-default block size also give false pass/fails.
187 - unset BLOCK_SIZE
188 - emake -j1 check
189 -}
190 -
191 -src_install() {
192 - default
193 - if use netboot ; then
194 - exeinto /usr/lib/grub/${CHOST}
195 - doexe "${WORKDIR}"/netboot/stage2/{nbgrub,pxegrub}
196 - newexe "${WORKDIR}"/netboot/stage2/stage2 stage2.netboot
197 - fi
198 -
199 - pax-mark -m "${D}"/sbin/grub #330745
200 -
201 - newdoc docs/menu.lst grub.conf.sample
202 - dodoc "${FILESDIR}"/grub.conf.gentoo
203 -
204 - [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] && \
205 - mv "${D}"/usr/share/doc/{${PF},grub-static-${PF/grub-}}
206 -
207 - insinto /usr/share/grub
208 - doins "${DISTDIR}"/splash.xpm.gz
209 -}
210 -
211 -setup_boot_dir() {
212 - local boot_dir=$1
213 - local dir=${boot_dir}
214 -
215 - mkdir -p "${dir}"
216 - [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
217 - dir="${dir}/grub"
218 - if [[ ! -e ${dir} ]] ; then
219 - mkdir "${dir}" || die
220 - fi
221 -
222 - # change menu.lst to grub.conf
223 - if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
224 - mv -f "${dir}"/menu.lst "${dir}"/grub.conf
225 - ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
226 - echo
227 - fi
228 -
229 - if [[ ! -e ${dir}/menu.lst ]]; then
230 - einfo "Linking from new grub.conf name to menu.lst"
231 - ln -snf grub.conf "${dir}"/menu.lst
232 - fi
233 -
234 - if [[ -e ${dir}/stage2 ]] ; then
235 - mv "${dir}"/stage2{,.old}
236 - ewarn "*** IMPORTANT NOTE: you must run grub and install"
237 - ewarn "the new version's stage1 to your MBR. Until you do,"
238 - ewarn "stage1 and stage2 will still be the old version, but"
239 - ewarn "later stages will be the new version, which could"
240 - ewarn "cause problems such as an unbootable system."
241 - ewarn
242 - ewarn "This means you must use either grub-install or perform"
243 - ewarn "root/setup manually."
244 - ewarn
245 - ewarn "For more help, see the wiki:"
246 - ewarn "https://wiki.gentoo.org/wiki/GRUB"
247 - echo
248 - fi
249 -
250 - einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}"
251 - for x in \
252 - "${ROOT}"/lib*/grub/*/* \
253 - "${ROOT}"/usr/share/grub/* ; do
254 - [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
255 - done
256 -
257 - if [[ ! -e ${dir}/grub.conf ]] ; then
258 - s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
259 - [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
260 - [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
261 - [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
262 - fi
263 -
264 - # Per bug 218599, we support grub.conf.install for users that want to run a
265 - # specific set of Grub setup commands rather than the default ones.
266 - grub_config=${dir}/grub.conf.install
267 - [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
268 - if [[ -e ${grub_config} ]] ; then
269 - egrep \
270 - -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
271 - "${grub_config}" | \
272 - /sbin/grub --batch \
273 - --device-map="${dir}"/device.map \
274 - > /dev/null
275 - fi
276 -
277 - # the grub default commands silently piss themselves if
278 - # the default file does not exist ahead of time
279 - if [[ ! -e ${dir}/default ]] ; then
280 - grub-set-default --root-directory="${boot_dir}" default
281 - fi
282 - einfo "Grub has been installed to ${boot_dir} successfully."
283 -}
284 -
285 -pkg_postinst() {
286 - mount-boot_mount_boot_partition
287 -
288 - if [[ -n ${DONT_MOUNT_BOOT} ]]; then
289 - elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
290 - elog "the following instructions for your /boot!"
291 - elog "Neglecting to do so may cause your system to fail to boot!"
292 - elog
293 - else
294 - setup_boot_dir "${ROOT}"/boot
295 - # Trailing output because if this is run from pkg_postinst, it gets mixed into
296 - # the other output.
297 - einfo ""
298 - fi
299 - elog "To interactively install grub files to another device such as a USB"
300 - elog "stick, just run the following and specify the directory as prompted:"
301 - elog " emerge --config =${PF}"
302 - elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
303 - elog "grub where to install in a non-interactive way."
304 -
305 - # needs to be after we call setup_boot_dir
306 - mount-boot_pkg_postinst
307 -}
308 -
309 -pkg_config() {
310 - local dir
311 - if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
312 - einfo "Enter the directory where you want to setup grub:"
313 - read dir
314 - else
315 - dir="${GRUB_ALT_INSTALLDIR}"
316 - fi
317 - setup_boot_dir "${dir}"
318 -}