1 |
aidecoe 12/07/31 16:52:23 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: dracut-022-r3.ebuild dracut-019-r4.ebuild |
5 |
Removed: dracut-022-r2.ebuild dracut-019-r3.ebuild |
6 |
Log: |
7 |
Fixes bug #428142 in 019 and 022. |
8 |
|
9 |
(Portage version: 2.1.11.9/cvs/Linux x86_64) |
10 |
|
11 |
Revision Changes Path |
12 |
1.78 sys-kernel/dracut/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?rev=1.78&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?rev=1.78&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?r1=1.77&r2=1.78 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v |
21 |
retrieving revision 1.77 |
22 |
retrieving revision 1.78 |
23 |
diff -u -r1.77 -r1.78 |
24 |
--- ChangeLog 31 Jul 2012 09:30:46 -0000 1.77 |
25 |
+++ ChangeLog 31 Jul 2012 16:52:23 -0000 1.78 |
26 |
@@ -1,6 +1,24 @@ |
27 |
# ChangeLog for sys-kernel/dracut |
28 |
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.77 2012/07/31 09:30:46 aidecoe Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.78 2012/07/31 16:52:23 aidecoe Exp $ |
31 |
+ |
32 |
+*dracut-022-r3 (31 Jul 2012) |
33 |
+*dracut-019-r4 (31 Jul 2012) |
34 |
+ |
35 |
+ 31 Jul 2012; Amadeusz Żołnowski <aidecoe@g.o> |
36 |
+ +files/019-0001-90multipath-added-kpartx.rules-multipa.patch, |
37 |
+ -files/019-0001-multipath-udev-rules.patch, |
38 |
+ +files/019-0002-Avoid-annonying-warnings-when-pkg-conf.patch, |
39 |
+ -files/019-0002-no-pkg-config-warnings.patch, |
40 |
+ +files/019-0003-99shutdown-remove-no-wall-argument-for.patch, |
41 |
+ +files/019-0004-dracut.sh-do-not-copy-var-run-and-var-.patch, |
42 |
+ +files/019-0005-dracut.sh-create-relative-symlinks-for.patch, |
43 |
+ -files/019-0017-99shutdown-remove-no-wall-argument-for.patch, |
44 |
+ +files/022-0018-dracut.sh-do-not-copy-var-run-and-var-.patch, |
45 |
+ -dracut-019-r3.ebuild, +dracut-019-r4.ebuild, |
46 |
+ +files/022-0019-dracut.sh-create-relative-symlinks-for.patch, |
47 |
+ -dracut-022-r2.ebuild, +dracut-022-r3.ebuild: |
48 |
+ Fixes bug #428142 in 019 and 022. |
49 |
|
50 |
*dracut-022-r2 (31 Jul 2012) |
51 |
*dracut-019-r3 (31 Jul 2012) |
52 |
|
53 |
|
54 |
|
55 |
1.1 sys-kernel/dracut/dracut-022-r3.ebuild |
56 |
|
57 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-022-r3.ebuild?rev=1.1&view=markup |
58 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-022-r3.ebuild?rev=1.1&content-type=text/plain |
59 |
|
60 |
Index: dracut-022-r3.ebuild |
61 |
=================================================================== |
62 |
# Copyright 1999-2012 Gentoo Foundation |
63 |
# Distributed under the terms of the GNU General Public License v2 |
64 |
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-022-r3.ebuild,v 1.1 2012/07/31 16:52:23 aidecoe Exp $ |
65 |
|
66 |
EAPI=4 |
67 |
|
68 |
inherit eutils linux-info toolchain-funcs |
69 |
|
70 |
add_req_use_for() { |
71 |
local dep="$1"; shift |
72 |
local f |
73 |
|
74 |
for f in "$@"; do |
75 |
REQUIRED_USE+="${f}? ( ${dep} ) |
76 |
" |
77 |
done |
78 |
} |
79 |
|
80 |
DESCRIPTION="Generic initramfs generation tool" |
81 |
HOMEPAGE="http://dracut.wiki.kernel.org" |
82 |
SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.bz2" |
83 |
LICENSE="GPL-2" |
84 |
SLOT="0" |
85 |
KEYWORDS="~amd64 ~x86" |
86 |
|
87 |
REQUIRED_USE="dracut_modules_crypt-gpg? ( dracut_modules_crypt ) |
88 |
dracut_modules_livenet? ( dracut_modules_dmsquash-live ) |
89 |
" |
90 |
COMMON_MODULES=" |
91 |
dracut_modules_biosdevname |
92 |
dracut_modules_bootchart |
93 |
dracut_modules_btrfs |
94 |
dracut_modules_caps |
95 |
dracut_modules_crypt-gpg |
96 |
dracut_modules_gensplash |
97 |
dracut_modules_mdraid |
98 |
dracut_modules_multipath |
99 |
dracut_modules_plymouth |
100 |
dracut_modules_syslog |
101 |
" |
102 |
DM_MODULES=" |
103 |
dracut_modules_crypt |
104 |
dracut_modules_dmraid |
105 |
dracut_modules_dmsquash-live |
106 |
dracut_modules_livenet |
107 |
dracut_modules_lvm |
108 |
" |
109 |
NETWORK_MODULES=" |
110 |
dracut_modules_iscsi |
111 |
dracut_modules_livenet |
112 |
dracut_modules_nbd |
113 |
dracut_modules_nfs |
114 |
dracut_modules_ssh-client |
115 |
" |
116 |
add_req_use_for device-mapper ${DM_MODULES} |
117 |
add_req_use_for net ${NETWORK_MODULES} |
118 |
IUSE_DRACUT_MODULES="${COMMON_MODULES} ${DM_MODULES} ${NETWORK_MODULES}" |
119 |
IUSE="debug device-mapper optimization net selinux ${IUSE_DRACUT_MODULES}" |
120 |
|
121 |
RESTRICT="test" |
122 |
|
123 |
RDEPEND=" |
124 |
app-arch/cpio |
125 |
>=app-shells/bash-4.0 |
126 |
>=app-shells/dash-0.5.4.11 |
127 |
>=sys-apps/baselayout-1.12.14-r1 |
128 |
|| ( >=sys-apps/module-init-tools-3.8 >sys-apps/kmod-5[tools] ) |
129 |
>=sys-apps/sysvinit-2.87-r3 |
130 |
>=sys-apps/util-linux-2.20 |
131 |
>=sys-fs/udev-166 |
132 |
|
133 |
debug? ( dev-util/strace ) |
134 |
device-mapper? ( || ( sys-fs/device-mapper >=sys-fs/lvm2-2.02.33 ) ) |
135 |
net? ( net-misc/curl >=net-misc/dhcp-4.2.1-r1 sys-apps/iproute2 ) |
136 |
selinux? ( sys-libs/libselinux sys-libs/libsepol ) |
137 |
dracut_modules_biosdevname? ( sys-apps/biosdevname ) |
138 |
dracut_modules_bootchart? ( app-benchmarks/bootchart2 ) |
139 |
dracut_modules_btrfs? ( sys-fs/btrfs-progs ) |
140 |
dracut_modules_caps? ( sys-libs/libcap ) |
141 |
dracut_modules_crypt? ( sys-fs/cryptsetup ) |
142 |
dracut_modules_crypt-gpg? ( app-crypt/gnupg ) |
143 |
dracut_modules_dmraid? ( sys-fs/dmraid sys-fs/multipath-tools ) |
144 |
dracut_modules_gensplash? ( media-gfx/splashutils ) |
145 |
dracut_modules_iscsi? ( >=sys-block/open-iscsi-2.0.871.3 ) |
146 |
dracut_modules_lvm? ( >=sys-fs/lvm2-2.02.33 ) |
147 |
dracut_modules_mdraid? ( sys-fs/mdadm ) |
148 |
dracut_modules_multipath? ( sys-fs/multipath-tools ) |
149 |
dracut_modules_nbd? ( sys-block/nbd ) |
150 |
dracut_modules_nfs? ( net-fs/nfs-utils net-nds/rpcbind ) |
151 |
dracut_modules_plymouth? ( >=sys-boot/plymouth-0.8.3-r1 ) |
152 |
dracut_modules_ssh-client? ( dev-libs/openssl ) |
153 |
dracut_modules_syslog? ( || ( app-admin/syslog-ng app-admin/rsyslog ) ) |
154 |
" |
155 |
DEPEND=" |
156 |
app-text/asciidoc |
157 |
>=dev-libs/libxslt-1.1.26 |
158 |
app-text/docbook-xml-dtd:4.5 |
159 |
>=app-text/docbook-xsl-stylesheets-1.75.2 |
160 |
" |
161 |
|
162 |
# |
163 |
# Helper functions |
164 |
# |
165 |
|
166 |
# Returns true if any of specified modules is enabled by USE flag and false |
167 |
# otherwise. |
168 |
# $1 = list of modules (which have corresponding USE flags of the same name) |
169 |
any_module() { |
170 |
local m modules=" $@ " |
171 |
|
172 |
for m in ${modules}; do |
173 |
! use $m && modules=${modules/ $m / } |
174 |
done |
175 |
|
176 |
shopt -s extglob |
177 |
modules=${modules%%+( )} |
178 |
shopt -u extglob |
179 |
|
180 |
[[ ${modules} ]] |
181 |
} |
182 |
|
183 |
# Removes module from modules.d. |
184 |
# $1 = module name |
185 |
# Module name can be specified without number prefix. |
186 |
rm_module() { |
187 |
local force m |
188 |
[[ $1 = -f ]] && force=-f |
189 |
|
190 |
for m in $@; do |
191 |
if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then |
192 |
rm ${force} --interactive=never -r "${modules_dir}"/$m |
193 |
else |
194 |
rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m |
195 |
fi |
196 |
done |
197 |
} |
198 |
|
199 |
# |
200 |
# ebuild functions |
201 |
# |
202 |
|
203 |
src_prepare() { |
204 |
epatch "${FILESDIR}/${PV}-0001-qemu-module-setup.sh-provide-alternati.patch" |
205 |
epatch "${FILESDIR}/${PV}-0002-Makefile-use-implicit-rules-for-instal.patch" |
206 |
epatch "${FILESDIR}/${PV}-0003-kernel-modules-module-setup.sh-just-op.patch" |
207 |
epatch "${FILESDIR}/${PV}-0004-90multipath-added-kpartx.rules-multipa.patch" |
208 |
epatch "${FILESDIR}/${PV}-0005-gentoo.conf-set-udevdir.patch" |
209 |
epatch "${FILESDIR}/${PV}-0006-Config-file-for-systemd-on-Gentoo.patch" |
210 |
epatch "${FILESDIR}/${PV}-0007-Remove-obsolete-gentoo-conf-file.patch" |
211 |
epatch "${FILESDIR}/${PV}-0008-95rootfs-block-fix-left-fsck-rel.-chec.patch" |
212 |
epatch "${FILESDIR}/${PV}-0009-98usrmount-use-rw-and-ro-options-inste.patch" |
213 |
epatch "${FILESDIR}/${PV}-0010-98usrmount-print-mount-options.patch" |
214 |
epatch "${FILESDIR}/${PV}-0011-dracut-lib-new-functions-listlist-and-.patch" |
215 |
epatch "${FILESDIR}/${PV}-0012-apply-ro-and-rw-options-from-cmdline-t.patch" |
216 |
epatch "${FILESDIR}/${PV}-0013-ro_mnt-option-at-build-time-to-force-r.patch" |
217 |
epatch "${FILESDIR}/${PV}-0014-parse-root-opts-first-check-for-ro-lat.patch" |
218 |
epatch "${FILESDIR}/${PV}-0015-gentoo.conf-enable-ro_mnt.patch" |
219 |
epatch "${FILESDIR}/${PV}-0016-dracut.sh-test-if-we-can-lazy-resolve-.patch" |
220 |
epatch "${FILESDIR}/${PV}-0017-99shutdown-remove-no-wall-argument-for.patch" |
221 |
epatch "${FILESDIR}/${PV}-0018-dracut.sh-do-not-copy-var-run-and-var-.patch" |
222 |
epatch "${FILESDIR}/${PV}-0019-dracut.sh-create-relative-symlinks-for.patch" |
223 |
einfo "Removing ${S}/install/hashmap.o ..." |
224 |
rm "${S}/install/hashmap.o" || die |
225 |
} |
226 |
|
227 |
src_compile() { |
228 |
if use optimization; then |
229 |
ewarn "Enabling experimental optimization!" |
230 |
tc-export CC |
231 |
emake prefix=/usr sysconfdir=/etc DESTDIR="${D}" doc \ |
232 |
install/dracut-install |
233 |
fi |
234 |
} |
235 |
|
236 |
src_install() { |
237 |
emake prefix=/usr libdir="/usr/$(get_libdir)" sysconfdir=/etc \ |
238 |
DESTDIR="${D}" install |
239 |
|
240 |
dodir /var/lib/dracut/overlay |
241 |
dodoc HACKING TODO AUTHORS NEWS README* |
242 |
|
243 |
insinto /etc/dracut.conf.d |
244 |
newins dracut.conf.d/gentoo.conf.example gentoo.conf |
245 |
|
246 |
insinto /etc/logrotate.d |
247 |
newins dracut.logrotate dracut |
248 |
|
249 |
dohtml dracut.html |
250 |
|
251 |
# |
252 |
# Modules |
253 |
# |
254 |
local module |
255 |
modules_dir="${D}/usr/$(get_libdir)/dracut/modules.d" |
256 |
|
257 |
# Remove modules not enabled by USE flags |
258 |
for module in ${IUSE_DRACUT_MODULES} ; do |
259 |
! use ${module} && rm_module -f ${module#dracut_modules_} |
260 |
done |
261 |
|
262 |
# Those flags are specific, and even are corresponding to modules, they need |
263 |
# to be declared as regular USE flags. |
264 |
use debug || rm_module 95debug |
265 |
use selinux || rm_module 98selinux |
266 |
|
267 |
# Following flags define set of helper modules which are base dependencies |
268 |
# for others and as so have no practical use, so remove these modules. |
269 |
use device-mapper || rm_module 90dm |
270 |
use net || rm_module 40network 45ifcfg 45url-lib |
271 |
|
272 |
# Remove S/390 modules which are not tested at all |
273 |
rm_module 80cms 95dasd 95dasd_mod 95zfcp 95znet |
274 |
|
275 |
# Remove modules which won't work for sure |
276 |
rm_module 95fcoe # no tools |
277 |
# fips module depends on masked app-crypt/hmaccalc |
278 |
rm_module 01fips 02fips-aesni |
279 |
|
280 |
# Remove extra modules which go to future dracut-extras |
281 |
rm_module 05busybox 97masterkey 98ecryptfs 98integrity 98systemd |
282 |
} |
283 |
|
284 |
pkg_postinst() { |
285 |
if linux-info_get_any_version && linux_config_src_exists; then |
286 |
ewarn "" |
287 |
ewarn "If the following test report contains a missing kernel" |
288 |
ewarn "configuration option, you should reconfigure and rebuild your" |
289 |
ewarn "kernel before booting image generated with this Dracut version." |
290 |
ewarn "" |
291 |
|
292 |
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS ~MODULES" |
293 |
|
294 |
# Kernel configuration options descriptions: |
295 |
local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev" |
296 |
local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\ |
297 |
"(initramfs/initrd) support" |
298 |
local desc_MODULES="Enable loadable module support" |
299 |
|
300 |
local opt desc |
301 |
|
302 |
# Generate ERROR_* variables for check_extra_config. |
303 |
for opt in ${CONFIG_CHECK}; do |
304 |
opt=${opt#\~} |
305 |
desc=desc_${opt} |
306 |
eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \ |
307 |
"is missing and REQUIRED'" |
308 |
done |
309 |
|
310 |
check_extra_config |
311 |
echo |
312 |
else |
313 |
ewarn "" |
314 |
ewarn "Your kernel configuration couldn't be checked. Do you have" |
315 |
ewarn "/usr/src/linux/.config file there? Please check manually if" |
316 |
ewarn "following options are enabled:" |
317 |
ewarn "" |
318 |
ewarn " CONFIG_BLK_DEV_INITRD" |
319 |
ewarn " CONFIG_DEVTMPFS" |
320 |
ewarn " CONFIG_MODULES" |
321 |
ewarn "" |
322 |
fi |
323 |
|
324 |
if has_version virtual/pkgconfig; then |
325 |
elog "" |
326 |
elog "virtual/pkgconfig is no longer needed by dracut." |
327 |
elog "" |
328 |
fi |
329 |
} |
330 |
|
331 |
|
332 |
|
333 |
1.1 sys-kernel/dracut/dracut-019-r4.ebuild |
334 |
|
335 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-019-r4.ebuild?rev=1.1&view=markup |
336 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-019-r4.ebuild?rev=1.1&content-type=text/plain |
337 |
|
338 |
Index: dracut-019-r4.ebuild |
339 |
=================================================================== |
340 |
# Copyright 1999-2012 Gentoo Foundation |
341 |
# Distributed under the terms of the GNU General Public License v2 |
342 |
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-019-r4.ebuild,v 1.1 2012/07/31 16:52:23 aidecoe Exp $ |
343 |
|
344 |
EAPI=4 |
345 |
|
346 |
inherit eutils linux-info |
347 |
|
348 |
add_req_use_for() { |
349 |
local dep="$1"; shift |
350 |
local f |
351 |
|
352 |
for f in "$@"; do |
353 |
REQUIRED_USE+="${f}? ( ${dep} ) |
354 |
" |
355 |
done |
356 |
} |
357 |
|
358 |
DESCRIPTION="Generic initramfs generation tool" |
359 |
HOMEPAGE="http://dracut.wiki.kernel.org" |
360 |
SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.bz2" |
361 |
LICENSE="GPL-2" |
362 |
SLOT="0" |
363 |
KEYWORDS="~amd64 ~x86" |
364 |
|
365 |
REQUIRED_USE="dracut_modules_crypt-gpg? ( dracut_modules_crypt ) |
366 |
dracut_modules_livenet? ( dracut_modules_dmsquash-live ) |
367 |
" |
368 |
COMMON_MODULES=" |
369 |
dracut_modules_biosdevname |
370 |
dracut_modules_bootchart |
371 |
dracut_modules_btrfs |
372 |
dracut_modules_caps |
373 |
dracut_modules_crypt-gpg |
374 |
dracut_modules_gensplash |
375 |
dracut_modules_mdraid |
376 |
dracut_modules_multipath |
377 |
dracut_modules_plymouth |
378 |
dracut_modules_syslog |
379 |
" |
380 |
DM_MODULES=" |
381 |
dracut_modules_crypt |
382 |
dracut_modules_dmraid |
383 |
dracut_modules_dmsquash-live |
384 |
dracut_modules_livenet |
385 |
dracut_modules_lvm |
386 |
" |
387 |
NETWORK_MODULES=" |
388 |
dracut_modules_iscsi |
389 |
dracut_modules_livenet |
390 |
dracut_modules_nbd |
391 |
dracut_modules_nfs |
392 |
dracut_modules_ssh-client |
393 |
" |
394 |
add_req_use_for device-mapper ${DM_MODULES} |
395 |
add_req_use_for net ${NETWORK_MODULES} |
396 |
IUSE_DRACUT_MODULES="${COMMON_MODULES} ${DM_MODULES} ${NETWORK_MODULES}" |
397 |
IUSE="debug device-mapper net selinux ${IUSE_DRACUT_MODULES}" |
398 |
|
399 |
RESTRICT="test" |
400 |
|
401 |
RDEPEND=" |
402 |
app-arch/cpio |
403 |
>=app-shells/bash-4.0 |
404 |
>=app-shells/dash-0.5.4.11 |
405 |
>=sys-apps/baselayout-1.12.14-r1 |
406 |
|| ( >=sys-apps/module-init-tools-3.8 >sys-apps/kmod-5[tools] ) |
407 |
>=sys-apps/sysvinit-2.87-r3 |
408 |
>=sys-apps/util-linux-2.20 |
409 |
>=sys-fs/udev-166 |
410 |
|
411 |
debug? ( dev-util/strace ) |
412 |
device-mapper? ( || ( sys-fs/device-mapper >=sys-fs/lvm2-2.02.33 ) ) |
413 |
net? ( net-misc/curl >=net-misc/dhcp-4.2.1-r1 sys-apps/iproute2 ) |
414 |
selinux? ( sys-libs/libselinux sys-libs/libsepol ) |
415 |
dracut_modules_biosdevname? ( sys-apps/biosdevname ) |
416 |
dracut_modules_bootchart? ( app-benchmarks/bootchart2 ) |
417 |
dracut_modules_btrfs? ( sys-fs/btrfs-progs ) |
418 |
dracut_modules_caps? ( sys-libs/libcap ) |
419 |
dracut_modules_crypt? ( sys-fs/cryptsetup ) |
420 |
dracut_modules_crypt-gpg? ( app-crypt/gnupg ) |
421 |
dracut_modules_dmraid? ( sys-fs/dmraid sys-fs/multipath-tools ) |
422 |
dracut_modules_gensplash? ( media-gfx/splashutils ) |
423 |
dracut_modules_iscsi? ( >=sys-block/open-iscsi-2.0.871.3 ) |
424 |
dracut_modules_lvm? ( >=sys-fs/lvm2-2.02.33 ) |
425 |
dracut_modules_mdraid? ( sys-fs/mdadm ) |
426 |
dracut_modules_multipath? ( sys-fs/multipath-tools ) |
427 |
dracut_modules_nbd? ( sys-block/nbd ) |
428 |
dracut_modules_nfs? ( net-fs/nfs-utils net-nds/rpcbind ) |
429 |
dracut_modules_plymouth? ( >=sys-boot/plymouth-0.8.3-r1 ) |
430 |
dracut_modules_ssh-client? ( dev-libs/openssl ) |
431 |
dracut_modules_syslog? ( || ( app-admin/syslog-ng app-admin/rsyslog ) ) |
432 |
" |
433 |
DEPEND="" |
434 |
|
435 |
# |
436 |
# Helper functions |
437 |
# |
438 |
|
439 |
# Returns true if any of specified modules is enabled by USE flag and false |
440 |
# otherwise. |
441 |
# $1 = list of modules (which have corresponding USE flags of the same name) |
442 |
any_module() { |
443 |
local m modules=" $@ " |
444 |
|
445 |
for m in ${modules}; do |
446 |
! use $m && modules=${modules/ $m / } |
447 |
done |
448 |
|
449 |
shopt -s extglob |
450 |
modules=${modules%%+( )} |
451 |
shopt -u extglob |
452 |
|
453 |
[[ ${modules} ]] |
454 |
} |
455 |
|
456 |
# Removes module from modules.d. |
457 |
# $1 = module name |
458 |
# Module name can be specified without number prefix. |
459 |
rm_module() { |
460 |
local force m |
461 |
[[ $1 = -f ]] && force=-f |
462 |
|
463 |
for m in $@; do |
464 |
if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then |
465 |
rm ${force} --interactive=never -r "${modules_dir}"/$m |
466 |
else |
467 |
rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m |
468 |
fi |
469 |
done |
470 |
} |
471 |
|
472 |
# Displays Gentoo Base System major release number |
473 |
base_sys_maj_ver() { |
474 |
local line |
475 |
|
476 |
read line < /etc/gentoo-release |
477 |
line=${line##* } |
478 |
echo "${line%%.*}" |
479 |
} |
480 |
|
481 |
# |
482 |
# ebuild functions |
483 |
# |
484 |
|
485 |
src_prepare() { |
486 |
epatch "${FILESDIR}/${PV}-0001-90multipath-added-kpartx.rules-multipa.patch" |
487 |
epatch "${FILESDIR}/${PV}-0002-Avoid-annonying-warnings-when-pkg-conf.patch" |
488 |
epatch "${FILESDIR}/${PV}-0003-99shutdown-remove-no-wall-argument-for.patch" |
489 |
epatch "${FILESDIR}/${PV}-0004-dracut.sh-do-not-copy-var-run-and-var-.patch" |
490 |
epatch "${FILESDIR}/${PV}-0005-dracut.sh-create-relative-symlinks-for.patch" |
491 |
} |
492 |
|
493 |
src_compile() { |
494 |
return |
495 |
} |
496 |
|
497 |
src_install() { |
498 |
emake prefix=/usr libdir="/usr/$(get_libdir)" sysconfdir=/etc \ |
499 |
DESTDIR="${D}" install |
500 |
|
501 |
local gen2conf |
502 |
|
503 |
dodir /var/lib/dracut/overlay |
504 |
dodoc HACKING TODO AUTHORS NEWS README* |
505 |
|
506 |
case "$(base_sys_maj_ver)" in |
507 |
1) gen2conf=gentoo.conf ;; |
508 |
2) gen2conf=gentoo-openrc.conf ;; |
509 |
*) die "Expected ver. 1 or 2 of Gentoo Base System (/etc/gentoo-release)." |
510 |
esac |
511 |
|
512 |
insinto /etc/dracut.conf.d |
513 |
newins dracut.conf.d/${gen2conf}.example ${gen2conf} |
514 |
|
515 |
insinto /etc/logrotate.d |
516 |
newins dracut.logrotate dracut |
517 |
|
518 |
dohtml dracut.html |
519 |
|
520 |
# |
521 |
# Modules |
522 |
# |
523 |
local module |
524 |
modules_dir="${D}/usr/$(get_libdir)/dracut/modules.d" |
525 |
|
526 |
# Remove modules not enabled by USE flags |
527 |
for module in ${IUSE_DRACUT_MODULES} ; do |
528 |
! use ${module} && rm_module -f ${module#dracut_modules_} |
529 |
done |
530 |
|
531 |
# Those flags are specific, and even are corresponding to modules, they need |
532 |
# to be declared as regular USE flags. |
533 |
use debug || rm_module 95debug |
534 |
use selinux || rm_module 98selinux |
535 |
|
536 |
# Following flags define set of helper modules which are base dependencies |
537 |
# for others and as so have no practical use, so remove these modules. |
538 |
use device-mapper || rm_module 90dm |
539 |
use net || rm_module 40network 45ifcfg 45url-lib |
540 |
|
541 |
# Remove S/390 modules which are not tested at all |
542 |
rm_module 80cms 95dasd 95dasd_mod 95zfcp 95znet |
543 |
|
544 |
# Remove modules which won't work for sure |
545 |
rm_module 95fcoe # no tools |
546 |
# fips module depends on masked app-crypt/hmaccalc |
547 |
rm_module 01fips 02fips-aesni |
548 |
|
549 |
# Remove extra modules which go to future dracut-extras |
550 |
rm_module 05busybox 97masterkey 98ecryptfs 98integrity 98systemd |
551 |
} |
552 |
|
553 |
pkg_postinst() { |
554 |
if linux-info_get_any_version && linux_config_src_exists; then |
555 |
echo |
556 |
ewarn "If the following test report contains a missing kernel" |
557 |
ewarn "configuration option, you should reconfigure and rebuild your" |
558 |
ewarn "kernel before booting image generated with this Dracut version." |
559 |
echo |
560 |
|
561 |
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS ~MODULES" |
562 |
|
563 |
# Kernel configuration options descriptions: |
564 |
local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev" |
565 |
local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\ |
566 |
"(initramfs/initrd) support" |
567 |
local desc_MODULES="Enable loadable module support" |
568 |
|
569 |
local opt desc |
570 |
|
571 |
# Generate ERROR_* variables for check_extra_config. |
572 |
for opt in ${CONFIG_CHECK}; do |
573 |
opt=${opt#\~} |
574 |
desc=desc_${opt} |
575 |
eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \ |
576 |
"is missing and REQUIRED'" |
577 |
done |
578 |
|
579 |
check_extra_config |
580 |
echo |
581 |
else |
582 |
echo |
583 |
ewarn "Your kernel configuration couldn't be checked. Do you have" |
584 |
ewarn "/usr/src/linux/.config file there? Please check manually if" |
585 |
ewarn "following options are enabled:" |
586 |
ewarn "" |
587 |
ewarn " CONFIG_BLK_DEV_INITRD" |
588 |
ewarn " CONFIG_DEVTMPFS" |
589 |
ewarn " CONFIG_MODULES" |
590 |
echo |
591 |
fi |
592 |
} |