]>
Commit | Line | Data |
---|---|---|
dc5bb506 | 1 | # Variables must be defined |
3592d868 | 2 | %define with_nbd 1 |
641eae0f | 3 | |
dc5bb506 WT |
4 | # nbd in Fedora only |
5 | %if 0%{?rhel} >= 6 | |
6 | %define with_nbd 0 | |
0aaa523c HH |
7 | %endif |
8 | ||
0aaa523c | 9 | Name: dracut |
0e6a94b3 HH |
10 | Version: xxx |
11 | Release: xxx | |
228694e5 | 12 | |
38672ee8 | 13 | Summary: Initramfs generator using udev |
5ce6642f | 14 | %if 0%{?fedora} |
3b403b32 | 15 | Group: System Environment/Base |
228694e5 | 16 | %endif |
5ce6642f | 17 | %if 0%{?suse_version} |
228694e5 HH |
18 | Group: System/Base |
19 | %endif | |
3b403b32 | 20 | License: GPLv2+ |
82794b4b | 21 | URL: https://dracut.wiki.kernel.org/ |
3b403b32 | 22 | # Source can be generated by |
0e6a94b3 HH |
23 | # http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz |
24 | Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2 | |
82794b4b | 25 | |
228694e5 | 26 | BuildArch: noarch |
ce4359ea | 27 | BuildRequires: dash bash |
5ce6642f | 28 | %if 0%{?fedora} |
38672ee8 | 29 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
228694e5 | 30 | %endif |
5ce6642f | 31 | %if 0%{?suse_version} |
228694e5 HH |
32 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
33 | %endif | |
d9416c0d | 34 | |
5ce6642f | 35 | %if 0%{?fedora} |
d9416c0d HH |
36 | BuildRequires: docbook-style-xsl docbook-dtds libxslt |
37 | %endif | |
38 | ||
5ce6642f | 39 | %if 0%{?suse_version} |
d9416c0d HH |
40 | BuildRequires: docbook-xsl-stylesheets libxslt |
41 | %endif | |
5c554bd2 | 42 | |
1b3bdcc1 | 43 | %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 |
0bc4ef1c HH |
44 | # no "provides", because dracut does not offer |
45 | # all functionality of the obsoleted packages | |
5c554bd2 HH |
46 | Obsoletes: mkinitrd <= 6.0.93 |
47 | Obsoletes: mkinitrd-devel <= 6.0.93 | |
48 | Obsoletes: nash <= 6.0.93 | |
0bc4ef1c | 49 | Obsoletes: libbdevid-python <= 6.0.93 |
1b3bdcc1 | 50 | %endif |
228694e5 HH |
51 | |
52 | %if 0%{?suse_version} > 9999 | |
53 | Obsoletes: mkinitrd < 2.6.1 | |
54 | Provides: mkinitrd = 2.6.1 | |
55 | %endif | |
56 | ||
8ef5ade7 HH |
57 | Obsoletes: dracut-kernel < 005 |
58 | Provides: dracut-kernel = %{version}-%{release} | |
5c554bd2 | 59 | |
7e33fa5b HH |
60 | Requires: bash |
61 | Requires: bzip2 | |
38672ee8 | 62 | Requires: coreutils |
7e33fa5b HH |
63 | Requires: cpio |
64 | Requires: dash | |
65 | Requires: filesystem >= 2.1.0 | |
38672ee8 JK |
66 | Requires: findutils |
67 | Requires: grep | |
7e33fa5b | 68 | Requires: gzip |
7d86d90d | 69 | Requires: kbd |
80aa303c | 70 | Requires: mktemp >= 1.5-5 |
7e33fa5b | 71 | Requires: module-init-tools >= 3.7-9 |
7e33fa5b HH |
72 | Requires: sed |
73 | Requires: tar | |
74 | Requires: udev | |
d9416c0d | 75 | |
5ce6642f | 76 | %if 0%{?fedora} |
6ae5caf0 | 77 | Requires: util-linux >= 2.16 |
d9416c0d HH |
78 | Requires: initscripts >= 8.63-1 |
79 | Requires: plymouth >= 0.8.0-0.2009.29.09.19.1 | |
d9416c0d HH |
80 | %endif |
81 | ||
5ce6642f | 82 | %if 0%{?suse_version} |
d9416c0d HH |
83 | Requires: util-linux >= 2.16 |
84 | %endif | |
85 | ||
78cd7629 | 86 | |
38672ee8 | 87 | %description |
3b403b32 HH |
88 | Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels. |
89 | Unlike existing implementations, dracut does hard-code as little as possible | |
90 | into the initramfs. Dracut contains various modules which are driven by the | |
91 | event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as | |
c55b2080 | 92 | NFS, iSCSI, NBD, FCoE with the dracut-network package. |
38672ee8 | 93 | |
ec74fa87 | 94 | %package network |
8ec6bfcb | 95 | Summary: Dracut modules to build a dracut initramfs with network support |
78cd7629 | 96 | Requires: %{name} = %{version}-%{release} |
3b403b32 | 97 | Requires: rpcbind |
dc5bb506 | 98 | %if %{with_nbd} |
78cd7629 | 99 | Requires: nbd |
dc5bb506 | 100 | %endif |
7838d853 | 101 | Requires: iproute |
ec74fa87 | 102 | Requires: bridge-utils |
228694e5 | 103 | |
5ce6642f | 104 | %if 0%{?fedora} |
228694e5 | 105 | Requires: iscsi-initiator-utils |
3b403b32 | 106 | Requires: nfs-utils |
228694e5 | 107 | Requires: dhclient |
228694e5 HH |
108 | %endif |
109 | ||
5ce6642f | 110 | %if 0%{?suse_version} |
228694e5 HH |
111 | Requires: dhcp-client |
112 | Requires: nfs-client | |
113 | Requires: vlan | |
114 | %endif | |
353ef760 HH |
115 | Obsoletes: dracut-generic < 008 |
116 | Provides: dracut-generic = %{version}-%{release} | |
ec74fa87 HH |
117 | |
118 | %description network | |
119 | This package requires everything which is needed to build a generic | |
120 | all purpose initramfs with network support with dracut. | |
121 | ||
5ce6642f | 122 | %if 0%{?fedora} |
4d1661d3 | 123 | %package fips |
c55b2080 | 124 | Summary: Dracut modules to build a dracut initramfs with an integrity check |
4d1661d3 HH |
125 | Requires: %{name} = %{version}-%{release} |
126 | Requires: hmaccalc | |
127 | %if 0%{?rhel} > 5 | |
128 | # For Alpha 3, we want nss instead of nss-softokn | |
129 | Requires: nss | |
130 | %else | |
131 | Requires: nss-softokn | |
132 | %endif | |
133 | Requires: nss-softokn-freebl | |
134 | ||
135 | %description fips | |
136 | This package requires everything which is needed to build an | |
137 | all purpose initramfs with dracut, which does an integrity check. | |
228694e5 | 138 | %endif |
33ee031c | 139 | |
52881470 HH |
140 | %package caps |
141 | Summary: Dracut modules to build a dracut initramfs which drops capabilities | |
142 | Requires: %{name} = %{version}-%{release} | |
143 | Requires: libcap | |
144 | ||
145 | %description caps | |
146 | This package requires everything which is needed to build an | |
147 | all purpose initramfs with dracut, which drops capabilities. | |
148 | ||
21007cb6 | 149 | %package tools |
8ec6bfcb | 150 | Summary: Dracut tools to build the local initramfs |
a0af4fa5 | 151 | Requires: %{name} = %{version}-%{release} |
21007cb6 HH |
152 | |
153 | %description tools | |
154 | This package contains tools to assemble the local initrd and host configuration. | |
155 | ||
38672ee8 | 156 | %prep |
0e6a94b3 | 157 | %setup -q -n %{name}-%{version} |
38672ee8 JK |
158 | |
159 | %build | |
3b403b32 | 160 | make |
38672ee8 | 161 | |
38672ee8 | 162 | %install |
5ce6642f | 163 | %if 0%{?fedora} |
38672ee8 | 164 | rm -rf $RPM_BUILD_ROOT |
228694e5 | 165 | %endif |
ec74fa87 | 166 | make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \ |
3b403b32 | 167 | sysconfdir=/etc mandir=%{_mandir} |
38672ee8 | 168 | |
95cf0a88 | 169 | echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version |
228694e5 | 170 | |
5ce6642f | 171 | %if 0%{?fedora} == 0 |
228694e5 HH |
172 | rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips |
173 | %endif | |
174 | ||
783721b3 HH |
175 | # remove gentoo specific modules |
176 | rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/50gensplash | |
95cf0a88 | 177 | |
21007cb6 HH |
178 | mkdir -p $RPM_BUILD_ROOT/boot/dracut |
179 | mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay | |
837a5a60 HH |
180 | mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log |
181 | touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log | |
41f90cbe | 182 | mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs |
21007cb6 | 183 | |
5ce6642f | 184 | %if 0%{?fedora} |
d9416c0d | 185 | install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf |
b151c3b1 | 186 | install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf |
d9416c0d HH |
187 | %endif |
188 | ||
5ce6642f | 189 | %if 0%{?suse_version} |
d9416c0d HH |
190 | install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf |
191 | %endif | |
192 | ||
228694e5 | 193 | %if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999 |
1b3bdcc1 HH |
194 | rm $RPM_BUILD_ROOT/sbin/mkinitrd |
195 | rm $RPM_BUILD_ROOT/sbin/lsinitrd | |
196 | %endif | |
197 | ||
62d0c4e7 HH |
198 | mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/dracut |
199 | install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut | |
200 | ||
38672ee8 JK |
201 | %clean |
202 | rm -rf $RPM_BUILD_ROOT | |
203 | ||
38672ee8 | 204 | %files |
78cd7629 | 205 | %defattr(-,root,root,0755) |
7c6eb152 | 206 | %doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg |
38672ee8 | 207 | /sbin/dracut |
228694e5 | 208 | %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 |
63d8d27b HH |
209 | /sbin/mkinitrd |
210 | /sbin/lsinitrd | |
1b3bdcc1 | 211 | %endif |
78cd7629 | 212 | %dir %{_datadir}/dracut |
490f98aa | 213 | %dir %{_datadir}/dracut/modules.d |
78cd7629 | 214 | %{_datadir}/dracut/dracut-functions |
f709fa43 | 215 | %{_datadir}/dracut/dracut-logger |
4579f5a8 | 216 | %config(noreplace) /etc/dracut.conf |
5ce6642f | 217 | %if 0%{?fedora} || 0%{?suse_version} |
d9416c0d HH |
218 | %config(noreplace) /etc/dracut.conf.d/01-dist.conf |
219 | %endif | |
2c2c4580 | 220 | %dir /etc/dracut.conf.d |
62d0c4e7 | 221 | %config(noreplace) /etc/logrotate.d/dracut |
00f0a6e7 | 222 | %{_mandir}/man8/dracut.8* |
0d866147 | 223 | %{_mandir}/man7/dracut.kernel.7* |
6cc96b35 | 224 | %{_mandir}/man5/dracut.conf.5* |
f6c76abe | 225 | %{_datadir}/dracut/modules.d/00bootchart |
ec74fa87 | 226 | %{_datadir}/dracut/modules.d/00dash |
325d4913 | 227 | %{_datadir}/dracut/modules.d/05busybox |
1246703b | 228 | %{_datadir}/dracut/modules.d/10i18n |
ec74fa87 HH |
229 | %{_datadir}/dracut/modules.d/10rpmversion |
230 | %{_datadir}/dracut/modules.d/50plymouth | |
9799e0ad | 231 | %{_datadir}/dracut/modules.d/60xen |
fede5bbc | 232 | %{_datadir}/dracut/modules.d/90btrfs |
ec74fa87 | 233 | %{_datadir}/dracut/modules.d/90crypt |
07db0def | 234 | %{_datadir}/dracut/modules.d/90dm |
ec74fa87 HH |
235 | %{_datadir}/dracut/modules.d/90dmraid |
236 | %{_datadir}/dracut/modules.d/90dmsquash-live | |
237 | %{_datadir}/dracut/modules.d/90kernel-modules | |
238 | %{_datadir}/dracut/modules.d/90lvm | |
239 | %{_datadir}/dracut/modules.d/90mdraid | |
8ec6bfcb | 240 | %{_datadir}/dracut/modules.d/90multipath |
00dd4db5 | 241 | %{_datadir}/dracut/modules.d/91crypt-gpg |
ec74fa87 HH |
242 | %{_datadir}/dracut/modules.d/95debug |
243 | %{_datadir}/dracut/modules.d/95resume | |
244 | %{_datadir}/dracut/modules.d/95rootfs-block | |
837a5a60 | 245 | %{_datadir}/dracut/modules.d/95dasd |
5bde13f9 | 246 | %{_datadir}/dracut/modules.d/95dasd_mod |
771c2151 | 247 | %{_datadir}/dracut/modules.d/95fstab-sys |
07db0def | 248 | %{_datadir}/dracut/modules.d/95zfcp |
ec74fa87 HH |
249 | %{_datadir}/dracut/modules.d/95terminfo |
250 | %{_datadir}/dracut/modules.d/95udev-rules | |
534b0525 | 251 | %{_datadir}/dracut/modules.d/97biosdevname |
7d86d90d | 252 | %{_datadir}/dracut/modules.d/98selinux |
ec74fa87 HH |
253 | %{_datadir}/dracut/modules.d/98syslog |
254 | %{_datadir}/dracut/modules.d/99base | |
cae57c60 | 255 | %{_datadir}/dracut/modules.d/99shutdown |
3592d868 HH |
256 | # logfile needs no logrotate, because it gets overwritten |
257 | # for every dracut run | |
837a5a60 | 258 | %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log |
41f90cbe | 259 | %dir %{_sharedstatedir}/initramfs |
ec74fa87 HH |
260 | |
261 | %files network | |
78cd7629 | 262 | %defattr(-,root,root,0755) |
ec74fa87 HH |
263 | %{_datadir}/dracut/modules.d/40network |
264 | %{_datadir}/dracut/modules.d/95fcoe | |
265 | %{_datadir}/dracut/modules.d/95iscsi | |
266 | %{_datadir}/dracut/modules.d/95nbd | |
267 | %{_datadir}/dracut/modules.d/95nfs | |
837a5a60 | 268 | %{_datadir}/dracut/modules.d/45ifcfg |
532b8c7a | 269 | %{_datadir}/dracut/modules.d/95znet |
78cd7629 | 270 | |
5ce6642f | 271 | %if 0%{?fedora} |
4d1661d3 HH |
272 | %files fips |
273 | %defattr(-,root,root,0755) | |
4d1661d3 | 274 | %{_datadir}/dracut/modules.d/01fips |
b151c3b1 | 275 | %config(noreplace) /etc/dracut.conf.d/40-fips.conf |
228694e5 | 276 | %endif |
ec74fa87 | 277 | |
52881470 HH |
278 | %files caps |
279 | %defattr(-,root,root,0755) | |
280 | %{_datadir}/dracut/modules.d/02caps | |
281 | ||
3b403b32 | 282 | %files tools |
21007cb6 | 283 | %defattr(-,root,root,0755) |
66e45737 HH |
284 | %{_mandir}/man8/dracut-gencmdline.8* |
285 | %{_mandir}/man8/dracut-catimages.8* | |
21007cb6 HH |
286 | /sbin/dracut-gencmdline |
287 | /sbin/dracut-catimages | |
288 | %dir /boot/dracut | |
289 | %dir /var/lib/dracut | |
290 | %dir /var/lib/dracut/overlay | |
291 | ||
38672ee8 | 292 | %changelog |