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