dracut.spec: move dmsquash and livnet to subpackage
[dracut.git] / dracut.spec
blob58510db0520a548854272ae77c65e69f261a26bf
1 %define dracutlibdir %{_prefix}/lib/dracut
2 %bcond_without doc
4 # Variables must be defined
5 %define with_nbd 1
7 # nbd in Fedora only
8 %if 0%{?rhel} >= 6
9 %define with_nbd 0
10 %endif
12 Name: dracut
13 Version: xxx
14 Release: xxx
16 Summary: Initramfs generator using udev
17 %if 0%{?fedora} || 0%{?rhel}
18 Group: System Environment/Base
19 %endif
20 %if 0%{?suse_version}
21 Group: System/Base
22 %endif
24 # The entire source code is GPLv2+
25 # except install/* which is LGPLv2+
26 License: GPLv2+ and LGPLv2+
28 URL: https://dracut.wiki.kernel.org/
30 # Source can be generated by
31 # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
32 Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
33 Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
36 BuildRequires: bash git
38 %if 0%{?fedora} || 0%{?rhel}
39 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
40 BuildRequires: pkgconfig
41 %endif
42 %if 0%{?fedora}
43 BuildRequires: bash-completion
44 BuildRequires: pkgconfig
45 %endif
47 %if 0%{?suse_version}
48 BuildRoot: %{_tmppath}/%{name}-%{version}-build
49 %endif
51 %if %{with doc}
52 %if 0%{?fedora} || 0%{?rhel}
53 BuildRequires: docbook-style-xsl docbook-dtds libxslt
54 %endif
56 %if 0%{?suse_version}
57 -BuildRequires: docbook-xsl-stylesheets libxslt
58 %endif
60 BuildRequires: asciidoc
61 %endif
64 %if 0%{?fedora} > 12 || 0%{?rhel}
65 # no "provides", because dracut does not offer
66 # all functionality of the obsoleted packages
67 Obsoletes: mkinitrd <= 6.0.93
68 Obsoletes: mkinitrd-devel <= 6.0.93
69 Obsoletes: nash <= 6.0.93
70 Obsoletes: libbdevid-python <= 6.0.93
71 %endif
73 %if 0%{?fedora} > 16 || 0%{?rhel} > 6
74 BuildRequires: systemd-units
75 %endif
77 %if 0%{?suse_version} > 9999
78 Obsoletes: mkinitrd < 2.6.1
79 Provides: mkinitrd = 2.6.1
80 %endif
82 Obsoletes: dracut-kernel < 005
83 Provides: dracut-kernel = %{version}-%{release}
85 Obsoletes: dracut <= 029
86 Obsoletes: dracut-norescue
87 Provides: dracut-norescue
89 Requires: bash >= 4
90 Requires: coreutils
91 Requires: cpio
92 Requires: filesystem >= 2.1.0
93 Requires: findutils
94 Requires: grep
95 Requires: hardlink
96 Requires: gzip xz
97 Requires: kmod
98 Requires: sed
99 Requires: kpartx
101 %if 0%{?fedora} || 0%{?rhel} > 6
102 Requires: util-linux >= 2.21
103 Requires: systemd >= 199
104 Requires: procps-ng
105 Conflicts: grubby < 8.23
106 Conflicts: initscripts < 8.63-1
107 Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
108 Conflicts: bcache-tools < 0-0.14.20130909git
109 %else
110 Requires: udev > 166
111 Requires: util-linux-ng >= 2.21
112 %endif
114 Conflicts: mdadm < 3.2.6-14
116 %description
117 dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
118 Unlike existing implementations, dracut does hard-code as little as possible
119 into the initramfs. dracut contains various modules which are driven by the
120 event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
121 NFS, iSCSI, NBD, FCoE with the dracut-network package.
123 %package network
124 Summary: dracut modules to build a dracut initramfs with network support
125 Requires: %{name} = %{version}-%{release}
126 Requires: iputils
127 Requires: iproute
128 Requires: dhclient
129 Obsoletes: dracut-generic < 008
130 Provides: dracut-generic = %{version}-%{release}
132 %description network
133 This package requires everything which is needed to build a generic
134 all purpose initramfs with network support with dracut.
136 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
137 %package fips
138 Summary: dracut modules to build a dracut initramfs with an integrity check
139 Requires: %{name} = %{version}-%{release}
140 Requires: hmaccalc
141 %if 0%{?rhel} > 5
142 # For Alpha 3, we want nss instead of nss-softokn
143 Requires: nss
144 %else
145 Requires: nss-softokn
146 %endif
147 Requires: nss-softokn-freebl
149 %description fips
150 This package requires everything which is needed to build an
151 initramfs with dracut, which does an integrity check.
152 %endif
154 %package fips-aesni
155 Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel
156 Requires: %{name}-fips = %{version}-%{release}
158 %description fips-aesni
159 This package requires everything which is needed to build an
160 initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module.
162 %package caps
163 Summary: dracut modules to build a dracut initramfs which drops capabilities
164 Requires: %{name} = %{version}-%{release}
165 Requires: libcap
167 %description caps
168 This package requires everything which is needed to build an
169 initramfs with dracut, which drops capabilities.
171 %package live
172 Summary: dracut modules to build a dracut initramfs with live image capabilities
173 Requires: %{name} = %{version}-%{release}
174 Requires: %{name}-network = %{version}-%{release}
175 Requires: tar gzip coreutils bash device-mapper curl
177 %description live
178 This package requires everything which is needed to build an
179 initramfs with dracut, with live image capabilities, like Live CDs.
181 %package config-generic
182 Summary: dracut configuration to turn off hostonly image generation
183 Requires: %{name} = %{version}-%{release}
184 Obsoletes: dracut-nohostonly
185 Provides: dracut-nohostonly
187 %description config-generic
188 This package provides the configuration to turn off the host specific initramfs
189 generation with dracut and generates a generic image by default.
191 %package config-rescue
192 Summary: dracut configuration to turn on rescue image generation
193 Requires: %{name} = %{version}-%{release}
194 Obsoletes: dracut <= 029
196 %description config-rescue
197 This package provides the configuration to turn on the rescue initramfs
198 generation with dracut.
200 %package tools
201 Summary: dracut tools to build the local initramfs
202 Requires: %{name} = %{version}-%{release}
204 %description tools
205 This package contains tools to assemble the local initrd and host configuration.
207 %prep
208 %autosetup -n %{name}-%{version} -S git_am
209 cp %{SOURCE1} .
211 %build
212 %configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
213 %if %{without doc}
214 --disable-documentation
215 %endif
217 make %{?_smp_mflags}
219 %install
220 %if 0%{?fedora} || 0%{?rhel}
221 rm -rf -- $RPM_BUILD_ROOT
222 %endif
223 make %{?_smp_mflags} install \
224 DESTDIR=$RPM_BUILD_ROOT \
225 libdir=%{_prefix}/lib
227 echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
229 %if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0
230 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
231 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
232 %endif
234 %if %{defined _unitdir}
235 # for systemd, better use systemd-bootchart
236 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
237 %endif
239 # we do not support dash in the initramfs
240 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
242 # remove gentoo specific modules
243 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
245 %if %{defined _unitdir}
246 # with systemd IMA and selinux modules do not make sense
247 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
248 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
249 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
250 %endif
252 mkdir -p $RPM_BUILD_ROOT/boot/dracut
253 mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
254 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
255 touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
256 mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
258 %if 0%{?fedora} || 0%{?rhel}
259 install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
260 rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
261 %endif
262 %if 0%{?suse_version}
263 install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
264 %endif
266 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
267 install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
268 %endif
270 %if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
271 rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
272 rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
273 %endif
275 %if 0%{?fedora} || 0%{?rhel} > 6
276 # FIXME: remove after F19
277 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
278 install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
280 echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
281 echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
282 %endif
284 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
285 > $RPM_BUILD_ROOT/etc/system-fips
286 %endif
288 %clean
289 rm -rf -- $RPM_BUILD_ROOT
291 %files
292 %defattr(-,root,root,0755)
293 %if %{with doc}
294 %doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
295 %endif
296 %{!?_licensedir:%global license %%doc}
297 %license COPYING lgpl-2.1.txt
298 %{_bindir}/dracut
299 %{_datadir}/bash-completion/completions/dracut
300 %{_datadir}/bash-completion/completions/lsinitrd
301 %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
302 %{_bindir}/mkinitrd
303 %{_bindir}/lsinitrd
304 %endif
305 %dir %{dracutlibdir}
306 %dir %{dracutlibdir}/modules.d
307 %{dracutlibdir}/dracut-functions.sh
308 %{dracutlibdir}/dracut-functions
309 %{dracutlibdir}/dracut-version.sh
310 %{dracutlibdir}/dracut-logger.sh
311 %{dracutlibdir}/dracut-initramfs-restore
312 %{dracutlibdir}/dracut-install
313 %{dracutlibdir}/skipcpio
314 %config(noreplace) %{_sysconfdir}/dracut.conf
315 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
316 %{dracutlibdir}/dracut.conf.d/01-dist.conf
317 %endif
318 %dir %{_sysconfdir}/dracut.conf.d
319 %dir %{dracutlibdir}/dracut.conf.d
320 %{_datadir}/pkgconfig/dracut.pc
322 %if %{with doc}
323 %{_mandir}/man8/dracut.8*
324 %{_mandir}/man8/*service.8*
325 %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
326 %{_mandir}/man8/mkinitrd.8*
327 %{_mandir}/man1/lsinitrd.1*
328 %endif
329 %{_mandir}/man7/dracut.kernel.7*
330 %{_mandir}/man7/dracut.cmdline.7*
331 %{_mandir}/man7/dracut.modules.7*
332 %{_mandir}/man7/dracut.bootup.7*
333 %{_mandir}/man5/dracut.conf.5*
334 %endif
336 %if %{defined _unitdir}
337 %{dracutlibdir}/modules.d/00systemd-bootchart
338 %else
339 %{dracutlibdir}/modules.d/00bootchart
340 %endif
341 %{dracutlibdir}/modules.d/00bash
342 %{dracutlibdir}/modules.d/00systemd
343 %{dracutlibdir}/modules.d/01systemd-initrd
344 %{dracutlibdir}/modules.d/03modsign
345 %{dracutlibdir}/modules.d/03rescue
346 %{dracutlibdir}/modules.d/04watchdog
347 %{dracutlibdir}/modules.d/05busybox
348 %{dracutlibdir}/modules.d/10i18n
349 %{dracutlibdir}/modules.d/30convertfs
350 %{dracutlibdir}/modules.d/45url-lib
351 %{dracutlibdir}/modules.d/50drm
352 %{dracutlibdir}/modules.d/50plymouth
353 %{dracutlibdir}/modules.d/80cms
354 %{dracutlibdir}/modules.d/90btrfs
355 %{dracutlibdir}/modules.d/90crypt
356 %{dracutlibdir}/modules.d/90dm
357 %{dracutlibdir}/modules.d/90dmraid
358 %{dracutlibdir}/modules.d/90kernel-modules
359 %{dracutlibdir}/modules.d/90lvm
360 %{dracutlibdir}/modules.d/90mdraid
361 %{dracutlibdir}/modules.d/90multipath
362 %{dracutlibdir}/modules.d/90qemu
363 %{dracutlibdir}/modules.d/91crypt-gpg
364 %{dracutlibdir}/modules.d/91crypt-loop
365 %{dracutlibdir}/modules.d/95debug
366 %{dracutlibdir}/modules.d/95resume
367 %{dracutlibdir}/modules.d/95rootfs-block
368 %{dracutlibdir}/modules.d/95dasd
369 %{dracutlibdir}/modules.d/95dasd_mod
370 %{dracutlibdir}/modules.d/95dasd_rules
371 %{dracutlibdir}/modules.d/95fstab-sys
372 %{dracutlibdir}/modules.d/95zfcp
373 %{dracutlibdir}/modules.d/95zfcp_rules
374 %{dracutlibdir}/modules.d/95terminfo
375 %{dracutlibdir}/modules.d/95udev-rules
376 %{dracutlibdir}/modules.d/95virtfs
377 %if %{undefined _unitdir}
378 %{dracutlibdir}/modules.d/96securityfs
379 %{dracutlibdir}/modules.d/97masterkey
380 %{dracutlibdir}/modules.d/98integrity
381 %endif
382 %{dracutlibdir}/modules.d/97biosdevname
383 %{dracutlibdir}/modules.d/98ecryptfs
384 %{dracutlibdir}/modules.d/98pollcdrom
385 %{dracutlibdir}/modules.d/98selinux
386 %{dracutlibdir}/modules.d/98syslog
387 %{dracutlibdir}/modules.d/98dracut-systemd
388 %{dracutlibdir}/modules.d/98usrmount
389 %{dracutlibdir}/modules.d/99base
390 %{dracutlibdir}/modules.d/99fs-lib
391 %{dracutlibdir}/modules.d/99shutdown
392 %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
393 %dir %{_sharedstatedir}/initramfs
394 %if %{defined _unitdir}
395 %{_unitdir}/dracut-shutdown.service
396 %{_unitdir}/sysinit.target.wants/dracut-shutdown.service
397 %{_unitdir}/dracut-cmdline.service
398 %{_unitdir}/dracut-initqueue.service
399 %{_unitdir}/dracut-mount.service
400 %{_unitdir}/dracut-pre-mount.service
401 %{_unitdir}/dracut-pre-pivot.service
402 %{_unitdir}/dracut-pre-trigger.service
403 %{_unitdir}/dracut-pre-udev.service
404 %{_unitdir}/initrd.target.wants/dracut-cmdline.service
405 %{_unitdir}/initrd.target.wants/dracut-initqueue.service
406 %{_unitdir}/initrd.target.wants/dracut-mount.service
407 %{_unitdir}/initrd.target.wants/dracut-pre-mount.service
408 %{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
409 %{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
410 %{_unitdir}/initrd.target.wants/dracut-pre-udev.service
412 %endif
413 %if 0%{?fedora} || 0%{?rhel} > 6
414 %{_prefix}/lib/kernel/install.d/50-dracut.install
415 %endif
417 %files network
418 %defattr(-,root,root,0755)
419 %{dracutlibdir}/modules.d/02systemd-networkd
420 %{dracutlibdir}/modules.d/40network
421 %{dracutlibdir}/modules.d/90kernel-network-modules
422 %{dracutlibdir}/modules.d/95fcoe
423 %{dracutlibdir}/modules.d/95iscsi
424 %{dracutlibdir}/modules.d/90qemu-net
425 %{dracutlibdir}/modules.d/95cifs
426 %{dracutlibdir}/modules.d/95nbd
427 %{dracutlibdir}/modules.d/95nfs
428 %{dracutlibdir}/modules.d/95ssh-client
429 %{dracutlibdir}/modules.d/45ifcfg
430 %{dracutlibdir}/modules.d/95znet
431 %{dracutlibdir}/modules.d/95fcoe-uefi
432 %{dracutlibdir}/modules.d/99uefi-lib
434 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
435 %files fips
436 %defattr(-,root,root,0755)
437 %{dracutlibdir}/modules.d/01fips
438 %{dracutlibdir}/dracut.conf.d/40-fips.conf
439 %config(missingok) /etc/system-fips
440 %endif
442 %files fips-aesni
443 %defattr(-,root,root,0755)
444 %{dracutlibdir}/modules.d/02fips-aesni
446 %files caps
447 %defattr(-,root,root,0755)
448 %{dracutlibdir}/modules.d/02caps
450 %files live
451 %defattr(-,root,root,0755)
452 %{dracutlibdir}/modules.d/99img-lib
453 %{dracutlibdir}/modules.d/90dmsquash-live
454 %{dracutlibdir}/modules.d/90livenet
456 %files tools
457 %defattr(-,root,root,0755)
459 %if %{with doc}
460 %doc %{_mandir}/man8/dracut-catimages.8*
461 %endif
463 %{_bindir}/dracut-catimages
464 %dir /boot/dracut
465 %dir /var/lib/dracut
466 %dir /var/lib/dracut/overlay
468 %files config-generic
469 %defattr(-,root,root,0755)
470 %{dracutlibdir}/dracut.conf.d/02-generic-image.conf
472 %files config-rescue
473 %defattr(-,root,root,0755)
474 %{dracutlibdir}/dracut.conf.d/02-rescue.conf
475 %if 0%{?fedora} || 0%{?rhel} > 6
476 %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
477 %{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
478 %endif
480 %changelog