1 |
robbat2 10/11/30 08:06:51 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: grub-static-0.97-r10.ebuild |
5 |
Log: |
6 |
Bump grub-static to match grub 0.97-r10. |
7 |
|
8 |
(Portage version: 2.2.0_alpha6/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.25 sys-boot/grub-static/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub-static/ChangeLog?rev=1.25&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub-static/ChangeLog?rev=1.25&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub-static/ChangeLog?r1=1.24&r2=1.25 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub-static/ChangeLog,v |
20 |
retrieving revision 1.24 |
21 |
retrieving revision 1.25 |
22 |
diff -p -w -b -B -u -u -r1.24 -r1.25 |
23 |
--- ChangeLog 12 Dec 2009 18:13:33 -0000 1.24 |
24 |
+++ ChangeLog 30 Nov 2010 08:06:51 -0000 1.25 |
25 |
@@ -1,6 +1,12 @@ |
26 |
# ChangeLog for sys-boot/grub-static |
27 |
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/ChangeLog,v 1.24 2009/12/12 18:13:33 robbat2 Exp $ |
29 |
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
30 |
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub-static/ChangeLog,v 1.25 2010/11/30 08:06:51 robbat2 Exp $ |
31 |
+ |
32 |
+*grub-static-0.97-r10 (30 Nov 2010) |
33 |
+ |
34 |
+ 30 Nov 2010; Robin H. Johnson <robbat2@g.o> |
35 |
+ +grub-static-0.97-r10.ebuild: |
36 |
+ Bump grub-static to match grub 0.97-r10. |
37 |
|
38 |
12 Dec 2009; Robin H. Johnson <robbat2@g.o> |
39 |
grub-static-0.97-r9.ebuild: |
40 |
|
41 |
|
42 |
|
43 |
1.1 sys-boot/grub-static/grub-static-0.97-r10.ebuild |
44 |
|
45 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r10.ebuild?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub-static/grub-static-0.97-r10.ebuild?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: grub-static-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-static/grub-static-0.97-r10.ebuild,v 1.1 2010/11/30 08:06:51 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 eutils mount-boot toolchain-funcs linux-info |
60 |
|
61 |
PATCHVER="1.9" # Not used, just for tracking with main grub |
62 |
|
63 |
DESCRIPTION="GNU GRUB Legacy boot loader (static build)" |
64 |
|
65 |
HOMEPAGE="http://www.gnu.org/software/grub/" |
66 |
SRC_URI="mirror://gentoo/${PF}.tar.bz2" |
67 |
LICENSE="GPL-2" |
68 |
SLOT="0" |
69 |
KEYWORDS="-* ~amd64 ~x86" |
70 |
IUSE="" |
71 |
DEPEND="!sys-boot/grub" |
72 |
PROVIDE="virtual/bootloader" |
73 |
|
74 |
# These are already stripped since we use a binpkg. |
75 |
QA_PRESTRIPPED="/sbin/grub /bin/mbchk" |
76 |
|
77 |
pkg_setup() { |
78 |
local arch="$(tc-arch)" |
79 |
case ${arch} in |
80 |
amd64) |
81 |
CONFIG_CHECK='~IA32_EMULATION' |
82 |
WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!" |
83 |
check_extra_config |
84 |
;; |
85 |
esac |
86 |
} |
87 |
|
88 |
src_install() { |
89 |
cp -a "${WORKDIR}"/* "${D}"/ |
90 |
run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!" |
91 |
} |
92 |
|
93 |
run_test_grub() { |
94 |
local grub="$1" |
95 |
local version="$(${grub} \ |
96 |
--read-only --no-pager --no-floppy --no-curses \ |
97 |
--no-config-file --batch --version)" |
98 |
local error="grub test-run failed" |
99 |
use amd64 && error="${error} Is IA32_EMULATION set?" |
100 |
[ "${version/${PV}}" != "${version}" ] || die "${error}" |
101 |
return 0 |
102 |
} |
103 |
|
104 |
# |
105 |
# Below this point, everything is also used in grub-static! |
106 |
# Please keep in sync! |
107 |
# |
108 |
|
109 |
setup_boot_dir() { |
110 |
local boot_dir=$1 |
111 |
local dir=${boot_dir} |
112 |
|
113 |
run_test_grub /sbin/grub |
114 |
|
115 |
mkdir -p "${dir}" |
116 |
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" |
117 |
dir="${dir}/grub" |
118 |
if [[ ! -e ${dir} ]] ; then |
119 |
mkdir "${dir}" || die "${dir} does not exist!" |
120 |
fi |
121 |
|
122 |
# change menu.lst to grub.conf |
123 |
if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then |
124 |
mv -f "${dir}"/menu.lst "${dir}"/grub.conf |
125 |
ewarn |
126 |
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" |
127 |
ewarn |
128 |
fi |
129 |
|
130 |
if [[ ! -e ${dir}/menu.lst ]]; then |
131 |
einfo "Linking from new grub.conf name to menu.lst" |
132 |
ln -snf grub.conf "${dir}"/menu.lst |
133 |
fi |
134 |
|
135 |
if [[ -e ${dir}/stage2 ]] ; then |
136 |
mv "${dir}"/stage2{,.old} |
137 |
ewarn "*** IMPORTANT NOTE: you must run grub and install" |
138 |
ewarn "the new version's stage1 to your MBR. Until you do," |
139 |
ewarn "stage1 and stage2 will still be the old version, but" |
140 |
ewarn "later stages will be the new version, which could" |
141 |
ewarn "cause problems such as an unbootable system." |
142 |
ewarn "This means you must use either grub-install or perform" |
143 |
ewarn "root/setup manually! For more help, see the handbook:" |
144 |
ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto" |
145 |
ebeep |
146 |
fi |
147 |
|
148 |
einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}" |
149 |
for x in \ |
150 |
"${ROOT}"/lib*/grub/*/* \ |
151 |
"${ROOT}"/usr/lib*/grub/*/* \ |
152 |
"${ROOT}"/usr/share/grub/* ; do |
153 |
[[ -f ${x} ]] && cp -p "${x}" "${dir}"/ |
154 |
done |
155 |
|
156 |
if [[ ! -e ${dir}/grub.conf ]] ; then |
157 |
s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" |
158 |
[[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf |
159 |
[[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf |
160 |
[[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf |
161 |
fi |
162 |
|
163 |
# Per bug 218599, we support grub.conf.install for users that want to run a |
164 |
# specific set of Grub setup commands rather than the default ones. |
165 |
grub_config=${dir}/grub.conf.install |
166 |
[[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf |
167 |
if [[ -e ${grub_config} ]] ; then |
168 |
local tmp="${TMPDIR}/${P}-setup_boot_dir-$$" |
169 |
egrep \ |
170 |
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ |
171 |
"${grub_config}" >"${tmp}" |
172 |
# Do NOT fail here, only warn. |
173 |
/sbin/grub --batch \ |
174 |
--device-map="${dir}"/device.map \ |
175 |
>/dev/null <"${tmp}" |
176 |
rc=$? |
177 |
[[ $rc -ne 0 ]] && ewarn "Grub failed to run!" |
178 |
fi |
179 |
|
180 |
# the grub default commands silently piss themselves if |
181 |
# the default file does not exist ahead of time |
182 |
if [[ ! -e ${dir}/default ]] ; then |
183 |
# This may fail, don't worry about it. |
184 |
grub-set-default --root-directory="${boot_dir}" default |
185 |
: |
186 |
fi |
187 |
einfo "Grub has been installed to ${boot_dir} successfully." |
188 |
} |
189 |
|
190 |
pkg_postinst() { |
191 |
if [[ -n ${DONT_MOUNT_BOOT} ]]; then |
192 |
elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" |
193 |
elog "the following instructions for your /boot!" |
194 |
elog "Neglecting to do so may cause your system to fail to boot!" |
195 |
elog |
196 |
else |
197 |
setup_boot_dir "${ROOT}"/boot |
198 |
# Trailing output because if this is run from pkg_postinst, it gets mixed into |
199 |
# the other output. |
200 |
einfo "" |
201 |
fi |
202 |
elog "To interactively install grub files to another device such as a USB" |
203 |
elog "stick, just run the following and specify the directory as prompted:" |
204 |
elog " emerge --config =${PF}" |
205 |
elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" |
206 |
elog "grub where to install in a non-interactive way." |
207 |
|
208 |
} |
209 |
|
210 |
pkg_config() { |
211 |
local dir |
212 |
if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then |
213 |
einfo "Enter the directory where you want to setup grub:" |
214 |
read dir |
215 |
else |
216 |
dir="${GRUB_ALT_INSTALLDIR}" |
217 |
fi |
218 |
setup_boot_dir "${dir}" |
219 |
} |