Gentoo Archives: gentoo-commits

From: "Amadeusz Zolnowski (aidecoe)" <aidecoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-kernel/dracut: ChangeLog dracut-034-r4.ebuild
Date: Sat, 28 Dec 2013 17:32:20
Message-Id: 20131228173212.592EC2004C@flycatcher.gentoo.org
1 aidecoe 13/12/28 17:32:12
2
3 Modified: ChangeLog
4 Added: dracut-034-r4.ebuild
5 Log:
6 No longer require pkg-config at run-time. Paths (udev dir and systemd dirs)
7 are set in dracut config file by ebuild. It fixes bug #488504. If any of this
8 paths is changed, dracut will have to be rebuilt by a user.
9
10 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key F0134531E1DBFAB5)
11
12 Revision Changes Path
13 1.146 sys-kernel/dracut/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?rev=1.146&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?rev=1.146&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/ChangeLog?r1=1.145&r2=1.146
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v
22 retrieving revision 1.145
23 retrieving revision 1.146
24 diff -u -r1.145 -r1.146
25 --- ChangeLog 28 Dec 2013 15:52:25 -0000 1.145
26 +++ ChangeLog 28 Dec 2013 17:32:12 -0000 1.146
27 @@ -1,6 +1,13 @@
28 # ChangeLog for sys-kernel/dracut
29 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.145 2013/12/28 15:52:25 aidecoe Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.146 2013/12/28 17:32:12 aidecoe Exp $
32 +
33 +*dracut-034-r4 (28 Dec 2013)
34 +
35 + 28 Dec 2013; Amadeusz Żołnowski <aidecoe@g.o> +dracut-034-r4.ebuild:
36 + No longer require pkg-config at run-time. Paths (udev dir and systemd dirs)
37 + are set in dracut config file by ebuild. It fixes bug #488504. If any of this
38 + paths is changed, dracut will have to be rebuilt by a user.
39
40 28 Dec 2013; Amadeusz Żołnowski <aidecoe@g.o> -dracut-034.ebuild,
41 -dracut-034-r1.ebuild, -dracut-034-r2.ebuild:
42
43
44
45 1.1 sys-kernel/dracut/dracut-034-r4.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-034-r4.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-kernel/dracut/dracut-034-r4.ebuild?rev=1.1&content-type=text/plain
49
50 Index: dracut-034-r4.ebuild
51 ===================================================================
52 # Copyright 1999-2013 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-034-r4.ebuild,v 1.1 2013/12/28 17:32:12 aidecoe Exp $
55
56 EAPI=4
57
58 inherit bash-completion-r1 eutils linux-info multilib systemd
59
60 add_req_use_for() {
61 local dep="$1"; shift
62 local f
63
64 for f in "$@"; do
65 REQUIRED_USE+="${f}? ( ${dep} )
66 "
67 done
68 }
69
70 DESCRIPTION="Generic initramfs generation tool"
71 HOMEPAGE="http://dracut.wiki.kernel.org"
72 SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.bz2"
73 LICENSE="GPL-2"
74 SLOT="0"
75 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
76
77 REQUIRED_USE="
78 dracut_modules_bootchart? ( !dracut_modules_systemd )
79 dracut_modules_crypt-gpg? ( dracut_modules_crypt )
80 dracut_modules_crypt-loop? ( dracut_modules_crypt )
81 dracut_modules_livenet? ( dracut_modules_dmsquash-live )
82 "
83 COMMON_MODULES="
84 dracut_modules_biosdevname
85 dracut_modules_bootchart
86 dracut_modules_btrfs
87 dracut_modules_caps
88 dracut_modules_crypt-gpg
89 dracut_modules_crypt-loop
90 dracut_modules_dash
91 dracut_modules_gensplash
92 dracut_modules_mdraid
93 dracut_modules_multipath
94 dracut_modules_plymouth
95 dracut_modules_syslog
96 dracut_modules_systemd
97 "
98 DM_MODULES="
99 dracut_modules_crypt
100 dracut_modules_dmraid
101 dracut_modules_dmsquash-live
102 dracut_modules_livenet
103 dracut_modules_lvm
104 "
105 NETWORK_MODULES="
106 dracut_modules_cifs
107 dracut_modules_iscsi
108 dracut_modules_livenet
109 dracut_modules_nbd
110 dracut_modules_nfs
111 dracut_modules_ssh-client
112 "
113 add_req_use_for device-mapper ${DM_MODULES}
114 add_req_use_for net ${NETWORK_MODULES}
115 IUSE_DRACUT_MODULES="${COMMON_MODULES} ${DM_MODULES} ${NETWORK_MODULES}"
116 IUSE="debug device-mapper net selinux ${IUSE_DRACUT_MODULES}"
117
118 RESTRICT="test"
119
120 CDEPEND="virtual/udev
121 dracut_modules_systemd? ( >=sys-apps/systemd-199 )
122 selinux? ( sec-policy/selinux-dracut )
123 "
124 RDEPEND="${CDEPEND}
125 app-arch/cpio
126 >=app-shells/bash-4.0
127 >=sys-apps/baselayout-1.12.14-r1
128 >sys-apps/kmod-5[tools]
129 || ( >=sys-apps/sysvinit-2.87-r3 sys-apps/systemd-sysv-utils )
130 >=sys-apps/util-linux-2.21
131
132 debug? ( dev-util/strace )
133 device-mapper? ( >=sys-fs/lvm2-2.02.33 )
134 net? ( net-misc/curl >=net-misc/dhcp-4.2.4_p2-r1[client] sys-apps/iproute2 )
135 selinux? ( sys-libs/libselinux sys-libs/libsepol )
136 dracut_modules_biosdevname? ( sys-apps/biosdevname )
137 dracut_modules_bootchart? ( app-benchmarks/bootchart2 sys-apps/usleep
138 sys-process/acct )
139 dracut_modules_btrfs? ( sys-fs/btrfs-progs )
140 dracut_modules_caps? ( sys-libs/libcap )
141 dracut_modules_cifs? ( net-fs/cifs-utils )
142 dracut_modules_crypt? ( sys-fs/cryptsetup )
143 dracut_modules_crypt-gpg? ( app-crypt/gnupg )
144 dracut_modules_dash? ( >=app-shells/dash-0.5.4.11 )
145 dracut_modules_dmraid? ( sys-fs/dmraid sys-fs/multipath-tools )
146 dracut_modules_gensplash? ( media-gfx/splashutils )
147 dracut_modules_iscsi? ( >=sys-block/open-iscsi-2.0.871.3 )
148 dracut_modules_lvm? ( >=sys-fs/lvm2-2.02.33 )
149 dracut_modules_mdraid? ( >=sys-fs/mdadm-3.2.6-r1 )
150 dracut_modules_multipath? ( sys-fs/multipath-tools )
151 dracut_modules_nbd? ( sys-block/nbd )
152 dracut_modules_nfs? ( net-fs/nfs-utils net-nds/rpcbind )
153 dracut_modules_plymouth? ( >=sys-boot/plymouth-0.8.3-r1 )
154 dracut_modules_ssh-client? ( dev-libs/openssl )
155 dracut_modules_syslog? ( || ( app-admin/syslog-ng app-admin/rsyslog ) )
156 "
157 DEPEND="${CDEPEND}
158 app-text/asciidoc
159 >=dev-libs/libxslt-1.1.26
160 app-text/docbook-xml-dtd:4.5
161 >=app-text/docbook-xsl-stylesheets-1.75.2
162 virtual/pkgconfig
163 "
164
165 DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
166 README.testsuite TODO )
167 MY_LIBDIR=/usr/lib
168
169 #
170 # Helper functions
171 #
172
173 # Returns true if any of specified modules is enabled by USE flag and false
174 # otherwise.
175 # $1 = list of modules (which have corresponding USE flags of the same name)
176 any_module() {
177 local m modules=" $@ "
178
179 for m in ${modules}; do
180 ! use $m && modules=${modules/ $m / }
181 done
182
183 shopt -s extglob
184 modules=${modules%%+( )}
185 shopt -u extglob
186
187 [[ ${modules} ]]
188 }
189
190 # Removes module from modules.d.
191 # $1 = module name
192 # Module name can be specified without number prefix.
193 rm_module() {
194 local force m
195 [[ $1 = -f ]] && force=-f
196
197 for m in $@; do
198 if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
199 rm ${force} --interactive=never -r "${modules_dir}"/$m
200 else
201 rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
202 fi
203 done
204 }
205
206 #
207 # ebuild functions
208 #
209
210 src_prepare() {
211 epatch "${FILESDIR}/${PV}-0001-dracut.sh-do-not-bail-out-if-kernel-mo.patch"
212 epatch "${FILESDIR}/${PV}-0002-dracut-functions.sh-support-for-altern.patch"
213 epatch "${FILESDIR}/${PV}-0003-gentoo.conf-let-udevdir-be-handled-by-.patch"
214 epatch "${FILESDIR}/${PV}-0004-Use-the-same-paths-in-dracut.sh-as-tho.patch"
215 epatch "${FILESDIR}/${PV}-0005-Install-dracut-install-into-libexec-di.patch"
216 epatch "${FILESDIR}/${PV}-0006-resume-fix-swap-detection-in-hostonly.patch"
217 epatch "${FILESDIR}/${PV}-0007-dracut.sh-also-mkdir-run-lock-which-is.patch"
218 epatch "${FILESDIR}/${PV}-0008-dracut.sh-no-need-to-make-subdirs-in-r.patch"
219 epatch "${FILESDIR}/${PV}-0009-lvm-install-thin-utils-for-non-hostonl.patch"
220 epatch "${FILESDIR}/${PV}-0010-module-setup.sh-add-comments-for-dracu.patch"
221 epatch "${FILESDIR}/${PV}-0011-lvm-fix-thin-recognition.patch"
222 epatch "${FILESDIR}/${PV}-0012-lvm-always-install-thin-utils-for-lvm.patch"
223 epatch "${FILESDIR}/${PV}-0013-usrmount-always-install.patch"
224 epatch "${FILESDIR}/${PV}-0014-udev-rules-add-eudev-rules.patch"
225
226 local libdirs="/$(get_libdir) /usr/$(get_libdir)"
227 [[ $libdirs =~ /lib\ ]] || libdirs+=" /lib /usr/lib"
228 einfo "Setting libdirs to \"${libdirs}\" ..."
229 sed -e "3alibdirs=\"${libdirs}\"" \
230 -i "${S}/dracut.conf.d/gentoo.conf.example" || die
231
232 local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
233 einfo "Setting udevdir to ${udevdir}..."
234 sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
235 -i "${S}/dracut.conf.d/gentoo.conf.example" || die
236
237 if use dracut_modules_systemd; then
238 local systemdutildir="$(systemd_get_utildir)"
239 local systemdsystemunitdir="$(systemd_get_unitdir)"
240 local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
241 --variable=systemdsystemconfdir)"
242 [[ ${systemdsystemconfdir} ]] \
243 || systemdsystemconfdir=/etc/systemd/system
244 einfo "Setting systemdutildir to ${systemdutildir} and ..."
245 sed -e "5asystemdutildir=\"${systemdutildir}\"" \
246 -i "${S}/dracut.conf.d/gentoo.conf.example" || die
247 einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
248 sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
249 -i "${S}/dracut.conf.d/gentoo.conf.example" || die
250 einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
251 sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
252 -i "${S}/dracut.conf.d/gentoo.conf.example" || die
253 fi
254
255 epatch_user
256 }
257
258 src_configure() {
259 local myconf="--libdir=${MY_LIBDIR}"
260 myconf+=" --bashcompletiondir=$(get_bashcompdir)"
261
262 if use dracut_modules_systemd; then
263 myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'"
264 fi
265
266 econf ${myconf}
267 }
268
269 src_compile() {
270 tc-export CC
271 emake doc install/dracut-install
272 }
273
274 src_install() {
275 default
276
277 local my_libdir="${MY_LIBDIR}"
278 local dracutlibdir="${my_libdir#/}/dracut"
279
280 echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
281
282 insinto "${dracutlibdir}/dracut.conf.d/"
283 newins dracut.conf.d/gentoo.conf.example gentoo.conf
284
285 insinto /etc/logrotate.d
286 newins dracut.logrotate dracut
287
288 dodir /var/lib/dracut/overlay
289
290 dohtml dracut.html
291
292 #
293 # Modules
294 #
295 local module
296 modules_dir="${D%/}/${dracutlibdir}/modules.d"
297
298 # Remove modules not enabled by USE flags
299 for module in ${IUSE_DRACUT_MODULES} ; do
300 ! use ${module} && rm_module -f ${module#dracut_modules_}
301 done
302
303 # Those flags are specific, and even are corresponding to modules, they need
304 # to be declared as regular USE flags.
305 use debug || rm_module 95debug
306 use selinux || rm_module 98selinux
307
308 # Following flags define set of helper modules which are base dependencies
309 # for others and as so have no practical use, so remove these modules.
310 use device-mapper || rm_module 90dm
311 use net || rm_module 40network 45ifcfg 45url-lib
312
313 if use dracut_modules_systemd; then
314 # With systemd following modules do not make sense
315 rm_module 96securityfs 98selinux
316 else
317 # Without systemd following modules do not make sense
318 rm_module 00systemd-bootchart
319 fi
320
321 # Remove S/390 modules which are not tested at all
322 rm_module 80cms 95dasd 95dasd_mod 95zfcp 95znet
323
324 # Remove modules which won't work for sure
325 rm_module 95fcoe # no tools
326 # fips module depends on masked app-crypt/hmaccalc
327 rm_module 01fips 02fips-aesni
328
329 # Remove extra modules which go to future dracut-extras
330 rm_module 05busybox 97masterkey 98ecryptfs 98integrity
331 }
332
333 pkg_postinst() {
334 if linux-info_get_any_version && linux_config_src_exists; then
335 ewarn ""
336 ewarn "If the following test report contains a missing kernel"
337 ewarn "configuration option, you should reconfigure and rebuild your"
338 ewarn "kernel before booting image generated with this Dracut version."
339 ewarn ""
340
341 local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
342
343 # Kernel configuration options descriptions:
344 local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
345 local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
346 "(initramfs/initrd) support"
347
348 local opt desc
349
350 # Generate ERROR_* variables for check_extra_config.
351 for opt in ${CONFIG_CHECK}; do
352 opt=${opt#\~}
353 desc=desc_${opt}
354 eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
355 "is missing and REQUIRED'"
356 done
357
358 check_extra_config
359 echo
360 else
361 ewarn ""
362 ewarn "Your kernel configuration couldn't be checked. Do you have"
363 ewarn "/usr/src/linux/.config file there? Please check manually if"
364 ewarn "following options are enabled:"
365 ewarn ""
366 ewarn " CONFIG_BLK_DEV_INITRD"
367 ewarn " CONFIG_DEVTMPFS"
368 ewarn ""
369 fi
370
371 if use dracut_modules_crypt || use dracut_modules_dmraid || use \
372 dracut_modules_mdraid || use dracut_modules_lvm; then
373
374 if ! [[ $(</proc/cmdline) =~ rd.auto[\ =] ]]; then
375 ewarn "Autoassembly of special devices like cryptoLUKS, dmraid, "
376 ewarn "mdraid or lvm is off for default as of >=dracut-024."
377 ewarn "Use rd.auto option to turn it on."
378 fi
379 fi
380 }