iscsi: for iBFT read the initiator-name from the correct file
[dracut.git] / dracut.spec
blobcb27f37c09bbfff3b368c263975e33a797c85956
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
34 BuildRequires: bash git
36 %if 0%{?fedora} || 0%{?rhel}
37 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
38 BuildRequires: pkgconfig
39 %endif
40 %if 0%{?fedora}
41 BuildRequires: bash-completion
42 BuildRequires: pkgconfig
43 %endif
45 %if 0%{?suse_version}
46 BuildRoot: %{_tmppath}/%{name}-%{version}-build
47 %endif
49 %if %{with doc}
50 %if 0%{?fedora} || 0%{?rhel}
51 BuildRequires: docbook-style-xsl docbook-dtds libxslt
52 %endif
54 %if 0%{?suse_version}
55 -BuildRequires: docbook-xsl-stylesheets libxslt
56 %endif
58 BuildRequires: asciidoc
59 %endif
62 %if 0%{?fedora} > 12 || 0%{?rhel}
63 # no "provides", because dracut does not offer
64 # all functionality of the obsoleted packages
65 Obsoletes: mkinitrd <= 6.0.93
66 Obsoletes: mkinitrd-devel <= 6.0.93
67 Obsoletes: nash <= 6.0.93
68 Obsoletes: libbdevid-python <= 6.0.93
69 %endif
71 %if 0%{?fedora} > 16 || 0%{?rhel} > 6
72 BuildRequires: systemd-units
73 %endif
75 %if 0%{?suse_version} > 9999
76 Obsoletes: mkinitrd < 2.6.1
77 Provides: mkinitrd = 2.6.1
78 %endif
80 Obsoletes: dracut-kernel < 005
81 Provides: dracut-kernel = %{version}-%{release}
83 Obsoletes: dracut <= 029
84 Obsoletes: dracut-norescue
85 Provides: dracut-norescue
87 Requires: bash >= 4
88 Requires: coreutils
89 Requires: cpio
90 Requires: filesystem >= 2.1.0
91 Requires: findutils
92 Requires: grep
93 Requires: hardlink
94 Requires: gzip xz
95 Requires: kmod
96 Requires: sed
97 Requires: kpartx
99 %if 0%{?fedora} || 0%{?rhel} > 6
100 Requires: util-linux >= 2.21
101 Requires: systemd >= 199
102 Requires: procps-ng
103 Conflicts: grubby < 8.23
104 Conflicts: initscripts < 8.63-1
105 Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
106 Conflicts: bcache-tools < 0-0.14.20130909git
107 %else
108 Requires: udev > 166
109 Requires: util-linux-ng >= 2.21
110 %endif
112 Conflicts: mdadm < 3.2.6-14
114 %description
115 dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
116 Unlike existing implementations, dracut does hard-code as little as possible
117 into the initramfs. dracut contains various modules which are driven by the
118 event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
119 NFS, iSCSI, NBD, FCoE with the dracut-network package.
121 %package network
122 Summary: dracut modules to build a dracut initramfs with network support
123 Requires: %{name} = %{version}-%{release}
124 Requires: iputils
125 Requires: iproute
126 Requires: dhclient
127 Obsoletes: dracut-generic < 008
128 Provides: dracut-generic = %{version}-%{release}
130 %description network
131 This package requires everything which is needed to build a generic
132 all purpose initramfs with network support with dracut.
134 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
135 %package fips
136 Summary: dracut modules to build a dracut initramfs with an integrity check
137 Requires: %{name} = %{version}-%{release}
138 Requires: hmaccalc
139 %if 0%{?rhel} > 5
140 # For Alpha 3, we want nss instead of nss-softokn
141 Requires: nss
142 %else
143 Requires: nss-softokn
144 %endif
145 Requires: nss-softokn-freebl
147 %description fips
148 This package requires everything which is needed to build an
149 initramfs with dracut, which does an integrity check.
150 %endif
152 %package fips-aesni
153 Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel
154 Requires: %{name}-fips = %{version}-%{release}
156 %description fips-aesni
157 This package requires everything which is needed to build an
158 initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module.
160 %package caps
161 Summary: dracut modules to build a dracut initramfs which drops capabilities
162 Requires: %{name} = %{version}-%{release}
163 Requires: libcap
165 %description caps
166 This package requires everything which is needed to build an
167 initramfs with dracut, which drops capabilities.
169 %package config-generic
170 Summary: dracut configuration to turn off hostonly image generation
171 Requires: %{name} = %{version}-%{release}
172 Obsoletes: dracut-nohostonly
173 Provides: dracut-nohostonly
175 %description config-generic
176 This package provides the configuration to turn off the host specific initramfs
177 generation with dracut and generates a generic image by default.
179 %package config-rescue
180 Summary: dracut configuration to turn on rescue image generation
181 Requires: %{name} = %{version}-%{release}
182 Obsoletes: dracut <= 029
184 %description config-rescue
185 This package provides the configuration to turn on the rescue initramfs
186 generation with dracut.
188 %package tools
189 Summary: dracut tools to build the local initramfs
190 Requires: %{name} = %{version}-%{release}
192 %description tools
193 This package contains tools to assemble the local initrd and host configuration.
195 %prep
196 %setup -q -n %{name}-%{version}
198 %if %{defined PATCH1}
199 git init
200 git config user.email "dracut-maint@redhat.com"
201 git config user.name "Fedora dracut team"
202 git add .
203 git commit -a -q -m "%{version} baseline."
205 # Apply all the patches.
206 git am -p1 %{patches}
207 %endif
209 %build
210 %configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
211 %if %{without doc}
212 --disable-documentation
213 %endif
215 make %{?_smp_mflags}
217 %install
218 %if 0%{?fedora} || 0%{?rhel}
219 rm -rf -- $RPM_BUILD_ROOT
220 %endif
221 make %{?_smp_mflags} install \
222 DESTDIR=$RPM_BUILD_ROOT \
223 libdir=%{_prefix}/lib
225 echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
227 %if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0
228 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
229 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
230 %endif
232 %if %{defined _unitdir}
233 # for systemd, better use systemd-bootchart
234 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
235 %endif
237 # we do not support dash in the initramfs
238 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
240 # remove gentoo specific modules
241 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
243 %if %{defined _unitdir}
244 # with systemd IMA and selinux modules do not make sense
245 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
246 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
247 rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
248 %endif
250 mkdir -p $RPM_BUILD_ROOT/boot/dracut
251 mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
252 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
253 touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
254 mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
256 %if 0%{?fedora} || 0%{?rhel}
257 install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
258 rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
259 %endif
260 %if 0%{?suse_version}
261 install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
262 %endif
264 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
265 install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
266 %endif
268 %if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
269 rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
270 rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
271 %endif
273 %if 0%{?fedora} || 0%{?rhel} > 6
274 # FIXME: remove after F19
275 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
276 install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
278 echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
279 echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
280 %endif
282 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
283 > $RPM_BUILD_ROOT/etc/system-fips
284 %endif
286 # create compat symlink
287 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
288 ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
290 %clean
291 rm -rf -- $RPM_BUILD_ROOT
293 %files
294 %defattr(-,root,root,0755)
295 %if %{with doc}
296 %doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
297 %endif
298 %{_bindir}/dracut
299 # compat symlink
300 %{_sbindir}/dracut
301 %{_datadir}/bash-completion/completions/dracut
302 %{_datadir}/bash-completion/completions/lsinitrd
303 %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
304 %{_bindir}/mkinitrd
305 %{_bindir}/lsinitrd
306 %endif
307 %dir %{dracutlibdir}
308 %dir %{dracutlibdir}/modules.d
309 %{dracutlibdir}/dracut-functions.sh
310 %{dracutlibdir}/dracut-functions
311 %{dracutlibdir}/dracut-version.sh
312 %{dracutlibdir}/dracut-logger.sh
313 %{dracutlibdir}/dracut-initramfs-restore
314 %{dracutlibdir}/dracut-install
315 %{dracutlibdir}/skipcpio
316 %config(noreplace) %{_sysconfdir}/dracut.conf
317 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
318 %{dracutlibdir}/dracut.conf.d/01-dist.conf
319 %endif
320 %dir %{_sysconfdir}/dracut.conf.d
321 %dir %{dracutlibdir}/dracut.conf.d
323 %if %{with doc}
324 %{_mandir}/man8/dracut.8*
325 %{_mandir}/man8/*service.8*
326 %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
327 %{_mandir}/man8/mkinitrd.8*
328 %{_mandir}/man1/lsinitrd.1*
329 %endif
330 %{_mandir}/man7/dracut.kernel.7*
331 %{_mandir}/man7/dracut.cmdline.7*
332 %{_mandir}/man7/dracut.modules.7*
333 %{_mandir}/man7/dracut.bootup.7*
334 %{_mandir}/man5/dracut.conf.5*
335 %endif
337 %if %{defined _unitdir}
338 %{dracutlibdir}/modules.d/00systemd-bootchart
339 %else
340 %{dracutlibdir}/modules.d/00bootchart
341 %endif
342 %{dracutlibdir}/modules.d/00bash
343 %{dracutlibdir}/modules.d/03modsign
344 %{dracutlibdir}/modules.d/03rescue
345 %{dracutlibdir}/modules.d/04watchdog
346 %{dracutlibdir}/modules.d/05busybox
347 %{dracutlibdir}/modules.d/10i18n
348 %{dracutlibdir}/modules.d/30convertfs
349 %{dracutlibdir}/modules.d/45url-lib
350 %{dracutlibdir}/modules.d/50drm
351 %{dracutlibdir}/modules.d/50plymouth
352 %{dracutlibdir}/modules.d/80cms
353 %{dracutlibdir}/modules.d/90btrfs
354 %{dracutlibdir}/modules.d/90crypt
355 %{dracutlibdir}/modules.d/90dm
356 %{dracutlibdir}/modules.d/90dmraid
357 %{dracutlibdir}/modules.d/90dmsquash-live
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/98systemd
388 %{dracutlibdir}/modules.d/98usrmount
389 %{dracutlibdir}/modules.d/99base
390 %{dracutlibdir}/modules.d/99fs-lib
391 %{dracutlibdir}/modules.d/99img-lib
392 %{dracutlibdir}/modules.d/99shutdown
393 %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
394 %dir %{_sharedstatedir}/initramfs
395 %if %{defined _unitdir}
396 %{_unitdir}/dracut-shutdown.service
397 %{_unitdir}/shutdown.target.wants/dracut-shutdown.service
398 %{_unitdir}/dracut-cmdline.service
399 %{_unitdir}/dracut-initqueue.service
400 %{_unitdir}/dracut-mount.service
401 %{_unitdir}/dracut-pre-mount.service
402 %{_unitdir}/dracut-pre-pivot.service
403 %{_unitdir}/dracut-pre-trigger.service
404 %{_unitdir}/dracut-pre-udev.service
405 %{_unitdir}/initrd.target.wants/dracut-cmdline.service
406 %{_unitdir}/initrd.target.wants/dracut-initqueue.service
407 %{_unitdir}/initrd.target.wants/dracut-mount.service
408 %{_unitdir}/initrd.target.wants/dracut-pre-mount.service
409 %{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
410 %{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
411 %{_unitdir}/initrd.target.wants/dracut-pre-udev.service
413 %endif
414 %if 0%{?fedora} || 0%{?rhel} > 6
415 %{_prefix}/lib/kernel/install.d/50-dracut.install
416 %endif
418 %files network
419 %defattr(-,root,root,0755)
420 %{dracutlibdir}/modules.d/40network
421 %{dracutlibdir}/modules.d/95fcoe
422 %{dracutlibdir}/modules.d/95iscsi
423 %{dracutlibdir}/modules.d/90livenet
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)
445 %if %{with doc}
446 %doc COPYING
447 %endif
449 %{dracutlibdir}/modules.d/02fips-aesni
451 %files caps
452 %defattr(-,root,root,0755)
453 %{dracutlibdir}/modules.d/02caps
455 %files tools
456 %defattr(-,root,root,0755)
458 %if %{with doc}
459 %doc %{_mandir}/man8/dracut-catimages.8*
460 %endif
462 %{_bindir}/dracut-catimages
463 %dir /boot/dracut
464 %dir /var/lib/dracut
465 %dir /var/lib/dracut/overlay
467 %files config-generic
468 %defattr(-,root,root,0755)
469 %{dracutlibdir}/dracut.conf.d/02-generic-image.conf
471 %files config-rescue
472 %defattr(-,root,root,0755)
473 %{dracutlibdir}/dracut.conf.d/02-rescue.conf
474 %if 0%{?fedora} || 0%{?rhel} > 6
475 %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
476 %{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
477 %endif
479 %changelog