1 |
commit: 06bfeebcd9e444ee5383fbb69cf48af8c90031f0 |
2 |
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Oct 10 13:40:19 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 20 07:45:13 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06bfeebc |
7 |
|
8 |
sys-apps/kexec-tools: remove unused files. |
9 |
|
10 |
sys-apps/kexec-tools/files/kexec.init-2.0.12 | 174 ------------------------- |
11 |
sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 | 164 ----------------------- |
12 |
2 files changed, 338 deletions(-) |
13 |
|
14 |
diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.12 b/sys-apps/kexec-tools/files/kexec.init-2.0.12 |
15 |
deleted file mode 100644 |
16 |
index a7bd859f082..00000000000 |
17 |
--- a/sys-apps/kexec-tools/files/kexec.init-2.0.12 |
18 |
+++ /dev/null |
19 |
@@ -1,174 +0,0 @@ |
20 |
-#!/sbin/openrc-run |
21 |
-# Copyright 1999-2017 Gentoo Foundation |
22 |
-# Distributed under the terms of the GNU General Public License v2 |
23 |
- |
24 |
-# Set up some defaults. |
25 |
-: "${LOAD_DURING_SHUTDOWN:=yes}" |
26 |
-: "${BOOTPART:=/boot}" |
27 |
-: "${DONT_MOUNT_BOOT:=no}" |
28 |
- |
29 |
-depend() { |
30 |
- need localmount |
31 |
-} |
32 |
- |
33 |
-auto_prefix_bootpath() { |
34 |
- # Only auto-add prefix to relative paths. |
35 |
- case $1 in |
36 |
- */*) echo "$1";; |
37 |
- *) echo "${BOOTPART}/$1" ;; |
38 |
- esac |
39 |
-} |
40 |
- |
41 |
-image_path() { |
42 |
- # Do no sanity checking if the user has set a value. |
43 |
- if [ -n "${KNAME}" ]; then |
44 |
- auto_prefix_bootpath "${KNAME}" |
45 |
- return |
46 |
- fi |
47 |
- |
48 |
- local x kver="$(uname -r)" karch="$(uname -m)" |
49 |
- for x in \ |
50 |
- "bzImage" \ |
51 |
- "vmlinuz" \ |
52 |
- "bzImage-${kver}" \ |
53 |
- "vmlinuz-${kver}" \ |
54 |
- "kernel-genkernel-${karch}-${kver}" \ |
55 |
- "kernel-${kver}" \ |
56 |
- "kernel-${karch}"; do |
57 |
- if [ -e "${BOOTPART}/${x}" ]; then |
58 |
- echo "${BOOTPART}/${x}" |
59 |
- return |
60 |
- fi |
61 |
- done |
62 |
- |
63 |
- return 1 |
64 |
-} |
65 |
- |
66 |
-initrd_path() { |
67 |
- # Do no sanity checking if the user has set a value. |
68 |
- if [ -n "${INITRD}" ]; then |
69 |
- auto_prefix_bootpath "${INITRD}" |
70 |
- return 0 |
71 |
- fi |
72 |
- |
73 |
- local x kver="$(uname -r)" karch="$(uname -m)" |
74 |
- for x in \ |
75 |
- "initrd" \ |
76 |
- "initrd.img-${kver}" \ |
77 |
- "initrd-${kver}.img" \ |
78 |
- "initrd-${kver}" \ |
79 |
- "initramfs-${kver}.img" \ |
80 |
- "initramfs-genkernel-${karch}-${kver}"; do |
81 |
- if [ -e "${BOOTPART}/${x}" ]; then |
82 |
- echo "${BOOTPART}/${x}" |
83 |
- return 0 |
84 |
- fi |
85 |
- done |
86 |
- |
87 |
- return 1 |
88 |
-} |
89 |
- |
90 |
-mount_boot() { |
91 |
- [ "${DONT_MOUNT_BOOT}" != "no" ] && return 1 |
92 |
- mountinfo -q "${BOOTPART}" && return 1 |
93 |
- |
94 |
- ebegin "Mounting ${BOOTPART}" |
95 |
- mount "${BOOTPART}" |
96 |
- eend $? |
97 |
-} |
98 |
- |
99 |
-load_image() { |
100 |
- if [ "${KNAME}" = "-" ]; then |
101 |
- ebegin "Disabling kexec" |
102 |
- kexec -u |
103 |
- eend $? |
104 |
- return # eend preserved $? for us. |
105 |
- fi |
106 |
- |
107 |
- local img initrd="$(initrd_path)" mounted=false kparamopt initrdopt |
108 |
- |
109 |
- if ! img="$(image_path)"; then |
110 |
- if mount_boot; then |
111 |
- if img="$(image_path)"; then |
112 |
- mounted=true |
113 |
- initrd="$(initrd_path)" |
114 |
- else |
115 |
- eerror "No kernel image found in ${BOOTPART}!" |
116 |
- umount "${BOOTPART}" |
117 |
- return 1 |
118 |
- fi |
119 |
- else |
120 |
- eerror "No kernel image found in ${BOOTPART}!" |
121 |
- return 1 |
122 |
- fi |
123 |
- fi |
124 |
- |
125 |
- if [ -z "${ROOTPART}" ]; then |
126 |
- ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")" |
127 |
- fi |
128 |
- |
129 |
- if [ -z "${KPARAM}" ]; then |
130 |
- kparamopt="--reuse-cmdline" |
131 |
- fi |
132 |
- |
133 |
- if [ -n "${initrd}" ]; then |
134 |
- initrdopt="--initrd=${initrd}" |
135 |
- fi |
136 |
- |
137 |
- local msg |
138 |
- [ -n "${initrd}" ] && \ |
139 |
- msg=" (with ${initrd})" |
140 |
- ebegin "Using kernel image ${img}${msg} for kexec" |
141 |
- |
142 |
- kexec ${KEXEC_OPT_ARGS} ${kparamopt} \ |
143 |
- -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} |
144 |
- local ret=$? |
145 |
- |
146 |
- ${mounted} && umount "${BOOTPART}" |
147 |
- eend ${ret} |
148 |
- return ${ret} |
149 |
-} |
150 |
- |
151 |
-start() { |
152 |
- if [ "${LOAD_DURING_SHUTDOWN}" = "yes" ]; then |
153 |
- local mounted |
154 |
- if mount_boot; then |
155 |
- mounted=true |
156 |
- fi |
157 |
- if ! image_path >/dev/null; then |
158 |
- ewarn "Cannot find kernel image!" |
159 |
- ewarn "Please make sure a valid kernel image is present before reboot." |
160 |
- return 0 |
161 |
- fi |
162 |
- if [ -n "${mounted}" ]; then |
163 |
- ebegin "Unmounting ${BOOTPART}" |
164 |
- umount "${BOOTPART}" |
165 |
- eend $? |
166 |
- fi |
167 |
- # $? is already set to the previous calls. |
168 |
- return |
169 |
- else |
170 |
- load_image |
171 |
- fi |
172 |
-} |
173 |
- |
174 |
-stop() { |
175 |
- if ! yesno ${RC_REBOOT}; then |
176 |
- ebegin "Not rebooting; disabling kexec" |
177 |
- kexec -u |
178 |
- eend $? |
179 |
- return |
180 |
- fi |
181 |
- |
182 |
- if [ -f /nokexec ]; then |
183 |
- ebegin "Rebooting; disabling kexec due to /nokexec" |
184 |
- rm -f /nokexec |
185 |
- kexec -u |
186 |
- eend $? |
187 |
- return |
188 |
- fi |
189 |
- |
190 |
- if [ "${LOAD_DURING_SHUTDOWN}" = "yes" ]; then |
191 |
- load_image |
192 |
- fi |
193 |
-} |
194 |
|
195 |
diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 |
196 |
deleted file mode 100644 |
197 |
index 6eb2a748c9e..00000000000 |
198 |
--- a/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 |
199 |
+++ /dev/null |
200 |
@@ -1,164 +0,0 @@ |
201 |
-#!/sbin/openrc-run |
202 |
-# Copyright 1999-2015 Gentoo Foundation |
203 |
-# Distributed under the terms of the GNU General Public License v2 |
204 |
- |
205 |
-depend() { |
206 |
- need localmount |
207 |
-} |
208 |
- |
209 |
-image_path() { |
210 |
- local x= kver=$(uname -r) karch=$(uname -m) |
211 |
- BOOTPART="${BOOTPART:-/boot}" |
212 |
- KNAME="${KNAME:-bzImage}" |
213 |
- if [ -e "${KNAME}" ]; then |
214 |
- echo "${KNAME}" |
215 |
- return 0 |
216 |
- fi |
217 |
- for x in "${KNAME#${BOOTPART}}" vmlinuz \ |
218 |
- bzImage-${kver} vmlinuz-${kver} \ |
219 |
- kernel-genkernel-${karch}-${kver} \ |
220 |
- kernel-${kver} kernel-${karch}; do |
221 |
- if [ -e "${BOOTPART}/${x}" ]; then |
222 |
- echo "${BOOTPART}/${x}" |
223 |
- return 0 |
224 |
- fi |
225 |
- done |
226 |
- |
227 |
- return 1 |
228 |
-} |
229 |
- |
230 |
-initrd_path() { |
231 |
- local x= kver=$(uname -r) karch=$(uname -m) |
232 |
- BOOTPART="${BOOTPART:-/boot}" |
233 |
- INITRD="${INITRD:-initrd}" |
234 |
- if [ -e "${INITRD}" ]; then |
235 |
- echo "${INITRD}" |
236 |
- return 0 |
237 |
- fi |
238 |
- for x in "${INITRD#${BOOTPART}}" \ |
239 |
- initrd.img-${kver} initrd-${kver}.img \ |
240 |
- initrd-${kver} initramfs-${kver}.img \ |
241 |
- initramfs-genkernel-${karch}-${kver} ; do |
242 |
- if [ -e "${BOOTPART}/${x}" ]; then |
243 |
- echo "${BOOTPART}/${x}" |
244 |
- return 0 |
245 |
- fi |
246 |
- done |
247 |
- |
248 |
- return 1 |
249 |
-} |
250 |
- |
251 |
-mount_boot(){ |
252 |
- local ret |
253 |
- |
254 |
- [ "${DONT_MOUNT_BOOT:-no}" = "no" ] || return 1 |
255 |
- grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1 |
256 |
- |
257 |
- BOOTPART="${BOOTPART:-/boot}" |
258 |
- ebegin "Mounting ${BOOTPART}" |
259 |
- mount "${BOOTPART}"; ret=$? |
260 |
- eend ${ret} |
261 |
- return ${ret} |
262 |
-} |
263 |
- |
264 |
-load_image() { |
265 |
- local ret |
266 |
- if [ "${KNAME}" = "-" ]; then |
267 |
- ebegin "Disabling kexec" |
268 |
- kexec -u; ret=$? |
269 |
- eend ${ret} |
270 |
- return ${ret} |
271 |
- fi |
272 |
- |
273 |
- BOOTPART="${BOOTPART:-/boot}" |
274 |
- local img= initrd="$(initrd_path)" mounted=false initrdopt= |
275 |
- |
276 |
- if ! img="$(image_path)"; then |
277 |
- if mount_boot; then |
278 |
- if img="$(image_path)"; then |
279 |
- mounted=true |
280 |
- initrd="$(initrd_path)" |
281 |
- else |
282 |
- eerror "No kernel image found in ${BOOTPART}!" |
283 |
- umount "${BOOTPART}" |
284 |
- return 1 |
285 |
- fi |
286 |
- else |
287 |
- eerror "No kernel image found in ${BOOTPART}!" |
288 |
- return 1 |
289 |
- fi |
290 |
- fi |
291 |
- |
292 |
- if [ -n "${INITRD}" ] && \ |
293 |
- ! [ "${BOOTPART}/${INITRD#${BOOTPART}}" = "${initrd}" ]; then |
294 |
- eerror "Requested initrd: ${INITRD#${BOOTPART}}" |
295 |
- eerror "could not be found" |
296 |
- return 1 |
297 |
- fi |
298 |
- |
299 |
- [ -n "${ROOTPART}" ] || \ |
300 |
- ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")" |
301 |
- |
302 |
- [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline" |
303 |
- |
304 |
- [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}" |
305 |
- |
306 |
- local msg= |
307 |
- [ -n "${initrd}" ] && \ |
308 |
- msg="with ${initrd}" |
309 |
- einfo "Using kernel image ${img} ${msg} for kexec" |
310 |
- |
311 |
- ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}" |
312 |
- kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} |
313 |
- local res=$? |
314 |
- |
315 |
- ${mounted} && umount "${BOOTPART}" |
316 |
- eend ${res} |
317 |
- return ${res} |
318 |
-} |
319 |
- |
320 |
-start() { |
321 |
- if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then |
322 |
- local ret=0 |
323 |
- BOOTPART="${BOOTPART:-/boot}" |
324 |
- if mount_boot; then |
325 |
- mounted=true |
326 |
- fi |
327 |
- if ! image_path > /dev/null; then |
328 |
- ewarn "Cannot find kernel image!" |
329 |
- ewarn "Please make sure a valid kernel image is present before reboot." |
330 |
- return 0 |
331 |
- fi |
332 |
- if [ -n "${mounted}" ]; then |
333 |
- ebegin "Unmounting ${BOOTPART}" |
334 |
- umount "${BOOTPART}"; ret=$? |
335 |
- eend ${ret} |
336 |
- fi |
337 |
- return ${ret} |
338 |
- else |
339 |
- ebegin "Configuring kexec" |
340 |
- load_image |
341 |
- eend $? |
342 |
- fi |
343 |
-} |
344 |
- |
345 |
-stop() { |
346 |
- if ! yesno $RC_REBOOT; then |
347 |
- einfo "Not rebooting, so disabling" |
348 |
- kexec -u |
349 |
- return 0 |
350 |
- fi |
351 |
- |
352 |
- if [ -f /nokexec ]; then |
353 |
- einfo "Not using kexec during reboot" |
354 |
- rm -f /nokexec |
355 |
- kexec -u |
356 |
- return 0 |
357 |
- fi |
358 |
- |
359 |
- [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 |
360 |
- |
361 |
- ebegin "Configuring kexec" |
362 |
- load_image |
363 |
- eend $? |
364 |
-} |