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