]>
Commit | Line | Data |
---|---|---|
a7313793 | 1 | # |
0fec42fa | 2 | # NOTE: |
351f379b JR |
3 | # the following bcond combos will not work |
4 | # - without_vserver and any of the following | |
15a064bf | 5 | # - with_grsecurity |
a5585a68 | 6 | # |
8ad00cb1 ER |
7 | # LATEST VERSION CHECKER: |
8 | # # curl -s http://www.kernel.org/kdist/finger_banner | |
9 | # | |
a5585a68 | 10 | # TODO: |
351f379b | 11 | # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686 |
9a1672a0 JR |
12 | # - IPv4 source address selection for multihomed vservers is completely broken |
13 | # meaning routing table is ignored except for default | |
351f379b | 14 | # |
fc5a68a2 AM |
15 | # HOWTO update configuration files: |
16 | # - run build | |
17 | # - add new options to proper config (kernel-multiarch.config, kernel-x86.config, kernel-powerpc.config etc) | |
18 | # - sort configuration files using: | |
ee5dc1b8 | 19 | # ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version}/ -a x86 kernel-x86.config |
fc5a68a2 | 20 | # ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version} kernel-multiarch.config |
a5585a68 AM |
21 | # |
22 | # Conditional build: | |
a5585a68 | 23 | %bcond_without source # don't build kernel-source package |
1848fd38 | 24 | %bcond_without doc # don't build kernel-doc package |
351f379b JR |
25 | %bcond_without pcmcia # don't build pcmcia |
26 | ||
a5585a68 | 27 | %bcond_with verbose # verbose build (V=1) |
03de6725 | 28 | %bcond_with reiser4 # support for reiser4 fs (experimental) |
351f379b JR |
29 | |
30 | %bcond_without grsecurity # don't build grsecurity nor pax at all | |
d615e060 | 31 | %bcond_with pax # build pax and grsecurity (ie. grsecurity && pax) |
351f379b JR |
32 | |
33 | %bcond_with fbcondecor # build fbcondecor (disable FB_TILEBLITTING and affected fb modules) | |
34 | %bcond_with pae # build PAE (HIGHMEM64G) support on uniprocessor | |
35 | %bcond_with nfsroot # build with root on NFS support | |
36 | ||
7f07242b | 37 | %bcond_without imq # imq support |
1b75c2b4 JR |
38 | %bcond_without wrr # wrr support |
39 | %bcond_without esfq # esfq support | |
351f379b JR |
40 | %bcond_without ipv6 # ipv6 support |
41 | ||
42 | %bcond_without vserver # support for VServer (enabled by default) | |
ea9f0963 | 43 | %bcond_with tuxonice # support for tuxonice (ex-suspend2) (enabled by default) |
351f379b | 44 | |
7141a3b6 | 45 | %bcond_with vanilla # don't include any patches |
351f379b | 46 | %bcond_with rescuecd # build kernel for our rescue |
351f379b | 47 | %bcond_with myown # build with your own config (kernel-myown.config) |
a5585a68 AM |
48 | |
49 | %{?debug:%define with_verbose 1} | |
50 | ||
06936f6f | 51 | %if %{with vanilla} |
52 | %unglobal with_grsecurity | |
53 | %endif | |
54 | ||
351f379b | 55 | %if %{without grsecurity} |
b488384f | 56 | %unglobal with_pax |
a5585a68 | 57 | %endif |
351f379b | 58 | |
17da405a | 59 | %if %{with pax} |
351f379b JR |
60 | %define with_grsecurity 1 |
61 | %define with_pax 1 | |
62 | %endif | |
63 | ||
351f379b JR |
64 | %define have_drm 1 |
65 | %define have_oss 1 | |
66 | %define have_sound 1 | |
101ae904 | 67 | %define have_pcmcia 1 |
351f379b JR |
68 | |
69 | %if %{with rescuecd} | |
b488384f AM |
70 | %unglobal with_tuxonice |
71 | %unglobal with_grsecurity | |
b488384f AM |
72 | %unglobal with_pax |
73 | %unglobal with_vserver | |
351f379b JR |
74 | %define have_drm 0 |
75 | %define have_sound 0 | |
76 | %endif | |
77 | ||
101ae904 | 78 | %if %{with myown} |
79 | %define have_drm 0 | |
80 | %define have_oss 0 | |
81 | %define have_sound 0 | |
82 | %define have_pcmcia 0 | |
351f379b JR |
83 | %endif |
84 | ||
85 | %ifarch sparc sparc64 | |
b488384f | 86 | %unglobal with_pcmcia |
351f379b JR |
87 | %define have_drm 0 |
88 | %define have_oss 0 | |
89 | %endif | |
90 | ||
101ae904 | 91 | %if %{without pcmcia} |
92 | %define have_pcmcia 0 | |
93 | %endif | |
94 | ||
8205412a | 95 | %define basever 3.0 |
457f0b6e | 96 | %define postver .3 |
05d078be | 97 | %define rel 0.2 |
a5585a68 AM |
98 | |
99 | %define _enable_debug_packages 0 | |
a5585a68 | 100 | |
28eb7fa5 | 101 | %define tuxonice_version 3.2 |
351f379b | 102 | |
de20e7d7 AM |
103 | %define module_init_tools_ver 3.16 |
104 | ||
101ae904 | 105 | %if %{with myown} |
106 | %if "%{_alt_kernel}" == "" | |
107 | %define alt_kernel myown | |
351f379b | 108 | %endif |
06936f6f | 109 | %else # not myown: |
110 | %if %{with vanilla} | |
111 | %define alt_kernel vanilla | |
112 | %else # not vanilla: | |
113 | %if %{with rescuecd} | |
114 | %define alt_kernel rescuecd | |
115 | %else # not rescuecd: | |
b2fd5bd8 | 116 | %define __alt_kernel %{?with_pax:pax}%{!?with_grsecurity:nogrsecurity}%{?with_pae:pae} |
351f379b JR |
117 | %if "%{__alt_kernel}" != "" |
118 | %define alt_kernel %{__alt_kernel} | |
119 | %endif | |
06936f6f | 120 | %endif # not rescuecd |
121 | %endif # not vanilla | |
122 | %endif # not myown | |
351f379b JR |
123 | |
124 | # kernel release (used in filesystem and eventually in uname -r) | |
125 | # modules will be looked from /lib/modules/%{kernel_release} | |
126 | # localversion is just that without version for "> localversion" | |
127 | %define localversion %{rel} | |
128 | %define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion} | |
a5585a68 AM |
129 | |
130 | Summary: The Linux kernel (the core of the Linux operating system) | |
351f379b JR |
131 | Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems) |
132 | Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum) | |
133 | Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme) | |
134 | Summary(pl.UTF-8): Jądro Linuksa | |
135 | Name: kernel%{_alt_kernel} | |
136 | Version: %{basever}%{postver} | |
137 | Release: %{rel} | |
a5585a68 | 138 | Epoch: 3 |
c491b43b | 139 | License: GPL v2 |
a5585a68 | 140 | Group: Base/Kernel |
67d87e28 JR |
141 | Source0: http://www.kernel.org/pub/linux/kernel/v3.0/linux-%{basever}.tar.bz2 |
142 | # Source0-md5: 398e95866794def22b12dfbc15ce89c0 | |
4d8c31dd | 143 | %if "%{postver}" != ".0" |
8205412a | 144 | Source1: http://www.kernel.org/pub/linux/kernel/v3.0/patch-%{version}.bz2 |
457f0b6e | 145 | # Source1-md5: 1757786b9a9ffbd48ad9642199ff5bd7 |
351f379b JR |
146 | %endif |
147 | ||
148 | Source3: kernel-autoconf.h | |
149 | Source4: kernel-config.h | |
351f379b JR |
150 | Source6: kernel-config.awk |
151 | Source7: kernel-module-build.pl | |
152 | Source8: kernel-track-config-change.awk | |
153 | # not used by kernel.spec, but it's good to have it in SOURCES | |
154 | Source9: kernel-config-sort.pl | |
155 | Source10: kernel.make | |
156 | ||
157 | Source20: kernel-multiarch.config | |
158 | Source21: kernel-x86.config | |
159 | Source22: kernel-sparc.config | |
5a99ae3d | 160 | Source23: kernel-alpha.config |
161 | Source24: kernel-powerpc.config | |
162 | Source25: kernel-ia64.config | |
351f379b | 163 | |
351f379b JR |
164 | Source41: kernel-patches.config |
165 | Source42: kernel-tuxonice.config | |
166 | Source43: kernel-vserver.config | |
167 | Source45: kernel-grsec.config | |
168 | ||
169 | Source49: kernel-pax.config | |
170 | Source50: kernel-no-pax.config | |
351f379b JR |
171 | Source55: kernel-imq.config |
172 | Source56: kernel-reiser4.config | |
173 | Source57: kernel-wrr.config | |
174 | ||
175 | Source58: kernel-inittmpfs.config | |
351f379b | 176 | |
351f379b JR |
177 | # http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.4-2.6.25-rc6.patch |
178 | Patch3: kernel-fbcondecor.patch | |
60bb736d | 179 | Patch4: kernel-fbcon-margins.patch |
1414594b | 180 | Patch5: linux-wistron-amilo8210.patch |
351f379b JR |
181 | |
182 | # netfilter related stuff mostly based on patch-o-matic-ng | |
17da405a | 183 | # snapshot 20070806 with some fixes. Some modules |
e69c45e8 | 184 | # were ported to nf_conntrack. |
351f379b JR |
185 | |
186 | Patch10: kernel-pom-ng-IPV4OPTSSTRIP.patch | |
351f379b | 187 | |
351f379b JR |
188 | Patch16: kernel-pom-ng-mms-conntrack-nat.patch |
189 | Patch22: kernel-pom-ng-rsh.patch | |
190 | Patch23: kernel-pom-ng-rpc.patch | |
191 | ||
192 | # based on http://mike.it-loops.com/rtsp/rtsp-2.6.26.patch | |
193 | Patch36: kernel-nf_rtsp.patch | |
194 | ||
195 | # http://ftp.linux-vserver.org/pub/people/dhozac/p/k/delta-owner-xid-feat02.diff | |
196 | Patch37: kernel-owner-xid.patch | |
197 | ||
351f379b JR |
198 | # based on kernel-2.6.25-layer7-2.20.patch from |
199 | # http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.20.tar.gz | |
200 | Patch40: kernel-layer7.patch | |
201 | ||
351f379b JR |
202 | ### End netfilter |
203 | ||
204 | # http://zph.bratcheda.org/linux-2.6.26.3-zph.patch | |
205 | Patch49: kernel-zph.patch | |
206 | ||
7af23471 | 207 | # based on http://www.linuximq.net/patchs/linux-2.6.39-imq-multiqueue-test1.diff.bz2 |
351f379b JR |
208 | Patch50: kernel-imq.patch |
209 | ||
76514441 | 210 | # http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.35.patch.bz2 |
351f379b JR |
211 | Patch51: kernel-reiser4.patch |
212 | ||
213 | # http://www.zz9.dk/patches/wrr-linux-071203-2.6.25.patch.gz | |
214 | Patch52: kernel-wrr.patch | |
215 | ||
216 | # http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2 | |
60bb736d | 217 | Patch53: kernel-esfq.patch |
351f379b JR |
218 | |
219 | # http://memebeam.org/free-software/toshiba_acpi/toshiba_acpi-dev_toshiba_test5-linux_2.6.26.patch | |
60bb736d | 220 | Patch54: kernel-toshiba_acpi.patch |
351f379b JR |
221 | |
222 | # by Baggins request: | |
223 | # derived from ftp://ftp.cmf.nrl.navy.mil/pub/chas/linux-atm/vbr/vbr-kernel-diffs | |
60bb736d JR |
224 | Patch55: kernel-atm-vbr.patch |
225 | Patch56: kernel-atmdd.patch | |
351f379b | 226 | |
351f379b JR |
227 | # http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch |
228 | Patch59: kernel-rndis_host-wm5.patch | |
229 | ||
230 | # Project suspend2 renamed to tuxonice | |
5a9fc8e8 | 231 | # http://tuxonice.net/files/current-tuxonice-for-2.6.37.patch_0.bz2 |
b3b0d4fd | 232 | # NOTE: currently using own diff from tuxonice git tree until official patch is released |
2524eeef | 233 | # git://git.kernel.org/pub/scm/linux/kernel/git/nigelc/tuxonice-head.git |
e25a3045 KK |
234 | # git://git.kernel.org/pub/scm/linux/kernel/git/nigelc/tuxonice-<basever>.git |
235 | # To produce patch: git diff upstream/master...tuxonice/combined | |
60bb736d JR |
236 | Patch69: kernel-tuxonice.patch |
237 | Patch70: kernel-tuxonice-headers.patch | |
351f379b JR |
238 | |
239 | # adds some ids for hostap suported cards and monitor_enable from/for aircrack-ng | |
240 | # http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch | |
60bb736d | 241 | Patch85: kernel-hostap.patch |
351f379b | 242 | |
05d078be | 243 | # http://vserver.13thfloor.at/Experimental/patch-3.0.1-vs2.3.1-pre9.diff |
60bb736d | 244 | Patch100: kernel-vserver-2.3.patch |
351f379b JR |
245 | Patch101: kernel-vserver-fixes.patch |
246 | ||
247 | # Wake-On-Lan fix for nForce drivers; using http://atlas.et.tudelft.nl/verwei90/nforce2/wol.html | |
248 | # Fix verified for that kernel version. | |
60bb736d | 249 | Patch130: kernel-forcedeth-WON.patch |
351f379b | 250 | |
82260373 | 251 | # http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.8_for_2.6.38-rc7.diff.gz |
351f379b | 252 | Patch140: kernel-unionfs.patch |
351f379b | 253 | |
4a4d8108 | 254 | # http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git, read README |
b752ccd1 AM |
255 | # Patch creation: |
256 | # git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git | |
953406b4 | 257 | # cd aufs2-standalone |
027c5e7a | 258 | # git checkout -b aufs2.1 origin/aufs2.1 |
b752ccd1 AM |
259 | # cat aufs2-kbuild.patch aufs2-base.patch aufs2-standalone.patch > ~/rpm/packages/kernel/kernel-aufs2.patch |
260 | # mkdir linux | |
261 | # cp -a Documentation fs include linux | |
262 | # diff -urN /usr/share/empty linux >> ~/rpm/packages/kernel/kernel-aufs2.patch | |
0c5527e5 | 263 | # |
20493b41 JR |
264 | Patch145: kernel-aufs2.patch |
265 | Patch146: kernel-aufs2-unionfs.patch | |
52daa4ad | 266 | Patch147: kernel-aufs2-no-const-grsec.patch |
4f0767ce | 267 | Patch148: kernel-aufs2-reiser4.patch |
a899ef35 | 268 | |
54fd642e | 269 | # Show normal colors in menuconfig with ncurses ABI 6 |
270 | Patch250: kernel-fix_256colors_menuconfig.patch | |
271 | ||
31f62932 AM |
272 | # https://patchwork.kernel.org/patch/236261/ |
273 | Patch400: kernel-virtio-gl-accel.patch | |
274 | ||
08aa9d92 | 275 | Patch2000: kernel-small_fixes.patch |
60bb736d | 276 | Patch2001: kernel-pwc-uncompress.patch |
351f379b JR |
277 | Patch2003: kernel-regressions.patch |
278 | ||
fc63ffa9 AM |
279 | # 0001-AppArmor-compatibility-patch-for-v5-network-controll.patch |
280 | # 0002-AppArmor-compatibility-patch-for-v5-interface.patch | |
281 | # from http://kernel.org/pub/linux/security/apparmor/apparmor-2.6.36-patches.tgz | |
351f379b | 282 | Patch5000: kernel-apparmor.patch |
351f379b JR |
283 | |
284 | # for rescuecd | |
48ead238 | 285 | # based on ftp://ftp.leg.uct.ac.za/pub/linux/rip/tmpfs_root-2.6.30.diff.gz |
351f379b JR |
286 | Patch7000: kernel-inittmpfs.patch |
287 | ||
5ef30c1f | 288 | # based on http://grsecurity.net/~spender/grsecurity-2.2.2-3.0.3-201108232250.patch |
4a6985f1 AM |
289 | # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference |
290 | # (since upstream deletes older patches) | |
60bb736d JR |
291 | Patch9999: kernel-grsec_full.patch |
292 | Patch10000: kernel-grsec-caps.patch | |
293 | Patch10001: kernel-grsec-common.patch | |
351f379b | 294 | Patch10002: kernel-grsec_fixes.patch |
bf6838be | 295 | |
73cc1c57 | 296 | # Do not remove this line, please. It is easier for me to uncomment two lines, then patch |
297 | # kernel.spec every time. | |
298 | #Patch50000: kernel-usb_reset.patch | |
299 | ||
a5585a68 | 300 | URL: http://www.kernel.org/ |
351f379b | 301 | BuildRequires: binutils >= 3:2.18 |
a5585a68 AM |
302 | %ifarch sparc sparc64 |
303 | BuildRequires: elftoaout | |
304 | %endif | |
351f379b JR |
305 | %ifarch ppc |
306 | BuildRequires: uboot-mkimage | |
307 | %endif | |
351f379b JR |
308 | BuildRequires: /sbin/depmod |
309 | BuildRequires: gcc >= 5:3.2 | |
cfce203c | 310 | BuildRequires: xz >= 1:4.999.7 |
e69c45e8 | 311 | AutoReqProv: no |
d80d232c | 312 | BuildRequires: hostname |
de20e7d7 | 313 | BuildRequires: module-init-tools >= %{module_init_tools_ver} |
a5585a68 | 314 | BuildRequires: perl-base |
b488384f | 315 | BuildRequires: rpm-build >= 4.5-24 |
351f379b JR |
316 | BuildRequires: rpmbuild(macros) >= 1.217 |
317 | Requires(post): coreutils | |
318 | Requires(post): geninitrd >= 10000-3 | |
de20e7d7 | 319 | Requires(post): module-init-tools >= %{module_init_tools_ver} |
351f379b JR |
320 | Requires: /sbin/depmod |
321 | Requires: coreutils | |
322 | Requires: geninitrd >= 10000-3 | |
de20e7d7 | 323 | Requires: module-init-tools >= %{module_init_tools_ver} |
b75546f3 | 324 | Suggests: keyutils |
52e5f3df | 325 | Provides: %{name}(netfilter) = 20070806 |
351f379b JR |
326 | Provides: %{name}(vermagic) = %{kernel_release} |
327 | Obsoletes: kernel%{_alt_kernel}-isdn-mISDN | |
26b1ceeb | 328 | Obsoletes: kernel-firmware |
351f379b JR |
329 | Obsoletes: kernel-misc-acer_acpi |
330 | Obsoletes: kernel-misc-fuse | |
331 | Obsoletes: kernel-misc-uvc | |
a5585a68 | 332 | Obsoletes: kernel-modules |
351f379b JR |
333 | Obsoletes: kernel-net-ar81 |
334 | Obsoletes: kernel-net-hostap | |
335 | Obsoletes: kernel-net-ieee80211 | |
336 | Obsoletes: kernel-net-ipp2p | |
337 | Obsoletes: kernel-net-rt61 | |
338 | Obsoletes: kernel-smp | |
339 | Conflicts: e2fsprogs < 1.29 | |
340 | Conflicts: isdn4k-utils < 3.1pre1 | |
341 | Conflicts: jfsutils < 1.1.3 | |
cf8de22f | 342 | Conflicts: lvm2 < 2.02.40 |
351f379b JR |
343 | Conflicts: nfs-utils < 1.0.5 |
344 | Conflicts: oprofile < 0.9 | |
345 | Conflicts: ppp < 1:2.4.0 | |
346 | Conflicts: procps < 3.2.0 | |
347 | Conflicts: quota-tools < 3.09 | |
4dabe329 | 348 | %{?with_reiserfs4:Conflicts: reiser4progs < 1.0.0} |
351f379b | 349 | Conflicts: reiserfsprogs < 3.6.3 |
4dabe329 | 350 | Conflicts: rpm < 4.4.2-0.2 |
351f379b JR |
351 | Conflicts: udev < 1:081 |
352 | Conflicts: util-linux < 2.10o | |
d3c4e01e | 353 | Conflicts: util-vserver < 0.30.216 |
351f379b JR |
354 | Conflicts: xfsprogs < 2.6.0 |
355 | %if %{with pae} | |
356 | ExcludeArch: i386 i486 i586 | |
357 | %else | |
358 | ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64 | |
359 | %endif | |
a5585a68 AM |
360 | ExclusiveOS: Linux |
361 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
362 | ||
351f379b JR |
363 | %ifarch %{ix86} %{x8664} |
364 | %define target_arch_dir x86 | |
365 | %endif | |
366 | %ifarch ppc ppc64 | |
367 | %define target_arch_dir powerpc | |
368 | %endif | |
5a99ae3d | 369 | %ifarch sparc sparc64 |
370 | %define target_arch_dir sparc | |
371 | %endif | |
372 | %ifnarch %{ix86} %{x8664} ppc ppc64 sparc sparc64 | |
351f379b JR |
373 | %define target_arch_dir %{_target_base_arch} |
374 | %endif | |
375 | ||
376 | %define defconfig arch/%{target_arch_dir}/defconfig | |
377 | ||
378 | # No ELF objects there to strip (skips processing 27k files) | |
ded910ba | 379 | %define _noautostrip \\(.*%{_kernelsrcdir}/.*\\|.*/vmlinux.*\\) |
351f379b JR |
380 | %define _noautochrpath .*%{_kernelsrcdir}/.* |
381 | ||
a5585a68 AM |
382 | %ifarch ia64 |
383 | %define initrd_dir /boot/efi | |
384 | %else | |
385 | %define initrd_dir /boot | |
386 | %endif | |
387 | ||
351f379b | 388 | %define topdir %{_builddir}/%{name}-%{version} |
67d87e28 | 389 | %define srcdir %{topdir}/linux-%{basever} |
351f379b JR |
390 | %define objdir %{topdir}/%{targetobj} |
391 | %define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion) | |
392 | ||
393 | %define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version} | |
394 | ||
395 | %if "%{_target_base_arch}" != "%{_arch}" | |
396 | %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux- | |
397 | %define DepMod /bin/true | |
398 | ||
399 | %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64" | |
400 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
401 | %define DepMod /sbin/depmod | |
402 | %endif | |
403 | ||
404 | %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc" | |
405 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
406 | %define DepMod /sbin/depmod | |
407 | %endif | |
408 | ||
409 | %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386" | |
410 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
411 | %define DepMod /sbin/depmod | |
412 | %endif | |
413 | ||
5a99ae3d | 414 | %if "%{_target_base_arch}" == "ppc" || "%{_target_base_arch}" == "ppc64" |
351f379b JR |
415 | %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux- |
416 | %endif | |
417 | %else | |
418 | %ifarch ppc ppc64 | |
419 | %define CrossOpts ARCH=powerpc CC="%{__cc}" | |
420 | %else | |
421 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
422 | %endif | |
423 | %define DepMod /sbin/depmod | |
424 | %endif | |
425 | %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}" | |
426 | ||
52e5f3df | 427 | %define __features \ |
15a064bf | 428 | %{?with_grsecurity:Grsecurity support - enabled}\ |
351f379b JR |
429 | %{?with_pax:PaX support - enabled}\ |
430 | %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\ | |
431 | %{?with_nfsroot:Root on NFS - enabled}\ | |
351f379b JR |
432 | |
433 | %define Features %(echo "%{__features}" | sed '/^$/d') | |
434 | ||
a5585a68 AM |
435 | %description |
436 | This package contains the Linux kernel that is used to boot and run | |
437 | your system. It contains few device drivers for specific hardware. | |
438 | Most hardware is instead supported by modules loaded after booting. | |
439 | ||
351f379b JR |
440 | %{Features} |
441 | ||
3a467bc1 JR |
442 | %description -l de.UTF-8 |
443 | Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des | |
444 | Linux-Betriebssystems. Der Kernel ist für grundliegende | |
a5585a68 | 445 | Systemfunktionen verantwortlich: Speicherreservierung, |
3a467bc1 | 446 | Prozeß-Management, Geräte Ein- und Ausgaben, usw. |
a5585a68 | 447 | |
351f379b JR |
448 | %{Features} |
449 | ||
3a467bc1 | 450 | %description -l fr.UTF-8 |
a5585a68 | 451 | Le package kernel contient le kernel linux (vmlinuz), la partie |
3a467bc1 JR |
452 | centrale d'un système d'exploitation Linux. Le noyau traite les |
453 | fonctions basiques d'un système d'exploitation: allocation mémoire, | |
454 | allocation de process, entrée/sortie de peripheriques, etc. | |
a5585a68 | 455 | |
351f379b JR |
456 | %{Features} |
457 | ||
3a467bc1 JR |
458 | %description -l pl.UTF-8 |
459 | Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania | |
460 | Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego | |
461 | się w komputerze, takiego jak sterowniki dysków itp. | |
a5585a68 | 462 | |
351f379b JR |
463 | %{Features} |
464 | ||
465 | %package vmlinux | |
466 | Summary: vmlinux - uncompressed kernel image | |
467 | Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild | |
468 | Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra | |
469 | Group: Base/Kernel | |
470 | Obsoletes: kernel-smp-vmlinux | |
471 | ||
472 | %description vmlinux | |
473 | vmlinux - uncompressed kernel image. | |
474 | ||
475 | %description vmlinux -l de.UTF-8 | |
476 | vmlinux - dekompressiertes Kernel Bild. | |
477 | ||
478 | %description vmlinux -l pl.UTF-8 | |
479 | vmlinux - rozpakowany obraz jądra. | |
480 | ||
a5585a68 AM |
481 | %package drm |
482 | Summary: DRM kernel modules | |
351f379b JR |
483 | Summary(de.UTF-8): DRM Kernel Treiber |
484 | Summary(pl.UTF-8): Sterowniki DRM | |
a5585a68 | 485 | Group: Base/Kernel |
351f379b JR |
486 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
487 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
488 | Obsoletes: kernel-smp-drm | |
07ff8614 | 489 | AutoReqProv: no |
a5585a68 AM |
490 | |
491 | %description drm | |
351f379b JR |
492 | DRM kernel modules. |
493 | ||
494 | %description drm -l de.UTF-8 | |
495 | DRM Kernel Treiber. | |
a5585a68 | 496 | |
3a467bc1 | 497 | %description drm -l pl.UTF-8 |
351f379b | 498 | Sterowniki DRM. |
a5585a68 AM |
499 | |
500 | %package pcmcia | |
501 | Summary: PCMCIA modules | |
351f379b JR |
502 | Summary(de.UTF-8): PCMCIA Module |
503 | Summary(pl.UTF-8): Moduły PCMCIA | |
a5585a68 | 504 | Group: Base/Kernel |
351f379b JR |
505 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
506 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
507 | Obsoletes: kernel-smp-pcmcia | |
508 | Conflicts: pcmcia-cs < 3.1.21 | |
509 | Conflicts: pcmciautils < 004 | |
07ff8614 | 510 | AutoReqProv: no |
a5585a68 AM |
511 | |
512 | %description pcmcia | |
351f379b JR |
513 | PCMCIA modules. |
514 | ||
515 | %description pcmcia -l de.UTF-8 | |
516 | PCMCIA Module. | |
a5585a68 | 517 | |
3a467bc1 | 518 | %description pcmcia -l pl.UTF-8 |
351f379b JR |
519 | Moduły PCMCIA. |
520 | ||
a5585a68 AM |
521 | %package sound-alsa |
522 | Summary: ALSA kernel modules | |
351f379b JR |
523 | Summary(de.UTF-8): ALSA Kernel Module |
524 | Summary(pl.UTF-8): Sterowniki dźwięku ALSA | |
a5585a68 | 525 | Group: Base/Kernel |
351f379b JR |
526 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
527 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
528 | Obsoletes: kernel-smp-sound-alsa | |
07ff8614 | 529 | AutoReqProv: no |
a5585a68 AM |
530 | |
531 | %description sound-alsa | |
532 | ALSA (Advanced Linux Sound Architecture) sound drivers. | |
533 | ||
351f379b JR |
534 | %description sound-alsa -l de.UTF-8 |
535 | ALSA (Advanced Linux Sound Architecture) Sound-Treiber. | |
536 | ||
3a467bc1 JR |
537 | %description sound-alsa -l pl.UTF-8 |
538 | Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture). | |
a5585a68 AM |
539 | |
540 | %package sound-oss | |
541 | Summary: OSS kernel modules | |
351f379b JR |
542 | Summary(de.UTF-8): OSS Kernel Module |
543 | Summary(pl.UTF-8): Sterowniki dźwięku OSS | |
a5585a68 | 544 | Group: Base/Kernel |
351f379b JR |
545 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
546 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
547 | Obsoletes: kernel-smp-sound-oss | |
07ff8614 | 548 | AutoReqProv: no |
a5585a68 AM |
549 | |
550 | %description sound-oss | |
551 | OSS (Open Sound System) drivers. | |
552 | ||
351f379b JR |
553 | %description sound-oss -l de.UTF-8 |
554 | OSS (Open Sound System) Treiber. | |
555 | ||
3a467bc1 JR |
556 | %description sound-oss -l pl.UTF-8 |
557 | Sterowniki dźwięku OSS (Open Sound System). | |
a5585a68 | 558 | |
a5585a68 AM |
559 | %package headers |
560 | Summary: Header files for the Linux kernel | |
351f379b JR |
561 | Summary(de.UTF-8): Header Dateien für den Linux-Kernel |
562 | Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa | |
563 | Group: Development/Building | |
52e5f3df | 564 | Provides: %{name}-headers(netfilter) = 20070806 |
07ff8614 | 565 | AutoReqProv: no |
a5585a68 AM |
566 | |
567 | %description headers | |
568 | These are the C header files for the Linux kernel, which define | |
351f379b JR |
569 | structures and constants that are needed when rebuilding the kernel or |
570 | building kernel modules. | |
571 | ||
572 | %description headers -l de.UTF-8 | |
573 | Dies sind die C Header Dateien für den Linux-Kernel, die definierte | |
574 | Strukturen und Konstante beinhalten, die beim rekompilieren des | |
575 | Kernels oder bei Kernel Modul kompilationen gebraucht werden. | |
a5585a68 | 576 | |
3a467bc1 JR |
577 | %description headers -l pl.UTF-8 |
578 | Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra | |
579 | oraz budowania modułów jądra. | |
a5585a68 AM |
580 | |
581 | %package module-build | |
582 | Summary: Development files for building kernel modules | |
351f379b JR |
583 | Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebraucht werden |
584 | Summary(pl.UTF-8): Pliki służące do budowania modułów jądra | |
585 | Group: Development/Building | |
a5585a68 | 586 | Requires: %{name}-headers = %{epoch}:%{version}-%{release} |
fd19fa89 | 587 | Conflicts: rpmbuild(macros) < 1.550 |
07ff8614 | 588 | AutoReqProv: no |
a5585a68 AM |
589 | |
590 | %description module-build | |
591 | Development files from kernel source tree needed to build Linux kernel | |
592 | modules from external packages. | |
593 | ||
351f379b JR |
594 | %description module-build -l de.UTF-8 |
595 | Development Dateien des Linux-Kernels die beim kompilieren externer | |
596 | Kernel Module gebraucht werden. | |
597 | ||
3a467bc1 JR |
598 | %description module-build -l pl.UTF-8 |
599 | Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra | |
600 | Linuksa z zewnętrznych pakietów. | |
a5585a68 AM |
601 | |
602 | %package source | |
603 | Summary: Kernel source tree | |
351f379b JR |
604 | Summary(de.UTF-8): Der Kernel Quelltext |
605 | Summary(pl.UTF-8): Kod źródłowy jądra Linuksa | |
606 | Group: Development/Building | |
a5585a68 | 607 | Requires: %{name}-module-build = %{epoch}:%{version}-%{release} |
07ff8614 | 608 | AutoReqProv: no |
a5585a68 AM |
609 | |
610 | %description source | |
351f379b JR |
611 | This is the source code for the Linux kernel. You can build a custom |
612 | kernel that is better tuned to your particular hardware. | |
a5585a68 | 613 | |
3a467bc1 JR |
614 | %description source -l de.UTF-8 |
615 | Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des | |
a5585a68 | 616 | Linux-Kernels. Die Source-Dateien werden gebraucht, um viele |
351f379b | 617 | C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die |
3a467bc1 | 618 | im Kernel-Source definiert sind. Die Source-Dateien können auch |
351f379b | 619 | benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre |
a5585a68 AM |
620 | Hardware ausgerichtet ist. |
621 | ||
3a467bc1 | 622 | %description source -l fr.UTF-8 |
a5585a68 | 623 | Le package pour le kernel-source contient le code source pour le noyau |
3a467bc1 JR |
624 | linux. Ces sources sont nécessaires pour compiler la plupart des |
625 | programmes C, car il dépend de constantes définies dans le code | |
626 | source. Les sources peuvent être aussi utilisée pour compiler un noyau | |
627 | personnalisé pour avoir de meilleures performances sur des matériels | |
a5585a68 AM |
628 | particuliers. |
629 | ||
3a467bc1 JR |
630 | %description source -l pl.UTF-8 |
631 | Pakiet zawiera kod źródłowy jądra systemu. | |
a5585a68 AM |
632 | |
633 | %package doc | |
634 | Summary: Kernel documentation | |
351f379b JR |
635 | Summary(de.UTF-8): Kernel Dokumentation |
636 | Summary(pl.UTF-8): Dokumentacja do jądra Linuksa | |
637 | Group: Documentation | |
07ff8614 | 638 | AutoReqProv: no |
a5585a68 AM |
639 | |
640 | %description doc | |
641 | This is the documentation for the Linux kernel, as found in | |
642 | /usr/src/linux/Documentation directory. | |
643 | ||
351f379b JR |
644 | %description doc -l de.UTF-8 |
645 | Dies ist die Kernel Dokumentation wie sie im 'Documentation' | |
646 | Verzeichniss vorgefunden werden kann. | |
647 | ||
3a467bc1 JR |
648 | %description doc -l pl.UTF-8 |
649 | Pakiet zawiera dokumentację do jądra Linuksa pochodzącą z katalogu | |
a5585a68 AM |
650 | /usr/src/linux/Documentation. |
651 | ||
652 | %prep | |
351f379b JR |
653 | %setup -qc |
654 | ln -s %{SOURCE7} kernel-module-build.pl | |
655 | ln -s %{SOURCE10} Makefile | |
67d87e28 | 656 | cd linux-%{basever} |
a5585a68 | 657 | |
351f379b | 658 | # hack against warning in pax/grsec |
351f379b | 659 | sed -i 's/-Werror//' arch/alpha/kernel/Makefile |
a5585a68 | 660 | |
1c5b0f0a | 661 | %if "%{postver}" != ".0" |
351f379b JR |
662 | %{__bzip2} -dc %{SOURCE1} | patch -p1 -s |
663 | %endif | |
a5585a68 | 664 | |
7141a3b6 | 665 | %if %{without vanilla} |
666 | ||
351f379b JR |
667 | # tuxonice: |
668 | %if %{with tuxonice} | |
351f379b JR |
669 | %patch69 -p1 |
670 | %patch70 -p1 | |
351f379b | 671 | %endif |
bf6838be | 672 | |
351f379b JR |
673 | %if %{with fbcondecor} |
674 | %patch3 -p1 | |
a5585a68 | 675 | %endif |
351f379b | 676 | %patch4 -p1 |
1414594b | 677 | %patch5 -p1 |
a5585a68 | 678 | |
351f379b JR |
679 | ## netfilter |
680 | # | |
a5585a68 | 681 | |
351f379b JR |
682 | # kernel-pom-ng-IPV4OPTSSTRIP.patch |
683 | %patch10 -p1 | |
a5585a68 | 684 | |
351f379b JR |
685 | # kernel-pom-ng-mms-conntrack-nat.patch |
686 | %patch16 -p1 | |
a5585a68 | 687 | |
351f379b JR |
688 | # kernel-pom-ng-rsh.patch |
689 | %patch22 -p1 | |
a5585a68 | 690 | |
351f379b JR |
691 | # kernel-pom-ng-rpc.patch |
692 | %patch23 -p1 | |
a5585a68 | 693 | |
351f379b JR |
694 | # kernel-nf_rtsp.patch |
695 | %patch36 -p1 | |
a5585a68 | 696 | |
351f379b JR |
697 | # kernel-owner-xid.patch |
698 | %if %{with vserver} | |
699 | %patch37 -p1 | |
a5585a68 | 700 | %endif |
a5585a68 | 701 | |
351f379b JR |
702 | # kernel-layer7.patch |
703 | %patch40 -p1 | |
704 | ||
351f379b JR |
705 | ## |
706 | # end of netfilter | |
707 | ||
708 | # zph | |
709 | %patch49 -p1 | |
710 | ||
711 | %if %{with imq} | |
712 | %patch50 -p1 | |
a5585a68 | 713 | %endif |
351f379b JR |
714 | |
715 | # reiser4 | |
716 | %if %{with reiser4} | |
717 | %patch51 -p1 | |
a5585a68 | 718 | %endif |
351f379b | 719 | |
351f379b | 720 | # esfq |
068b6c82 AM |
721 | %if %{with esfq} |
722 | %patch53 -p1 | |
723 | %endif | |
351f379b JR |
724 | |
725 | %if %{with wrr} | |
726 | %patch52 -p1 | |
a5585a68 | 727 | %endif |
351f379b JR |
728 | |
729 | # toshiba_acpi | |
730 | %patch54 -p1 | |
731 | ||
732 | %patch55 -p1 | |
733 | %patch56 -p1 | |
734 | ||
351f379b JR |
735 | # kernel-rndis_host-wm5.patch |
736 | %patch59 -p1 | |
737 | ||
738 | # hostap enhancements from/for aircrack-ng | |
739 | %patch85 -p1 | |
740 | ||
351f379b JR |
741 | # vserver |
742 | %if %{with vserver} | |
743 | %patch100 -p1 | |
744 | %patch101 -p1 | |
a5585a68 | 745 | %endif |
351f379b | 746 | |
351f379b JR |
747 | # forcedeth |
748 | %patch130 -p1 | |
a5585a68 | 749 | |
17da405a | 750 | # aufs2 |
4f0767ce JR |
751 | %if %{with reiser4} |
752 | %patch148 -p1 | |
753 | %endif | |
20493b41 JR |
754 | %patch145 -p1 |
755 | %patch146 -p1 | |
756 | ||
757 | # unionfs | |
758 | %patch140 -p1 | |
a5585a68 | 759 | |
351f379b JR |
760 | %if %{with rescuecd} |
761 | %patch7000 -p1 | |
e981df17 | 762 | %endif |
a5585a68 | 763 | |
351f379b JR |
764 | # grsecurity & pax stuff |
765 | # | |
351f379b | 766 | |
17da405a | 767 | %if %{with grsecurity} |
b2fd5bd8 | 768 | %patch9999 -p1 |
52daa4ad | 769 | # aufs needs this |
285f3774 | 770 | %patch147 -p1 |
b2fd5bd8 JR |
771 | %{?with_vserver:%patch10000 -p1} |
772 | %{?with_vserver:%patch10001 -p1} | |
773 | %{?with_vserver:%patch10002 -p1} | |
351f379b | 774 | %endif |
351f379b JR |
775 | # |
776 | # end of grsecurity & pax stuff | |
777 | ||
df4db69a | 778 | # apparmor |
df4db69a | 779 | %patch5000 -p1 |
df4db69a | 780 | |
54fd642e | 781 | %patch250 -p1 |
782 | ||
31f62932 AM |
783 | # virtio-gl |
784 | %patch400 -p1 | |
785 | ||
7141a3b6 | 786 | %endif # vanilla |
787 | ||
351f379b | 788 | # Small fixes: |
08aa9d92 | 789 | %patch2000 -p1 |
351f379b JR |
790 | %patch2001 -p1 |
791 | #%patch2003 -p1 | |
a5585a68 | 792 | |
73cc1c57 | 793 | # Do not remove this, please! |
794 | #%patch50000 -p1 | |
795 | ||
351f379b | 796 | # Fix EXTRAVERSION in main Makefile |
1c5b0f0a | 797 | sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile |
a5585a68 | 798 | |
351f379b JR |
799 | # cleanup backups after patching |
800 | find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f | |
a5585a68 | 801 | |
351f379b JR |
802 | %build |
803 | install -d %{objdir} | |
804 | cat > %{targetobj}.mk <<'EOF' | |
805 | # generated by %{name}.spec | |
d85d4a9b | 806 | KERNELSRC := %{srcdir} |
351f379b JR |
807 | KERNELOUTPUT := %{objdir} |
808 | ||
809 | SRCARCH := %{target_arch_dir} | |
810 | ARCH := %{_target_base_arch} | |
811 | Q := %{!?with_verbose:@} | |
812 | MAKE_OPTS := %{MakeOpts} | |
813 | DEFCONFIG := %{defconfig} | |
814 | EOF | |
a5585a68 | 815 | |
351f379b JR |
816 | PaXconfig() { |
817 | set -x | |
818 | cat <<-EOCONFIG > $1 | |
819 | %ifarch %{ix86} | |
820 | CONFIG_PAX_SEGMEXEC=y | |
821 | # performance impact on CPUs without NX bit | |
822 | CONFIG_PAX_PAGEEXEC=n | |
823 | # Testing KERNEXEC | |
824 | ||
825 | CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n | |
826 | CONFIG_PCI_BIOS=n | |
827 | CONFIG_EFI=n | |
828 | %endif | |
a5585a68 | 829 | |
351f379b JR |
830 | %ifarch ppc64 |
831 | CONFIG_PAX_NOELFRELOCS=n | |
832 | %endif | |
833 | %ifarch ppc | |
834 | CONFIG_PAX_EMUTRAMP=y | |
835 | CONFIG_PAX_EMUSIGRT=y | |
836 | CONFIG_PAX_EMUPLT=y | |
837 | %endif | |
a5585a68 | 838 | |
351f379b JR |
839 | %ifarch sparc sparc64 alpha |
840 | CONFIG_PAX_EMUPLT=y | |
841 | %endif | |
a5585a68 | 842 | |
d615e060 | 843 | # Now we have to check MAC system integration. Grsecurity uses PAX_HAVE_ACL_FLAGS |
351f379b JR |
844 | # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably |
845 | # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used | |
e69c45e8 | 846 | # PAX_HOOK_ACL_FLAGS. |
351f379b | 847 | |
15a064bf | 848 | %if %{with grsecurity} |
351f379b JR |
849 | # Hardening grsec options if with pax |
850 | CONFIG_GRKERNSEC_PROC_MEMMAP=y | |
851 | # almost rational (see HIDESYM help) | |
852 | CONFIG_GRKERNSEC_HIDESYM=y | |
853 | ||
854 | # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config | |
855 | %else | |
351f379b JR |
856 | CONFIG_PAX_HAVE_ACL_FLAGS=n |
857 | CONFIG_PAX_HOOK_ACL_FLAGS=y | |
858 | %endif | |
859 | EOCONFIG | |
a5585a68 | 860 | |
351f379b JR |
861 | return 0 |
862 | } | |
a5585a68 | 863 | |
351f379b JR |
864 | RescueConfig() { |
865 | set -x | |
866 | cat <<-EOCONFIG > $1 | |
867 | # CONFIG_SOUND is not set | |
868 | # CONFIG_AUDIT is not set | |
869 | # CONFIG_TR is not set | |
870 | # CONFIG_BT is not set | |
871 | # CONFIG_VIDEO_DEV is not set | |
872 | # CONFIG_DVB_CORE is not set | |
873 | # CONFIG_HAMRADIO is not set | |
874 | # CONFIG_ARCNET is not set | |
875 | # CONFIG_FB is not set | |
876 | # CONFIG_DRM is not set | |
877 | # CONFIG_WATCHDOG is not set | |
878 | # CONFIG_INPUT_JOYSTICK is not set | |
879 | # CONFIG_DEBUG_KERNEL is not set | |
880 | # CONFIG_ISDN is not set | |
881 | # CONFIG_AGP is not set | |
882 | # CONFIG_SECURITY is not set | |
883 | # CONFIG_PARIDE is not set | |
884 | # CONFIG_CPU_FREQ is not set | |
885 | # CONFIG_GAMEPORT is not set | |
886 | # CONFIG_KVM is not set | |
887 | # CONFIG_PHONE is not set | |
dd55897d | 888 | # CONFIG_STRICT_DEVMEM is not set |
6bab3a31 | 889 | # CONFIG_IMA is not set |
351f379b | 890 | CONFIG_AUFS=y |
a899ef35 | 891 | CONFIG_AUFS_FS=y |
892 | CONFIG_AUFS_BR_RAMFS=y | |
62fff140 | 893 | CONFIG_AUFS_RDU=y |
351f379b JR |
894 | CONFIG_BLK_DEV_LOOP=y |
895 | CONFIG_ISO9660_FS=y | |
896 | CONFIG_NLS_UTF8=y | |
6b79006d | 897 | CONFIG_SQUASHFS=y |
351f379b JR |
898 | EOCONFIG |
899 | ||
900 | return 0 | |
901 | } | |
a5585a68 | 902 | |
351f379b JR |
903 | BuildConfig() { |
904 | %{?debug:set -x} | |
905 | set -e | |
a5585a68 | 906 | |
351f379b JR |
907 | Config="kernel-%{target_arch_dir}.config" |
908 | echo >&2 "Building config file for %{_target_cpu} using $Config et al." | |
a5585a68 | 909 | |
351f379b JR |
910 | # prepare local and important options |
911 | cat <<-EOCONFIG > important.config | |
912 | LOCALVERSION="-%{localversion}" | |
fb4e3822 | 913 | |
351f379b JR |
914 | %if 0%{?debug:1} |
915 | CONFIG_DEBUG_SLAB=y | |
916 | CONFIG_DEBUG_SLAB_LEAK=y | |
917 | CONFIG_DEBUG_PREEMPT=y | |
918 | CONFIG_RT_DEADLOCK_DETECT=y | |
a5585a68 | 919 | %endif |
351f379b | 920 | |
351f379b JR |
921 | %if %{without ipv6} |
922 | CONFIG_IPV6=n | |
923 | %endif | |
a5585a68 | 924 | |
351f379b JR |
925 | %ifarch i686 athlon pentium3 pentium4 |
926 | %if %{with pae} | |
927 | CONFIG_HIGHMEM4G=n | |
928 | CONFIG_HIGHMEM64G=y | |
929 | CONFIG_X86_PAE=y | |
7c99a84b | 930 | CONFIG_NUMA=n |
351f379b JR |
931 | %endif |
932 | %endif | |
a5585a68 | 933 | |
351f379b JR |
934 | %if %{without pcmcia} |
935 | CONFIG_PCMCIA=n | |
936 | %endif | |
a5585a68 | 937 | |
351f379b JR |
938 | %if %{with fbcondecor} |
939 | CONFIG_FB_S3=n | |
940 | CONFIG_FB_VT8623=n | |
941 | CONFIG_FB_ARK=n | |
942 | CONFIG_FB_TILEBLITTING=n | |
943 | CONFIG_FB_CON_DECOR=y | |
944 | %endif | |
a5585a68 | 945 | |
351f379b JR |
946 | %if %{with nfsroot} |
947 | CONFIG_NFS_FS=y | |
948 | CONFIG_ROOT_NFS=y | |
949 | %endif | |
a5585a68 | 950 | |
351f379b | 951 | # Temporary disabled RELOCATABLE. Needed only on x86?? |
15a064bf | 952 | %if %{with pax} || %{with grsecurity} |
351f379b JR |
953 | CONFIG_RELOCATABLE=n |
954 | %endif | |
955 | EOCONFIG | |
a5585a68 | 956 | |
351f379b JR |
957 | %if %{with rescuecd} |
958 | RescueConfig rescue.config | |
959 | %endif | |
17da405a | 960 | %if %{with pax} |
351f379b JR |
961 | PaXconfig pax.config |
962 | %endif | |
a5585a68 | 963 | |
351f379b JR |
964 | # prepare kernel-style config file from multiple config files |
965 | %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \ | |
101ae904 | 966 | %if %{with myown} |
967 | $RPM_SOURCE_DIR/kernel-%{alt_kernel}.config \ | |
968 | %endif | |
351f379b | 969 | important.config \ |
7141a3b6 | 970 | %if %{without vanilla} |
351f379b JR |
971 | %if %{with rescuecd} |
972 | %{SOURCE58} \ | |
351f379b JR |
973 | rescue.config \ |
974 | %endif | |
975 | \ | |
17da405a | 976 | %if %{with pax} |
351f379b JR |
977 | %{SOURCE45} \ |
978 | %{SOURCE49} \ | |
979 | pax.config \ | |
980 | %else | |
15a064bf | 981 | %if %{with grsecurity} |
351f379b JR |
982 | %{SOURCE45} \ |
983 | %{SOURCE50} \ | |
351f379b | 984 | %endif |
351f379b JR |
985 | %endif |
986 | \ | |
987 | %if %{with reiser4} | |
988 | %{SOURCE56} \ | |
989 | %endif | |
990 | %if %{with wrr} | |
991 | %{SOURCE57} \ | |
992 | %endif | |
993 | %if %{with imq} | |
994 | %{SOURCE55} \ | |
995 | %endif | |
996 | %if %{with vserver} | |
997 | %{SOURCE43} \ | |
998 | %endif | |
999 | %if %{with tuxonice} | |
1000 | %ifarch %{ix86} %{x8664} ia64 ppc ppc64 | |
1001 | %{SOURCE42} \ | |
1002 | %endif | |
351f379b | 1003 | %endif |
351f379b | 1004 | %{SOURCE41} %{?0:patches} \ |
7141a3b6 | 1005 | %endif |
351f379b JR |
1006 | %{SOURCE20} \ |
1007 | $RPM_SOURCE_DIR/$Config | |
1008 | } | |
a5585a68 | 1009 | |
351f379b JR |
1010 | cd %{objdir} |
1011 | install -d arch/%{target_arch_dir} | |
351f379b | 1012 | BuildConfig > %{defconfig} |
351f379b JR |
1013 | ln -sf %{defconfig} .config |
1014 | cd - | |
a5585a68 | 1015 | |
7856c5e8 AM |
1016 | %{__make} \ |
1017 | TARGETOBJ=%{targetobj} \ | |
1018 | %{?with_verbose:V=1} \ | |
1019 | oldconfig | |
a5585a68 | 1020 | |
351f379b | 1021 | %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config |
a5585a68 | 1022 | |
351f379b | 1023 | # build kernel |
7856c5e8 AM |
1024 | %{__make} \ |
1025 | TARGETOBJ=%{targetobj} \ | |
1026 | %{?with_verbose:V=1} \ | |
1027 | all | |
a5585a68 | 1028 | |
351f379b JR |
1029 | %install |
1030 | rm -rf $RPM_BUILD_ROOT | |
4505b6c5 | 1031 | %{__make} %{MakeOpts} -j1 %{!?with_verbose:-s} modules_install firmware_install \ |
351f379b JR |
1032 | -C %{objdir} \ |
1033 | %{?with_verbose:V=1} \ | |
1034 | DEPMOD=%{DepMod} \ | |
1035 | INSTALL_MOD_PATH=$RPM_BUILD_ROOT \ | |
1036 | INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware/%{kernel_release} \ | |
1037 | KERNELRELEASE=%{kernel_release} | |
1038 | ||
1039 | install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc | |
1040 | ||
101ae904 | 1041 | # create directories which may be missing, to simplyfy %files |
64d14572 | 1042 | install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm} |
101ae904 | 1043 | |
351f379b JR |
1044 | # rpm obeys filelinkto checks for ghosted symlinks, convert to files |
1045 | rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source} | |
1046 | touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source} | |
1047 | ||
6d54bd67 ER |
1048 | # no point embed content for %ghost files. empty them |
1049 | for a in \ | |
1050 | dep{,.bin} \ | |
1051 | alias{,.bin} \ | |
8ee3ac38 AM |
1052 | devname \ |
1053 | softdep \ | |
6d54bd67 ER |
1054 | symbols{,.bin} \ |
1055 | {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \ | |
1056 | ; do | |
09e63f4a | 1057 | test -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a |
6d54bd67 ER |
1058 | > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a |
1059 | done | |
1060 | ||
351f379b JR |
1061 | # /boot |
1062 | install -d $RPM_BUILD_ROOT/boot | |
1063 | cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release} | |
1064 | %ifarch %{ix86} %{x8664} | |
1db9a2c1 ER |
1065 | cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1066 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release} | |
351f379b JR |
1067 | %endif |
1068 | %ifarch ppc ppc64 | |
1db9a2c1 ER |
1069 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1070 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release} | |
a5585a68 | 1071 | %endif |
a5585a68 | 1072 | %ifarch ia64 |
1db9a2c1 ER |
1073 | %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz |
1074 | cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/efi/vmlinuz-%{kernel_release} | |
1075 | ln -sf efi/vmlinuz-%{kernel_release} $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} | |
351f379b JR |
1076 | %endif |
1077 | %ifarch alpha sparc sparc64 | |
1078 | %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz | |
1079 | cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} | |
1db9a2c1 ER |
1080 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1081 | %ifarch sparc | |
1082 | elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout | |
1083 | install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release} | |
1084 | %endif | |
1085 | %ifarch sparc64 | |
1086 | elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout | |
1087 | install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release} | |
1088 | %endif | |
351f379b JR |
1089 | %endif |
1090 | %ifarch arm | |
1db9a2c1 | 1091 | install -p %{objdir}/arch/arm/boot/zImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
a5585a68 | 1092 | %endif |
a5585a68 | 1093 | |
351f379b JR |
1094 | # ghosted initrd |
1095 | touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz | |
a5585a68 | 1096 | |
351f379b JR |
1097 | %if "%{_target_base_arch}" != "%{_arch}" |
1098 | touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep | |
1099 | %endif | |
a5585a68 | 1100 | |
351f379b JR |
1101 | # /etc/modrobe.d |
1102 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release} | |
a5585a68 | 1103 | |
351f379b | 1104 | # /usr/src/linux |
11b2646e | 1105 | install -d $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated |
351f379b JR |
1106 | # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition |
1107 | if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then | |
1108 | l=l | |
1109 | rm -f $RPM_BUILD_ROOT/COPYING | |
a5585a68 | 1110 | fi |
a5585a68 | 1111 | |
351f379b JR |
1112 | cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir} |
1113 | cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist | |
1114 | cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist | |
11b2646e AM |
1115 | cp -a %{objdir}/include/generated/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf-dist.h |
1116 | cp -a %{objdir}/include/generated/utsrelease.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated | |
1117 | cp -a %{objdir}/include/linux/version.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux | |
1118 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf.h | |
351f379b JR |
1119 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h |
1120 | ||
1121 | # collect module-build files and directories | |
1122 | # Usage: kernel-module-build.pl $rpmdir $fileoutdir | |
1123 | fileoutdir=$(pwd) | |
1124 | cd $RPM_BUILD_ROOT%{_kernelsrcdir} | |
1125 | %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir | |
1126 | cd - | |
1127 | ||
30f08736 ER |
1128 | # move to %{_docdir} so we wouldn't depend on any kernel package for dirs |
1129 | install -d $RPM_BUILD_ROOT%{_docdir} | |
1130 | mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}} | |
1131 | ||
d3a69071 ER |
1132 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff |
1133 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile | |
1134 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile | |
1135 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile | |
1136 | ||
351f379b JR |
1137 | %clean |
1138 | rm -rf $RPM_BUILD_ROOT | |
1139 | ||
1140 | %preun | |
1141 | if [ -x /sbin/new-kernel-pkg ]; then | |
1142 | /sbin/new-kernel-pkg --remove %{kernel_release} | |
a5585a68 | 1143 | fi |
351f379b JR |
1144 | |
1145 | %post | |
1146 | %ifarch ia64 | |
1147 | mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null | |
1148 | %{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null} | |
1149 | ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz | |
1150 | %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}} | |
1151 | %endif | |
1152 | mv -f /boot/vmlinuz{,.old} 2> /dev/null | |
1153 | %{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null} | |
1154 | mv -f /boot/System.map{,.old} 2> /dev/null | |
1155 | %{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null} | |
1156 | ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz | |
1157 | %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}} | |
1158 | ln -sf System.map-%{kernel_release} /boot/System.map | |
1159 | %{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}} | |
1160 | ||
1161 | %depmod %{kernel_release} | |
1162 | ||
4dabe329 ER |
1163 | %posttrans |
1164 | # generate initrd after all dependant modules are installed | |
351f379b JR |
1165 | /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release} |
1166 | mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null | |
1167 | %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null} | |
1168 | ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd | |
1169 | %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}} | |
1170 | ||
4dabe329 | 1171 | # update boot loaders when old package files are gone from filesystem |
c5de1ad5 | 1172 | if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then |
4dabe329 ER |
1173 | if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-no})" = "yes" ]; then |
1174 | /sbin/update-grub >/dev/null | |
c5de1ad5 ER |
1175 | fi |
1176 | fi | |
351f379b JR |
1177 | if [ -x /sbin/new-kernel-pkg ]; then |
1178 | /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}" | |
0bb27755 ER |
1179 | fi |
1180 | if [ -x /sbin/rc-boot ]; then | |
351f379b | 1181 | /sbin/rc-boot 1>&2 || : |
a5585a68 | 1182 | fi |
a5585a68 | 1183 | |
351f379b JR |
1184 | %post vmlinux |
1185 | mv -f /boot/vmlinux{,.old} 2> /dev/null | |
1186 | %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null} | |
1187 | ln -sf vmlinux-%{kernel_release} /boot/vmlinux | |
1188 | %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}} | |
1189 | ||
351f379b JR |
1190 | %post drm |
1191 | %depmod %{kernel_release} | |
a5585a68 | 1192 | |
351f379b JR |
1193 | %postun drm |
1194 | %depmod %{kernel_release} | |
a5585a68 | 1195 | |
351f379b JR |
1196 | %post pcmcia |
1197 | %depmod %{kernel_release} | |
a5585a68 | 1198 | |
351f379b JR |
1199 | %postun pcmcia |
1200 | %depmod %{kernel_release} | |
a5585a68 | 1201 | |
351f379b JR |
1202 | %post sound-alsa |
1203 | %depmod %{kernel_release} | |
a5585a68 | 1204 | |
351f379b JR |
1205 | %postun sound-alsa |
1206 | %depmod %{kernel_release} | |
a5585a68 | 1207 | |
351f379b JR |
1208 | %post sound-oss |
1209 | %depmod %{kernel_release} | |
a5585a68 | 1210 | |
351f379b JR |
1211 | %postun sound-oss |
1212 | %depmod %{kernel_release} | |
a5585a68 AM |
1213 | |
1214 | %post headers | |
351f379b | 1215 | ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel} |
a5585a68 AM |
1216 | |
1217 | %postun headers | |
351f379b JR |
1218 | if [ "$1" = "0" ]; then |
1219 | if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then | |
1220 | if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then | |
1221 | rm -f %{_prefix}/src/linux%{_alt_kernel} | |
a5585a68 AM |
1222 | fi |
1223 | fi | |
1224 | fi | |
1225 | ||
351f379b JR |
1226 | %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release} |
1227 | ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build | |
1228 | ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source | |
1229 | ||
1230 | %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release} | |
1231 | if [ "$1" = 0 ]; then | |
1232 | rm -f /lib/modules/%{kernel_release}/{build,source} | |
1233 | fi | |
1234 | ||
a5585a68 AM |
1235 | %files |
1236 | %defattr(644,root,root,755) | |
a5585a68 | 1237 | %ifarch sparc sparc64 |
351f379b | 1238 | /boot/vmlinux.aout-%{kernel_release} |
a5585a68 AM |
1239 | %endif |
1240 | %ifarch ia64 | |
351f379b JR |
1241 | /boot/efi/vmlinuz-%{kernel_release} |
1242 | %endif | |
1243 | /boot/vmlinuz-%{kernel_release} | |
1244 | /boot/System.map-%{kernel_release} | |
1245 | %ghost %{initrd_dir}/initrd-%{kernel_release}.gz | |
ae1c66e5 | 1246 | /lib/firmware/%{kernel_release} |
351f379b JR |
1247 | |
1248 | %dir /lib/modules/%{kernel_release} | |
1249 | %dir /lib/modules/%{kernel_release}/kernel | |
351f379b | 1250 | /lib/modules/%{kernel_release}/kernel/arch |
351f379b JR |
1251 | /lib/modules/%{kernel_release}/kernel/crypto |
1252 | /lib/modules/%{kernel_release}/kernel/drivers | |
101ae904 | 1253 | %if %{have_drm} |
351f379b JR |
1254 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu |
1255 | %endif | |
1256 | /lib/modules/%{kernel_release}/kernel/fs | |
351f379b | 1257 | /lib/modules/%{kernel_release}/kernel/kernel |
351f379b JR |
1258 | /lib/modules/%{kernel_release}/kernel/lib |
1259 | /lib/modules/%{kernel_release}/kernel/net | |
fecce547 | 1260 | /lib/modules/%{kernel_release}/kernel/mm |
101ae904 | 1261 | %if %{have_sound} |
351f379b JR |
1262 | %dir /lib/modules/%{kernel_release}/kernel/sound |
1263 | /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko* | |
1264 | /lib/modules/%{kernel_release}/kernel/sound/sound*.ko* | |
1265 | %ifnarch sparc | |
1266 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko* | |
1267 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko* | |
1268 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko* | |
1269 | %endif | |
1270 | %endif | |
1271 | %dir /lib/modules/%{kernel_release}/misc | |
101ae904 | 1272 | %if %{have_pcmcia} |
351f379b JR |
1273 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]* |
1274 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko* | |
1275 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia | |
1276 | %if %{without rescuecd} | |
1277 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko* | |
1278 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko* | |
1279 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko* | |
1280 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko* | |
1281 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko* | |
1282 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko* | |
1283 | %endif | |
1284 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko* | |
1285 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko* | |
1286 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43 | |
1287 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko* | |
1288 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko* | |
1289 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko* | |
30812fb8 | 1290 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/serial_cs.ko* |
351f379b JR |
1291 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko* |
1292 | %endif | |
101ae904 | 1293 | %if %{with myown} |
1294 | /lib/modules/%{kernel_release}/kernel/sound | |
1295 | %endif | |
30812fb8 | 1296 | /lib/modules/%{kernel_release}/kernel/security |
6d54bd67 ER |
1297 | |
1298 | %dir %{_sysconfdir}/modprobe.d/%{kernel_release} | |
1299 | ||
1300 | # provided by build | |
1301 | /lib/modules/%{kernel_release}/modules.order | |
8ee3ac38 | 1302 | /lib/modules/%{kernel_release}/modules.builtin* |
6d54bd67 ER |
1303 | |
1304 | # rest modules.* are ghost (regenerated by post depmod -a invocation) | |
1305 | %ghost /lib/modules/%{kernel_release}/modules.alias | |
1306 | %ghost /lib/modules/%{kernel_release}/modules.alias.bin | |
1307 | %ghost /lib/modules/%{kernel_release}/modules.ccwmap | |
1308 | %ghost /lib/modules/%{kernel_release}/modules.dep | |
1309 | %ghost /lib/modules/%{kernel_release}/modules.dep.bin | |
8ee3ac38 | 1310 | %ghost /lib/modules/%{kernel_release}/modules.devname |
6d54bd67 ER |
1311 | %ghost /lib/modules/%{kernel_release}/modules.ieee1394map |
1312 | %ghost /lib/modules/%{kernel_release}/modules.inputmap | |
1313 | %ghost /lib/modules/%{kernel_release}/modules.isapnpmap | |
1314 | %ghost /lib/modules/%{kernel_release}/modules.ofmap | |
1315 | %ghost /lib/modules/%{kernel_release}/modules.pcimap | |
1316 | %ghost /lib/modules/%{kernel_release}/modules.seriomap | |
8ee3ac38 | 1317 | %ghost /lib/modules/%{kernel_release}/modules.softdep |
6d54bd67 ER |
1318 | %ghost /lib/modules/%{kernel_release}/modules.symbols |
1319 | %ghost /lib/modules/%{kernel_release}/modules.symbols.bin | |
1320 | %ghost /lib/modules/%{kernel_release}/modules.usbmap | |
1321 | ||
351f379b JR |
1322 | # symlinks pointing to kernelsrcdir |
1323 | %ghost /lib/modules/%{kernel_release}/build | |
1324 | %ghost /lib/modules/%{kernel_release}/source | |
351f379b | 1325 | |
351f379b JR |
1326 | %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64 |
1327 | %files vmlinux | |
a5585a68 | 1328 | %defattr(644,root,root,755) |
351f379b | 1329 | /boot/vmlinux-%{kernel_release} |
a5585a68 AM |
1330 | %endif |
1331 | ||
101ae904 | 1332 | %if %{have_drm} |
351f379b | 1333 | %files drm |
a5585a68 | 1334 | %defattr(644,root,root,755) |
351f379b | 1335 | /lib/modules/%{kernel_release}/kernel/drivers/gpu |
a5585a68 AM |
1336 | %endif |
1337 | ||
101ae904 | 1338 | %if %{have_pcmcia} |
351f379b | 1339 | %files pcmcia |
a5585a68 | 1340 | %defattr(644,root,root,755) |
351f379b JR |
1341 | /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko* |
1342 | /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia | |
1343 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko* | |
1344 | %if %{without rescuecd} | |
1345 | /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko* | |
1346 | /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko* | |
1347 | /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko* | |
1348 | /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko* | |
1349 | %endif | |
1350 | /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko* | |
1351 | /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko* | |
1352 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko* | |
1353 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43 | |
1354 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko* | |
1355 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko* | |
1356 | /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko* | |
30812fb8 | 1357 | /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/serial_cs.ko* |
351f379b JR |
1358 | /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko* |
1359 | %endif | |
1360 | ||
101ae904 | 1361 | %if %{have_sound} |
351f379b | 1362 | %files sound-alsa |
a5585a68 | 1363 | %defattr(644,root,root,755) |
351f379b JR |
1364 | /lib/modules/%{kernel_release}/kernel/sound |
1365 | %exclude %dir /lib/modules/%{kernel_release}/kernel/sound | |
1366 | %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko* | |
1367 | %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko* | |
1368 | %if %{have_oss} | |
1369 | %exclude /lib/modules/%{kernel_release}/kernel/sound/oss | |
a5585a68 | 1370 | %endif |
351f379b JR |
1371 | %ifnarch sparc |
1372 | /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko* | |
1373 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko* | |
1374 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko* | |
1375 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko* | |
a5585a68 AM |
1376 | %endif |
1377 | ||
101ae904 | 1378 | %if %{have_oss} |
351f379b | 1379 | %files sound-oss |
a5585a68 | 1380 | %defattr(644,root,root,755) |
351f379b | 1381 | /lib/modules/%{kernel_release}/kernel/sound/oss |
a5585a68 | 1382 | %endif |
a5585a68 AM |
1383 | %endif |
1384 | ||
fecce547 | 1385 | %files headers -f files.headers_exclude_kbuild |
a5585a68 | 1386 | %defattr(644,root,root,755) |
30f08736 | 1387 | %dir %{_kernelsrcdir} |
351f379b JR |
1388 | %{_kernelsrcdir}/include |
1389 | %dir %{_kernelsrcdir}/arch | |
1390 | %dir %{_kernelsrcdir}/arch/[!K]* | |
1391 | %{_kernelsrcdir}/arch/*/include | |
1392 | %dir %{_kernelsrcdir}/security | |
1393 | %dir %{_kernelsrcdir}/security/selinux | |
1394 | %{_kernelsrcdir}/security/selinux/include | |
1395 | %{_kernelsrcdir}/config-dist | |
1396 | %{_kernelsrcdir}/Module.symvers-dist | |
1397 | ||
fecce547 | 1398 | %files module-build -f files.mb_include_modulebuild_and_dirs |
a5585a68 | 1399 | %defattr(644,root,root,755) |
351f379b JR |
1400 | %ifarch ppc ppc64 |
1401 | %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.* | |
1402 | %endif | |
fecce547 | 1403 | %exclude %dir %{_kernelsrcdir}/arch/um |
351f379b JR |
1404 | %{_kernelsrcdir}/arch/*/kernel/asm-offsets* |
1405 | %{_kernelsrcdir}/arch/*/kernel/sigframe*.h | |
1406 | %{_kernelsrcdir}/drivers/lguest/lg.h | |
1407 | %{_kernelsrcdir}/kernel/bounds.c | |
1408 | %dir %{_kernelsrcdir}/scripts | |
351f379b JR |
1409 | %{_kernelsrcdir}/scripts/Kbuild.include |
1410 | %{_kernelsrcdir}/scripts/Makefile* | |
1411 | %{_kernelsrcdir}/scripts/basic | |
960d2e94 | 1412 | %{_kernelsrcdir}/scripts/kconfig |
1413 | %{_kernelsrcdir}/scripts/mkcompile_h | |
351f379b JR |
1414 | %{_kernelsrcdir}/scripts/mkmakefile |
1415 | %{_kernelsrcdir}/scripts/mod | |
960d2e94 | 1416 | %{_kernelsrcdir}/scripts/module-common.lds |
351f379b JR |
1417 | %{_kernelsrcdir}/scripts/setlocalversion |
1418 | %{_kernelsrcdir}/scripts/*.c | |
1419 | %{_kernelsrcdir}/scripts/*.sh | |
351f379b JR |
1420 | %dir %{_kernelsrcdir}/scripts/selinux |
1421 | %{_kernelsrcdir}/scripts/selinux/Makefile | |
9d6d5869 AM |
1422 | %dir %{_kernelsrcdir}/scripts/selinux/genheaders |
1423 | %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile | |
1424 | %{_kernelsrcdir}/scripts/selinux/genheaders/*.c | |
c78e408d PZ |
1425 | %dir %{_kernelsrcdir}/scripts/selinux/mdp |
1426 | %{_kernelsrcdir}/scripts/selinux/mdp/Makefile | |
1427 | %{_kernelsrcdir}/scripts/selinux/mdp/*.c | |
fecce547 | 1428 | %exclude %dir %{_kernelsrcdir}/security |
1429 | %exclude %dir %{_kernelsrcdir}/security/selinux | |
a5585a68 | 1430 | |
1848fd38 | 1431 | %if %{with doc} |
a5585a68 AM |
1432 | %files doc |
1433 | %defattr(644,root,root,755) | |
d3a69071 ER |
1434 | %dir %{_docdir}/%{name}-%{version} |
1435 | ||
1436 | %{_docdir}/%{name}-%{version}/[!jkz]* | |
1437 | %{_docdir}/%{name}-%{version}/[jkz]*.txt | |
1438 | %{_docdir}/%{name}-%{version}/kbuild | |
1439 | %{_docdir}/%{name}-%{version}/kdump | |
1440 | %lang(ja) %{_docdir}/%{name}-%{version}/ja_JP | |
1441 | %lang(ko) %{_docdir}/%{name}-%{version}/ko_KR | |
1442 | %lang(zh_CN) %{_docdir}/%{name}-%{version}/zh_CN | |
1848fd38 | 1443 | %endif |
a5585a68 AM |
1444 | |
1445 | %if %{with source} | |
fecce547 | 1446 | %files source -f files.source_exclude_modulebuild_and_dirs |
a5585a68 | 1447 | %defattr(644,root,root,755) |
351f379b JR |
1448 | %{_kernelsrcdir}/arch/*/[!Mik]* |
1449 | %{_kernelsrcdir}/arch/*/kernel/[!M]* | |
351f379b JR |
1450 | %{_kernelsrcdir}/arch/ia64/install.sh |
1451 | %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]* | |
1452 | %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC | |
fecce547 | 1453 | %{_kernelsrcdir}/arch/m68k/install.sh |
351f379b JR |
1454 | %{_kernelsrcdir}/arch/parisc/install.sh |
1455 | %{_kernelsrcdir}/arch/x86/ia32/[!M]* | |
1456 | %{_kernelsrcdir}/arch/ia64/kvm | |
1457 | %{_kernelsrcdir}/arch/powerpc/kvm | |
1458 | %ifarch ppc ppc64 | |
1459 | %exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.* | |
1460 | %endif | |
1461 | %{_kernelsrcdir}/arch/s390/kvm | |
1462 | %{_kernelsrcdir}/arch/x86/kvm | |
1463 | %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets* | |
1464 | %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h | |
1465 | %exclude %{_kernelsrcdir}/drivers/lguest/lg.h | |
1466 | %{_kernelsrcdir}/block | |
1467 | %{_kernelsrcdir}/crypto | |
1468 | %{_kernelsrcdir}/drivers | |
1469 | %{_kernelsrcdir}/firmware | |
1470 | %{_kernelsrcdir}/fs | |
1471 | %if %{with grsecurity} && %{without rescuecd} | |
1472 | %{_kernelsrcdir}/grsecurity | |
1473 | %endif | |
1474 | %{_kernelsrcdir}/init | |
1475 | %{_kernelsrcdir}/ipc | |
1476 | %{_kernelsrcdir}/kernel | |
1477 | %exclude %{_kernelsrcdir}/kernel/bounds.c | |
1478 | %{_kernelsrcdir}/lib | |
1479 | %{_kernelsrcdir}/mm | |
1480 | %{_kernelsrcdir}/net | |
1481 | %{_kernelsrcdir}/virt | |
1482 | %{_kernelsrcdir}/samples | |
1483 | %{_kernelsrcdir}/scripts/* | |
1484 | %exclude %{_kernelsrcdir}/scripts/Kbuild.include | |
1485 | %exclude %{_kernelsrcdir}/scripts/Makefile* | |
1486 | %exclude %{_kernelsrcdir}/scripts/basic | |
1487 | %exclude %{_kernelsrcdir}/scripts/kconfig | |
960d2e94 | 1488 | %exclude %{_kernelsrcdir}/scripts/mkcompile_h |
351f379b JR |
1489 | %exclude %{_kernelsrcdir}/scripts/mkmakefile |
1490 | %exclude %{_kernelsrcdir}/scripts/mod | |
960d2e94 | 1491 | %exclude %{_kernelsrcdir}/scripts/module-common.lds |
351f379b JR |
1492 | %exclude %{_kernelsrcdir}/scripts/setlocalversion |
1493 | %exclude %{_kernelsrcdir}/scripts/*.c | |
1494 | %exclude %{_kernelsrcdir}/scripts/*.sh | |
960d2e94 | 1495 | %exclude %dir %{_kernelsrcdir}/scripts/selinux |
1496 | %exclude %{_kernelsrcdir}/scripts/selinux/Makefile | |
c78e408d PZ |
1497 | %exclude %dir %{_kernelsrcdir}/scripts/selinux/genheaders |
1498 | %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile | |
1499 | %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/*.c | |
960d2e94 | 1500 | %exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp |
1501 | %exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile | |
1502 | %exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c | |
351f379b JR |
1503 | %{_kernelsrcdir}/sound |
1504 | %{_kernelsrcdir}/security | |
1505 | %exclude %{_kernelsrcdir}/security/selinux/include | |
fecce547 | 1506 | %{_kernelsrcdir}/tools |
351f379b JR |
1507 | %{_kernelsrcdir}/usr |
1508 | %{_kernelsrcdir}/COPYING | |
1509 | %{_kernelsrcdir}/CREDITS | |
1510 | %{_kernelsrcdir}/MAINTAINERS | |
1511 | %{_kernelsrcdir}/README | |
1512 | %{_kernelsrcdir}/REPORTING-BUGS | |
a5585a68 | 1513 | %endif |