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