]>
Commit | Line | Data |
---|---|---|
c5a65990 HH |
1 | %define dracutlibdir %{_prefix}/lib/dracut |
2 | ||
dc5bb506 | 3 | # Variables must be defined |
3592d868 | 4 | %define with_nbd 1 |
641eae0f | 5 | |
dc5bb506 WT |
6 | # nbd in Fedora only |
7 | %if 0%{?rhel} >= 6 | |
8 | %define with_nbd 0 | |
0aaa523c HH |
9 | %endif |
10 | ||
0aaa523c | 11 | Name: dracut |
0e6a94b3 HH |
12 | Version: xxx |
13 | Release: xxx | |
228694e5 | 14 | |
38672ee8 | 15 | Summary: Initramfs generator using udev |
b019d405 | 16 | %if 0%{?fedora} || 0%{?rhel} |
3b403b32 | 17 | Group: System Environment/Base |
228694e5 | 18 | %endif |
5ce6642f | 19 | %if 0%{?suse_version} |
228694e5 HH |
20 | Group: System/Base |
21 | %endif | |
f4031e8a HH |
22 | |
23 | # The entire source code is GPLv2+ | |
24 | # except install/* which is LGPLv2.1+ | |
25 | License: GPLv2+ and LGPLv2.1+ | |
26 | ||
82794b4b | 27 | URL: https://dracut.wiki.kernel.org/ |
f4031e8a | 28 | |
3b403b32 | 29 | # Source can be generated by |
0e6a94b3 HH |
30 | # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz |
31 | Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2 | |
82794b4b | 32 | |
85cda6ae | 33 | BuildRequires: dash bash git |
4cfd24d1 | 34 | |
b019d405 | 35 | %if 0%{?fedora} || 0%{?rhel} |
38672ee8 | 36 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
228694e5 | 37 | %endif |
5ce6642f | 38 | %if 0%{?suse_version} |
228694e5 HH |
39 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
40 | %endif | |
d9416c0d | 41 | |
b019d405 | 42 | %if 0%{?fedora} || 0%{?rhel} |
d9416c0d HH |
43 | BuildRequires: docbook-style-xsl docbook-dtds libxslt |
44 | %endif | |
45 | ||
5ce6642f | 46 | %if 0%{?suse_version} |
4ce3a1b1 | 47 | -BuildRequires: docbook-xsl-stylesheets libxslt |
d9416c0d | 48 | %endif |
5c554bd2 | 49 | |
4ce3a1b1 HH |
50 | BuildRequires: asciidoc |
51 | ||
b019d405 | 52 | %if 0%{?fedora} > 12 || 0%{?rhel} |
0bc4ef1c HH |
53 | # no "provides", because dracut does not offer |
54 | # all functionality of the obsoleted packages | |
5c554bd2 HH |
55 | Obsoletes: mkinitrd <= 6.0.93 |
56 | Obsoletes: mkinitrd-devel <= 6.0.93 | |
57 | Obsoletes: nash <= 6.0.93 | |
0bc4ef1c | 58 | Obsoletes: libbdevid-python <= 6.0.93 |
1b3bdcc1 | 59 | %endif |
228694e5 | 60 | |
4cfd24d1 HH |
61 | %if 0%{?fedora} > 16 || 0%{?rhel} > 6 |
62 | BuildRequires: systemd-units | |
63 | %endif | |
64 | ||
228694e5 HH |
65 | %if 0%{?suse_version} > 9999 |
66 | Obsoletes: mkinitrd < 2.6.1 | |
67 | Provides: mkinitrd = 2.6.1 | |
68 | %endif | |
69 | ||
8ef5ade7 HH |
70 | Obsoletes: dracut-kernel < 005 |
71 | Provides: dracut-kernel = %{version}-%{release} | |
5c554bd2 | 72 | |
7e33fa5b | 73 | Requires: bash |
38672ee8 | 74 | Requires: coreutils |
7e33fa5b | 75 | Requires: cpio |
7e33fa5b | 76 | Requires: filesystem >= 2.1.0 |
38672ee8 JK |
77 | Requires: findutils |
78 | Requires: grep | |
7a5f1ee4 | 79 | Requires: hardlink |
50bc2253 | 80 | Requires: gzip xz |
7e33fa5b | 81 | Requires: module-init-tools >= 3.7-9 |
7e33fa5b | 82 | Requires: sed |
f6a58604 | 83 | Requires: file |
8a240aca | 84 | Requires: kpartx |
abbb76fe | 85 | Requires: udev > 166 |
4976edb1 | 86 | Requires: kbd kbd-misc |
b019d405 | 87 | %if 0%{?fedora} || 0%{?rhel} > 6 |
abbb76fe | 88 | Requires: util-linux >= 2.21 |
dbfaae0e | 89 | Conflicts: systemd < 198 |
b019d405 | 90 | %else |
abbb76fe | 91 | Requires: util-linux-ng >= 2.21 |
b019d405 | 92 | %endif |
d9416c0d | 93 | |
82dfee99 | 94 | %if 0%{?fedora} || 0%{?rhel} > 6 |
828feae4 HH |
95 | Conflicts: initscripts < 8.63-1 |
96 | Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1 | |
d9416c0d HH |
97 | %endif |
98 | ||
6320d072 HH |
99 | Conflicts: mdadm < 3.2.6-14 |
100 | ||
38672ee8 | 101 | %description |
600c8769 | 102 | dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. |
3b403b32 | 103 | Unlike existing implementations, dracut does hard-code as little as possible |
600c8769 | 104 | into the initramfs. dracut contains various modules which are driven by the |
3b403b32 | 105 | event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as |
c55b2080 | 106 | NFS, iSCSI, NBD, FCoE with the dracut-network package. |
38672ee8 | 107 | |
ec74fa87 | 108 | %package network |
600c8769 | 109 | Summary: dracut modules to build a dracut initramfs with network support |
78cd7629 | 110 | Requires: %{name} = %{version}-%{release} |
3d8a164d HH |
111 | Requires: iputils |
112 | Requires: iproute | |
353ef760 HH |
113 | Obsoletes: dracut-generic < 008 |
114 | Provides: dracut-generic = %{version}-%{release} | |
ec74fa87 HH |
115 | |
116 | %description network | |
117 | This package requires everything which is needed to build a generic | |
118 | all purpose initramfs with network support with dracut. | |
119 | ||
7a1f355f | 120 | %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version} |
4d1661d3 | 121 | %package fips |
600c8769 | 122 | Summary: dracut modules to build a dracut initramfs with an integrity check |
4d1661d3 HH |
123 | Requires: %{name} = %{version}-%{release} |
124 | Requires: hmaccalc | |
125 | %if 0%{?rhel} > 5 | |
126 | # For Alpha 3, we want nss instead of nss-softokn | |
127 | Requires: nss | |
128 | %else | |
129 | Requires: nss-softokn | |
130 | %endif | |
131 | Requires: nss-softokn-freebl | |
132 | ||
133 | %description fips | |
134 | This package requires everything which is needed to build an | |
bcd352df | 135 | initramfs with dracut, which does an integrity check. |
228694e5 | 136 | %endif |
33ee031c | 137 | |
2e1b9171 | 138 | %package fips-aesni |
600c8769 | 139 | Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel |
2e1b9171 HH |
140 | Requires: %{name}-fips = %{version}-%{release} |
141 | ||
142 | %description fips-aesni | |
143 | This package requires everything which is needed to build an | |
bcd352df | 144 | initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module. |
2e1b9171 | 145 | |
52881470 | 146 | %package caps |
600c8769 | 147 | Summary: dracut modules to build a dracut initramfs which drops capabilities |
52881470 HH |
148 | Requires: %{name} = %{version}-%{release} |
149 | Requires: libcap | |
150 | ||
151 | %description caps | |
152 | This package requires everything which is needed to build an | |
bcd352df | 153 | initramfs with dracut, which drops capabilities. |
52881470 | 154 | |
21007cb6 | 155 | %package tools |
600c8769 | 156 | Summary: dracut tools to build the local initramfs |
a0af4fa5 | 157 | Requires: %{name} = %{version}-%{release} |
21007cb6 HH |
158 | |
159 | %description tools | |
160 | This package contains tools to assemble the local initrd and host configuration. | |
161 | ||
38672ee8 | 162 | %prep |
0e6a94b3 | 163 | %setup -q -n %{name}-%{version} |
76bba2a1 HH |
164 | |
165 | %if %{defined PATCH1} | |
85cda6ae HH |
166 | git init |
167 | git config user.email "dracut-maint@redhat.com" | |
168 | git config user.name "Fedora dracut team" | |
169 | git add . | |
170 | git commit -a -q -m "%{version} baseline." | |
171 | ||
172 | # Apply all the patches. | |
173 | git am -p1 %{patches} | |
76bba2a1 | 174 | %endif |
38672ee8 JK |
175 | |
176 | %build | |
4ce3a1b1 | 177 | make all |
38672ee8 | 178 | |
38672ee8 | 179 | %install |
b019d405 | 180 | %if 0%{?fedora} || 0%{?rhel} |
38672ee8 | 181 | rm -rf $RPM_BUILD_ROOT |
228694e5 | 182 | %endif |
c5a65990 HH |
183 | make install DESTDIR=$RPM_BUILD_ROOT \ |
184 | libdir=%{_prefix}/lib \ | |
ed919de0 | 185 | bindir=%{_bindir} \ |
b019d405 HH |
186 | %if %{defined _unitdir} |
187 | systemdsystemunitdir=%{_unitdir} \ | |
188 | %endif | |
189 | sysconfdir=/etc mandir=%{_mandir} | |
38672ee8 | 190 | |
982d59af | 191 | echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh |
228694e5 | 192 | |
7a1f355f | 193 | %if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 |
c5a65990 HH |
194 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips |
195 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni | |
228694e5 HH |
196 | %endif |
197 | ||
a5b48ce7 HH |
198 | %if %{defined _unitdir} |
199 | # for systemd, better use systemd-bootchart | |
200 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart | |
201 | %endif | |
202 | ||
d96c3254 HH |
203 | # we do not support dash in the initramfs |
204 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash | |
205 | ||
783721b3 | 206 | # remove gentoo specific modules |
c5a65990 | 207 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash |
95cf0a88 | 208 | |
04ab68a4 HH |
209 | %if %{defined _unitdir} |
210 | # with systemd IMA and selinux modules do not make sense | |
211 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs | |
212 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey | |
213 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity | |
214 | rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98selinux | |
215 | %endif | |
216 | ||
21007cb6 HH |
217 | mkdir -p $RPM_BUILD_ROOT/boot/dracut |
218 | mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay | |
837a5a60 HH |
219 | mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log |
220 | touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log | |
41f90cbe | 221 | mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs |
21007cb6 | 222 | |
7a1f355f | 223 | %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} |
a42b2b81 HH |
224 | install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf |
225 | install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf | |
d9416c0d HH |
226 | %endif |
227 | ||
5ce6642f | 228 | %if 0%{?suse_version} |
a42b2b81 | 229 | install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf |
d9416c0d HH |
230 | %endif |
231 | ||
228694e5 | 232 | %if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999 |
ed919de0 HH |
233 | rm $RPM_BUILD_ROOT%{_bindir}/mkinitrd |
234 | rm $RPM_BUILD_ROOT%{_bindir}/lsinitrd | |
1b3bdcc1 HH |
235 | %endif |
236 | ||
d8bf119d HH |
237 | mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d |
238 | install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut_log | |
62d0c4e7 | 239 | |
e4d85a77 HH |
240 | # create compat symlink |
241 | mkdir -p $RPM_BUILD_ROOT/sbin | |
242 | ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut | |
4cbc0c79 | 243 | |
38672ee8 JK |
244 | %clean |
245 | rm -rf $RPM_BUILD_ROOT | |
246 | ||
38672ee8 | 247 | %files |
78cd7629 | 248 | %defattr(-,root,root,0755) |
7c6eb152 | 249 | %doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg |
ed919de0 | 250 | %{_bindir}/dracut |
e4d85a77 HH |
251 | # compat symlink |
252 | /sbin/dracut | |
228694e5 | 253 | %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 |
ed919de0 HH |
254 | %{_bindir}/mkinitrd |
255 | %{_bindir}/lsinitrd | |
1b3bdcc1 | 256 | %endif |
c5a65990 HH |
257 | %dir %{dracutlibdir} |
258 | %dir %{dracutlibdir}/modules.d | |
552ecca6 | 259 | %{dracutlibdir}/dracut-functions.sh |
a6b63f91 | 260 | %{dracutlibdir}/dracut-functions |
dbf8f6ba | 261 | %{dracutlibdir}/dracut-version.sh |
552ecca6 | 262 | %{dracutlibdir}/dracut-logger.sh |
fb67e4aa | 263 | %{dracutlibdir}/dracut-initramfs-restore |
f4031e8a | 264 | %{dracutlibdir}/dracut-install |
4579f5a8 | 265 | %config(noreplace) /etc/dracut.conf |
b019d405 | 266 | %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} |
a42b2b81 | 267 | %{dracutlibdir}/dracut.conf.d/01-dist.conf |
d9416c0d | 268 | %endif |
2c2c4580 | 269 | %dir /etc/dracut.conf.d |
a42b2b81 | 270 | %dir %{dracutlibdir}/dracut.conf.d |
00f0a6e7 | 271 | %{_mandir}/man8/dracut.8* |
13f77e9f | 272 | %{_mandir}/man8/*service.8* |
7a1f355f | 273 | %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 |
0e14946a | 274 | %{_mandir}/man8/mkinitrd.8* |
7a1f355f HH |
275 | %{_mandir}/man1/lsinitrd.1* |
276 | %endif | |
0d866147 | 277 | %{_mandir}/man7/dracut.kernel.7* |
45abddb0 | 278 | %{_mandir}/man7/dracut.cmdline.7* |
6cc96b35 | 279 | %{_mandir}/man5/dracut.conf.5* |
a5b48ce7 HH |
280 | %if %{defined _unitdir} |
281 | %{dracutlibdir}/modules.d/00systemd-bootchart | |
282 | %else | |
c5a65990 | 283 | %{dracutlibdir}/modules.d/00bootchart |
a5b48ce7 | 284 | %endif |
fba5fbbd | 285 | %{dracutlibdir}/modules.d/03rescue |
ef914f7d | 286 | %{dracutlibdir}/modules.d/04watchdog |
c5a65990 HH |
287 | %{dracutlibdir}/modules.d/05busybox |
288 | %{dracutlibdir}/modules.d/10i18n | |
437cecb9 | 289 | %{dracutlibdir}/modules.d/30convertfs |
5c4bb360 | 290 | %{dracutlibdir}/modules.d/45url-lib |
b4751714 | 291 | %{dracutlibdir}/modules.d/50drm |
c5a65990 | 292 | %{dracutlibdir}/modules.d/50plymouth |
b80078af | 293 | %{dracutlibdir}/modules.d/80cms |
c5a65990 HH |
294 | %{dracutlibdir}/modules.d/90btrfs |
295 | %{dracutlibdir}/modules.d/90crypt | |
296 | %{dracutlibdir}/modules.d/90dm | |
297 | %{dracutlibdir}/modules.d/90dmraid | |
298 | %{dracutlibdir}/modules.d/90dmsquash-live | |
299 | %{dracutlibdir}/modules.d/90kernel-modules | |
300 | %{dracutlibdir}/modules.d/90lvm | |
301 | %{dracutlibdir}/modules.d/90mdraid | |
302 | %{dracutlibdir}/modules.d/90multipath | |
1488a9b3 | 303 | %{dracutlibdir}/modules.d/90qemu |
c5a65990 | 304 | %{dracutlibdir}/modules.d/91crypt-gpg |
24ba78cb | 305 | %{dracutlibdir}/modules.d/91crypt-loop |
c5a65990 HH |
306 | %{dracutlibdir}/modules.d/95debug |
307 | %{dracutlibdir}/modules.d/95resume | |
308 | %{dracutlibdir}/modules.d/95rootfs-block | |
309 | %{dracutlibdir}/modules.d/95dasd | |
310 | %{dracutlibdir}/modules.d/95dasd_mod | |
311 | %{dracutlibdir}/modules.d/95fstab-sys | |
312 | %{dracutlibdir}/modules.d/95zfcp | |
313 | %{dracutlibdir}/modules.d/95terminfo | |
314 | %{dracutlibdir}/modules.d/95udev-rules | |
a7c9cbe1 | 315 | %{dracutlibdir}/modules.d/95virtfs |
04ab68a4 | 316 | %if %{undefined _unitdir} |
c5a65990 | 317 | %{dracutlibdir}/modules.d/96securityfs |
c5a65990 | 318 | %{dracutlibdir}/modules.d/97masterkey |
04ab68a4 | 319 | %{dracutlibdir}/modules.d/98selinux |
c5a65990 | 320 | %{dracutlibdir}/modules.d/98integrity |
04ab68a4 HH |
321 | %endif |
322 | %{dracutlibdir}/modules.d/97biosdevname | |
323 | %{dracutlibdir}/modules.d/98ecryptfs | |
d33d6077 | 324 | %{dracutlibdir}/modules.d/98pollcdrom |
c5a65990 | 325 | %{dracutlibdir}/modules.d/98syslog |
6e26f9b4 | 326 | %{dracutlibdir}/modules.d/98systemd |
c5a65990 HH |
327 | %{dracutlibdir}/modules.d/98usrmount |
328 | %{dracutlibdir}/modules.d/99base | |
329 | %{dracutlibdir}/modules.d/99fs-lib | |
5c4bb360 | 330 | %{dracutlibdir}/modules.d/99img-lib |
c5a65990 | 331 | %{dracutlibdir}/modules.d/99shutdown |
d8bf119d | 332 | %config(noreplace) /etc/logrotate.d/dracut_log |
837a5a60 | 333 | %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log |
41f90cbe | 334 | %dir %{_sharedstatedir}/initramfs |
b019d405 | 335 | %if %{defined _unitdir} |
2023d8eb HH |
336 | %{_unitdir}/dracut-shutdown.service |
337 | %{_unitdir}/shutdown.target.wants/dracut-shutdown.service | |
4cfd24d1 | 338 | %endif |
9dd9d81f HH |
339 | %if 0%{?fedora} || 0%{?rhel} > 6 |
340 | %{_prefix}/lib/kernel/install.d/50-dracut.install | |
d837ac39 | 341 | %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install |
9dd9d81f | 342 | %endif |
ec74fa87 HH |
343 | |
344 | %files network | |
78cd7629 | 345 | %defattr(-,root,root,0755) |
c5a65990 HH |
346 | %{dracutlibdir}/modules.d/40network |
347 | %{dracutlibdir}/modules.d/95fcoe | |
348 | %{dracutlibdir}/modules.d/95iscsi | |
349 | %{dracutlibdir}/modules.d/90livenet | |
1488a9b3 | 350 | %{dracutlibdir}/modules.d/90qemu-net |
72ee74b9 | 351 | %{dracutlibdir}/modules.d/95cifs |
c5a65990 HH |
352 | %{dracutlibdir}/modules.d/95nbd |
353 | %{dracutlibdir}/modules.d/95nfs | |
a29cf54c | 354 | %{dracutlibdir}/modules.d/95ssh-client |
c5a65990 HH |
355 | %{dracutlibdir}/modules.d/45ifcfg |
356 | %{dracutlibdir}/modules.d/95znet | |
78cd7629 | 357 | |
7a1f355f | 358 | %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} |
4d1661d3 HH |
359 | %files fips |
360 | %defattr(-,root,root,0755) | |
c5a65990 | 361 | %{dracutlibdir}/modules.d/01fips |
a42b2b81 | 362 | %{dracutlibdir}/dracut.conf.d/40-fips.conf |
228694e5 | 363 | %endif |
ec74fa87 | 364 | |
2e1b9171 HH |
365 | %files fips-aesni |
366 | %defattr(-,root,root,0755) | |
367 | %doc COPYING | |
c5a65990 | 368 | %{dracutlibdir}/modules.d/02fips-aesni |
2e1b9171 | 369 | |
52881470 HH |
370 | %files caps |
371 | %defattr(-,root,root,0755) | |
c5a65990 | 372 | %{dracutlibdir}/modules.d/02caps |
52881470 | 373 | |
3b403b32 | 374 | %files tools |
21007cb6 | 375 | %defattr(-,root,root,0755) |
66e45737 | 376 | %{_mandir}/man8/dracut-catimages.8* |
ed919de0 | 377 | %{_bindir}/dracut-catimages |
21007cb6 HH |
378 | %dir /boot/dracut |
379 | %dir /var/lib/dracut | |
380 | %dir /var/lib/dracut/overlay | |
381 | ||
38672ee8 | 382 | %changelog |