]> git.pld-linux.org Git - packages/kernel.git/blame - kernel.spec
- fix build with glibc 2.10
[packages/kernel.git] / kernel.spec
CommitLineData
9b3bab6e 1#
3734e33d 2# TODO:
c3ea9043 3# - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
b02a74a2 4# - apparmor (needs testing)
fd9a5985 5# - add a subpackage (kernel-firmware?) for ~35 firmware files
32f36d00 6#
347a6801 7# FUTURE:
8dee06f0 8# - update xen patch
2c421faa 9# - pom-ng quake3-conntrack-nat -> nf_conntrack ?
2c421faa 10# - pom-ng talk-conntrack-nat -> nf_conntrack ?
11# - nf-hipac ?
12# - pax hooks for selinux (experimental)
c800013b 13#
ade3916a 14# Conditional build:
25204d32 15%bcond_without source # don't build kernel-source package
f8f3b973 16%bcond_without pcmcia # don't build pcmcia
2245b68b 17
25204d32 18%bcond_with verbose # verbose build (V=1)
de0d7ee0 19%bcond_with xen0 # added Xen0 support
20%bcond_with xenU # added XenU support
2c421faa 21%bcond_without reiser4 # support for reiser4 fs (experimental)
ceb42b9b 22
2c421faa 23%bcond_without grsecurity # don't build grsecurity nor pax at all
dcc54002 24%bcond_without grsec_minimal # build only minimal subset (proc,link,fifo,shm)
aa4545a7 25%bcond_without grsec_full # build full grsecurity
2c421faa 26%bcond_with pax_full # build pax and full grsecurity (ie. grsec_full && pax)
27%bcond_with pax # build pax support
acbe79ff 28
275eff18 29%bcond_with fbcondecor # build fbcondecor (disable FB_TILEBLITTING and affected fb modules)
740dff65
JR
30%bcond_with pae # build PAE (HIGHMEM64G) support on uniprocessor
31%bcond_with nfsroot # build with root on NFS support
32
0ff9fabf 33%bcond_with imq # imq support
2c421faa 34%bcond_without wrr # wrr support
28713bdb 35%bcond_without ipv6 # ipv6 support
2c421faa 36
e28463de 37%bcond_without vserver # support for VServer (enabled by default)
edfcc0e8 38%bcond_without tuxonice # support for tuxonice (ex-suspend2) (enabled by default)
aa4545a7 39%bcond_without apparmor # build kernel with apparmor (exerimental mix)
438dc343 40
512e1dc7 41%bcond_with rescuecd # build kernel for our rescue
42
39258f30 43%bcond_without smp # build uniprocessor instead of SMP kernel
2a261cfb 44%bcond_with myown # build with your own config (kernel-myown.config)
45
ade3916a 46%{?debug:%define with_verbose 1}
01ebb9c5 47
60d1c35d 48%if %{without grsecurity}
dcc54002
JR
49%undefine with_grsec_full
50%undefine with_grsec_minimal
60d1c35d 51%undefine with_pax
2c421faa 52%undefine with_pax_full
dcc54002
JR
53%endif
54
2c421faa 55%if %{with pax_full}
dcc54002 56%undefine with_grsec_minimal
2c421faa 57%define with_grsec_full 1
8fb7cd9b 58%define with_grsecurity 1
2c421faa 59%define with_pax 1
dcc54002
JR
60%endif
61
60d1c35d 62%if %{with grsec_full}
63%undefine with_grsec_minimal
64%define with_grsecurity 1
f8f172f4 65%if %{with pax}
66%define with_pax_full 1
f8f172f4 67%endif
60d1c35d 68%endif
83830b16 69
70%if %{with grsec_minimal}
dcc54002 71%undefine with_grsec_full
2c421faa 72%undefine with_pax_full
8fb7cd9b 73%define with_grsecurity 1
b7b28388 74%endif
8adc256a 75
fbb03e0d
JB
76%define have_drm 1
77%define have_oss 1
78%define have_sound 1
79
512e1dc7 80%if %{with rescuecd}
2b7a2411 81%undefine with_apparmor
a52b9424 82%undefine with_tuxonice
512e1dc7 83%undefine with_grsec_full
a52b9424 84%undefine with_grsec_minimal
512e1dc7 85%undefine with_pax
86%undefine with_pax_full
a52b9424 87%undefine with_vserver
512e1dc7 88%define have_drm 0
89%define have_sound 0
90%endif
91
7291f0f8
JB
92%ifarch %{ix86} alpha ppc
93%define have_isa 1
94%else
95%define have_isa 0
96%endif
97
fbb03e0d
JB
98%ifarch sparc sparc64
99%undefine with_pcmcia
100%define have_drm 0
101%define have_oss 0
102%endif
103
52bb7759 104%define basever 2.6.27
0c929fc8 105%define postver .24
791f5acb 106%define rel 1
c2921d44 107
b620d240 108%define _enable_debug_packages 0
01ebb9c5 109
2f86595b 110%define squashfs_version 3.4
1838f965 111%define tuxonice_version 3.0-rc8
3f5783f6 112%define netfilter_snap 20070806
c5fcccf8 113%define xen_version 3.0.2
114
2c6c1761 115%if %{without rescuecd}
249a4c7b 116%define __alt_kernel %{?with_pax:pax}%{!?with_grsec_full:nogrsecurity}%{!?with_apparmor:noaa}%{?with_xen0:xen0}%{?with_xenU:xenU}%{?with_pae:pae}%{?with_myown:myown}
2c6c1761 117%else
249a4c7b
ER
118%define __alt_kernel rescuecd
119%endif
120
121%if "%{__alt_kernel}" != ""
122%define alt_kernel %{__alt_kernel}
2c6c1761 123%endif
869e45ec 124
125# kernel release (used in filesystem and eventually in uname -r)
126# modules will be looked from /lib/modules/%{kernel_release}
52bb7759 127# localversion is just that without version for "> localversion"
249a4c7b
ER
128%define localversion %{rel}
129%define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion}
869e45ec 130
601b4e87 131Summary: The Linux kernel (the core of the Linux operating system)
2c421faa 132Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
133Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
134Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme)
135Summary(pl.UTF-8): Jądro Linuksa
869e45ec 136Name: kernel%{_alt_kernel}
52bb7759
JB
137Version: %{basever}%{postver}
138Release: %{rel}
120b079f 139Epoch: 3
1da2cf6b 140License: GPL v2
601b4e87 141Group: Base/Kernel
52bb7759 142Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
831f60a4 143# Source0-md5: b3e78977aa79d3754cb7f8143d7ddabd
52bb7759 144%if "%{postver}" != "%{nil}"
38c14daa 145Source1: http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
0c929fc8 146# Source1-md5: e80fcf73166ec34e54ab7c720cadc925
38c14daa 147%endif
2c421faa 148
38c14daa 149Source3: kernel-autoconf.h
150Source4: kernel-config.h
1362b2d9 151Source5: kernel-ppclibs.Makefile
55ee54ad 152Source6: kernel-config.awk
9d867cd0 153Source7: kernel-module-build.pl
75287058 154Source8: kernel-track-config-change.awk
155# not used by kernel.spec, but it's good to have it in SOURCES
156Source9: kernel-config-sort.pl
8a9df004 157
fa35f1bb 158Source20: kernel-multiarch.config
159Source21: kernel-x86.config
2c421faa 160Source22: kernel-sparc.config
161Source23: kernel-sparc64.config
162Source24: kernel-alpha.config
fa35f1bb 163Source25: kernel-powerpc.config
2c421faa 164Source26: kernel-ia64.config
2c421faa 165
d04db8e4 166Source40: kernel-netfilter.config
20a19493 167Source41: kernel-patches.config
e8c0537c 168Source42: kernel-tuxonice.config
36f2faae 169Source43: kernel-vserver.config
dcc54002 170Source45: kernel-grsec.config
de0d7ee0 171Source46: kernel-xen0.config
172Source47: kernel-xenU.config
f0c5ac07 173
60d1c35d 174Source49: kernel-pax.config
175Source50: kernel-no-pax.config
2c421faa 176Source51: kernel-grsec_minimal.config
347a6801 177Source55: kernel-imq.config
2c421faa 178Source56: kernel-reiser4.config
179Source57: kernel-wrr.config
edb27ca0 180
512e1dc7 181Source58: kernel-inittmpfs.config
edb27ca0 182Source59: kernel-bzip2-lzma.config
60d1c35d 183
8c2bf331
PS
184# tahoe9xx http://www.tahoe.pl/drivers/tahoe9xx-2.6.24.patch
185Patch2: tahoe9xx-2.6.24.patch
e43054fa 186
16a7bd96 187# http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.4-2.6.25-rc6.patch
275eff18
PS
188Patch3: kernel-fbcondecor.patch
189Patch4: linux-fbcon-margins.patch
bc31f1fe 190
2f86595b 191# http://mesh.dl.sourceforge.net/sourceforge/squashfs/squashfs3.4.tgz
192# squashfs3.4/kernel-patches/linux-2.6.27-rc4/squashfs3.4-patch
275eff18
PS
193Patch5: kernel-squashfs.patch
194Patch6: linux-static-dev.patch
66d8ded9 195
88f0e9ff 196# netfilter related stuff mostly based on patch-o-matic-ng
197# snapshot 20061213 with some fixes related to changes in
e28463de 198# netfilter api in 2.6.19 up to 2.6.22. Some modules
88f0e9ff 199# were ported to nf_conntrack. Some of these are unique.
200
201Patch10: kernel-pom-ng-IPV4OPTSSTRIP.patch
202Patch11: kernel-pom-ng-ipv4options.patch
b57ddbed 203
28713bdb 204Patch14: kernel-pom-ng-ROUTE.patch
88f0e9ff 205Patch16: kernel-pom-ng-mms-conntrack-nat.patch
f5fbd9ea 206Patch22: kernel-pom-ng-rsh.patch
253b8b20 207Patch23: kernel-pom-ng-rpc.patch
88f0e9ff 208
1fbbe25c 209# based on http://mike.it-loops.com/rtsp/rtsp-2.6.26.patch
78382233 210Patch36: kernel-nf_rtsp.patch
211
fcf7a306 212# http://ftp.linux-vserver.org/pub/people/dhozac/p/k/delta-owner-xid-feat02.diff
213Patch37: kernel-owner-xid.patch
214
2cd49126 215# based on http://www.svn.barbara.eu.org/ipt_account/attachment/wiki/Software/ipt_account-0.1.21-20070804164729.tar.gz?format=raw
216Patch38: kernel-ipt_account.patch
217
05219784 218# based on http://www.intra2net.com/de/produkte/opensource/ipt_account/pom-ng-ipt_ACCOUNT-1.12.tgz
d5d1afcf 219Patch39: kernel-ipt_ACCOUNT.patch
220
6f4d2f35 221# based on kernel-2.6.25-layer7-2.20.patch from
222# http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.20.tar.gz
88f0e9ff 223Patch40: kernel-layer7.patch
e28463de 224
6f4d2f35 225# http://www.ssi.bg/~ja/nfct/ipvs-nfct-2.6.27-1.diff
28713bdb 226Patch41: kernel-ipvs-nfct.patch
227
97013b4b 228# based on http://www.balabit.com/downloads/files/tproxy/tproxy-kernel-2.6.25-20080509-164605-1210344365.tar.bz2
81a50533
PS
229#FIXME: this patch needs net_device->nd_dev feature (see net/Kconfig:NET_NS).
230# NET_NS depends on EXPERIMENTAL && !SYSFS && NAMESPACES while we have SYSFS enabled.
231# the https://lists.linux-foundation.org/pipermail/containers/2007-December/008849.html is waiting for merge.
232#Patch42: kernel-tproxy.patch
97013b4b 233
88f0e9ff 234### End netfilter
99bb556f 235
6f4d2f35 236# http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
a60cb6c9 237Patch49: kernel-zph.patch
238
befdc142 239# based on http://www.linuximq.net/patchs/linux-2.6.24-imq.diff
c04b520b 240# some people report problems when using imq with wrr.
9a5f3f20 241# try unoficial version: http://kapturkiewicz.name/linux-2.6.25-imq1.diff
c04b520b 242Patch50: kernel-imq.patch
4170601d 243
831f60a4 244# http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.27.patch.bz2
20a19493 245Patch51: kernel-reiser4.patch
32edb06c 246
05219784 247# http://www.zz9.dk/patches/wrr-linux-071203-2.6.25.patch.gz
248Patch52: kernel-wrr.patch
2c421faa 249
7d31896b 250# http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2
e7b9147e 251Patch53: esfq-kernel.patch
2c421faa 252
77e482ca 253# http://memebeam.org/free-software/toshiba_acpi/toshiba_acpi-dev_toshiba_test5-linux_2.6.26.patch
ed5063af 254Patch54: linux-2.6-toshiba_acpi.patch
77e482ca 255
b9f8c4e8 256# by Baggins request:
257# derived from ftp://ftp.cmf.nrl.navy.mil/pub/chas/linux-atm/vbr/vbr-kernel-diffs
7e77e535
JR
258Patch55: linux-2.6-atm-vbr.patch
259Patch56: linux-2.6-atmdd.patch
b9f8c4e8 260
dbfa210f 261# http://www.ntop.org/PF_RING.html 20070610
6344ff36 262Patch58: linux-PF_RING.patch
263
28713bdb 264# http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
265Patch59: kernel-rndis_host-wm5.patch
266
2eee54b8
PS
267Patch61: kernel-vesa-upstream.patch
268
c00d3452 269# Project suspend2 renamed to tuxonice
1838f965 270# http://www.tuxonice.net/downloads/all/tuxonice-3.0-rc8-for-2.6.27.patch.bz2
2c421faa 271Patch69: linux-2.6-suspend2.patch
33a10a0a 272Patch70: kernel-suspend2-headers.patch
7897d3ff 273
60d1c35d 274# adds some ids for hostap suported cards and monitor_enable from/for aircrack-ng
2c421faa 275# http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
60d1c35d 276Patch85: hostap-kernel-2.6.18.patch
277
410d7f63
JR
278# Taken from http://download.opensuse.org/factory/repo/src-oss/suse/src/kernel-source-2.6.27.7-3.1.src.rpm
279Patch90: kernel-mpt-fusion.patch
280
b13fd6d5
AM
281Patch95: kernel-touchpad.patch
282
791f5acb 283# http://vserver.13thfloor.at/Experimental/patch-2.6.27.14-vs2.3.0.36.4.diff
578002a9 284Patch100: linux-2.6-vs2.3.patch
1f3f622a 285Patch101: kernel-vserver-fixes.patch
a636f0fc 286
e32ba33b 287# from http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-3.0.2-src.tgz
2c421faa 288#Patch120: xen-3.0-2.6.16.patch
e32ba33b 289
8b0541be 290# Wake-On-Lan fix for nForce drivers; using http://atlas.et.tudelft.nl/verwei90/nforce2/wol.html
291# Fix verified for that kernel version.
292Patch130: linux-2.6-forcedeth-WON.patch
293
4cef2f21 294# http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5_for_2.6.27-rc6.diff.gz
997e0ae9 295Patch140: kernel-unionfs.patch
4cef2f21 296Patch141: kernel-unionfs-apparmor.patch
60d6f988 297
627c4101
PS
298Patch142: kernel-autofs4-2.6.27-v5-update-20081027.patch
299
01053713
AM
300Patch150: kernel-ppc-crtsavres.patch
301
1b0af130 302Patch200: linux-2.6-ppc-ICE-hacks.patch
7e4e533b 303
e28463de 304# The following patch extend the routing functionality in Linux
305# to support static routes (defined by user), new way to use the
306# alternative routes, the reverse path protection (rp_filter),
307# the NAT processing to use correctly the routing when multiple
27d09b3b 308# gateways are used.
831f60a4 309# http://www.ssi.bg/~ja/routes-2.6.27-15.diff
2185d846 310Patch300: kernel-routes.patch
27d09b3b 311
ae0664f5 312Patch1000: linux-2.6-grsec-minimal.patch
9a991405 313
1b0af130 314Patch2000: kernel-small_fixes.patch
a636f0fc 315Patch2001: linux-2.6.21.1-pwc-uncompress.patch
bd60e17f 316Patch2002: kernel-atom-coretemp.patch
50e65954 317Patch2003: kernel-regressions.patch
2c421faa 318
2c421faa 319# kill some thousands of warnings
befdc142 320# (only warnings, so just remove parts of this patch if conflics)
2c421faa 321Patch2500: linux-2.6-warnings.patch
322
a02681d3 323# based on https://forgesvn1.novell.com/svn/apparmor/trunk/kernel-patches/2.6.27 rev 1303
324# repatched and adapted for vserver/grsec changes in vfs API, experimental
b02a74a2 325Patch5000: kernel-apparmor.patch
a02681d3 326# with grsec_full version
327Patch5001: kernel-apparmor-after-grsec_full.patch
328Patch5002: kernel-apparmor-common.patch
2c421faa 329
512e1dc7 330# for rescuecd
78382233 331# based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
512e1dc7 332Patch7000: kernel-inittmpfs.patch
6f4d2f35 333### based on http://udpcast.linux.lu/download/bzip2-lzma-kernel-2.6.26.3.patch.gz
334# http://lkml.org/lkml/2008/10/14/268
edb27ca0 335Patch7001: kernel-bzip2-lzma.patch
512e1dc7 336
2c421faa 337# not ready yet
338Patch9997: pax_selinux_hooks-2.6.20.patch
339
7c7ef692 340# based on http://www.grsecurity.net/~paxguy1/pax-linux-2.6.24.6-test45.patch
62d3f89b 341Patch9998: kernel-pax.patch
2c421faa 342
78f2a203 343# based on http://www.grsecurity.net/~spender/grsecurity-2.1.12-2.6.27.4-200810272314.patch
110a25bd 344Patch9999: linux-2.6-grsec_full.patch
2c421faa 345Patch10000: linux-2.6-grsec-caps.patch
346Patch10001: linux-2.6-grsec-common.patch
b769102c 347Patch10002: kernel-grsec_fixes.patch
7001cd3f 348Patch10003: linux-2.6-grsec-no-stupid-SoB.patch
36f2faae 349
601b4e87 350URL: http://www.kernel.org/
d62e86e9 351BuildRequires: binutils >= 3:2.18
46bb4084 352%ifarch sparc sparc64
353BuildRequires: elftoaout
354%endif
2c6c1761 355%ifarch ppc
6f17021d
AM
356BuildRequires: uboot-mkimage
357%endif
b8c817d6 358AutoReqProv: no
12c62503 359BuildRequires: /sbin/depmod
0c18a0c3 360BuildRequires: gcc >= 5:3.2
edb27ca0 361%{?with_rescuecd:BuildRequires: lzma >= 1:4.42.2}
f979af5b
AM
362# for hostname command
363BuildRequires: net-tools
465bc122 364BuildRequires: perl-base
b8c817d6 365BuildRequires: rpm-build >= 4.4.9-56
b7fa4545 366BuildRequires: rpmbuild(macros) >= 1.217
f1c7ea86
JB
367Requires(post): coreutils
368Requires(post): geninitrd >= 2.57
369Requires(post): module-init-tools >= 0.9.9
ac8b2067 370Requires: /sbin/depmod
002ed53c
ER
371Requires: coreutils
372Requires: geninitrd >= 2.57
373Requires: module-init-tools >= 0.9.9
12c62503 374Provides: %{name}(netfilter) = %{netfilter_snap}
da12047a 375Provides: %{name}(vermagic) = %{kernel_release}
de0d7ee0 376%if %{with xen0} || %{with xenU}
c5fcccf8 377Provides: kernel(xen) = %{_xen_version}
2e4315a9 378%endif
b8c817d6 379Obsoletes: kernel%{_alt_kernel}-isdn-mISDN
cfb7cf50 380Obsoletes: kernel-misc-acer_acpi
f0234385 381Obsoletes: kernel-misc-fuse
31fbd796 382Obsoletes: kernel-misc-uvc
601b4e87 383Obsoletes: kernel-modules
320795c4 384Obsoletes: kernel-net-ar81
67d44017
PS
385Obsoletes: kernel-net-hostap
386Obsoletes: kernel-net-ieee80211
d0bbe802 387Obsoletes: kernel-net-ipp2p
a99f3043 388Obsoletes: kernel-net-rt61
ac8b2067 389Obsoletes: kernel-smp
3f5783f6
ER
390Conflicts: e2fsprogs < 1.29
391Conflicts: isdn4k-utils < 3.1pre1
392Conflicts: jfsutils < 1.1.3
393Conflicts: module-init-tools < 0.9.10
394Conflicts: nfs-utils < 1.0.5
395Conflicts: oprofile < 0.9
396Conflicts: ppp < 1:2.4.0
397Conflicts: procps < 3.2.0
398Conflicts: quota-tools < 3.09
12c62503 399%if %{with reiserfs4}
3f5783f6 400Conflicts: reiser4progs < 1.0.0
12c62503 401%endif
3f5783f6 402Conflicts: reiserfsprogs < 3.6.3
869e45ec 403Conflicts: udev < 1:071
3f5783f6 404Conflicts: util-linux < 2.10o
bda09b70 405Conflicts: util-vserver < 0.30.215-10
3f5783f6 406Conflicts: xfsprogs < 2.6.0
b9d3c9da 407%if %{with xen0} || %{with xenU} || %{with pae}
c5bf058d 408ExclusiveArch: %{ix86}
9157d402
ER
409%if %{with pae}
410ExcludeArch: i386 i486 i586
411%endif
c5bf058d 412%else
edfcc0e8 413ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
c5bf058d 414%endif
906e68b7
JB
415ExclusiveOS: Linux
416BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
601b4e87 417
7efebc83 418%ifarch %{ix86} %{x8664}
af0b79f6
JB
419%define target_arch_dir x86
420%endif
421%ifarch ppc ppc64
422%define target_arch_dir powerpc
423%endif
aadedaf5 424%ifnarch %{ix86} %{x8664} ppc ppc64
af0b79f6 425%define target_arch_dir %{_target_base_arch}
7efebc83
AM
426%endif
427
52e8aad6 428%define defconfig arch/%{target_arch_dir}/defconfig
429
db6c2213
ER
430# No ELF objects there to strip (skips processing 27k files)
431%define _noautostrip .*%{_kernelsrcdir}/.*
12c62503 432%define _noautochrpath .*%{_kernelsrcdir}/.*
db6c2213 433
8cd1b586
JB
434%ifarch ia64
435%define initrd_dir /boot/efi
436%else
437%define initrd_dir /boot
438%endif
439
869e45ec 440%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
5253d53f 441
2e23b44b 442%if "%{_target_base_arch}" != "%{_arch}"
74d148ab 443 %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
2e23b44b
ER
444 %define DepMod /bin/true
445
446 %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
304c3aa6
JB
447 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
448 %define DepMod /sbin/depmod
449 %endif
450
451 %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc"
452 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
2e23b44b
ER
453 %define DepMod /sbin/depmod
454 %endif
455
456 %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
304c3aa6 457 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
2e23b44b
ER
458 %define DepMod /sbin/depmod
459 %endif
9157d402 460
2fdc58ef 461 %if "%{_target_base_arch}" == ppc || "%{_target_base_arch}" == "ppc64"
74d148ab 462 %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux-
463 %endif
2e23b44b 464%else
304c3aa6
JB
465 %ifarch ppc ppc64
466 %define CrossOpts ARCH=powerpc CC="%{__cc}"
467 %else
468 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
469 %endif
74d148ab 470 %define DepMod /sbin/depmod
471%endif
2fdc58ef 472%define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
2e23b44b 473
d6e334cd 474%define __features Netfilter module dated: %{netfilter_snap}\
d6e334cd 475%{?with_grsec_full:Grsecurity full support - enabled}\
476%{?with_pax:PaX support - enabled}\
477%{?with_xen0:Xen 0 - enabled}\
478%{?with_xenU:Xen U - enabled}\
04ea1d8c 479%{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
d6e334cd 480%{?with_nfsroot:Root on NFS - enabled}
481
482%define Features %(echo "%{__features}" | sed '/^$/d')
483
601b4e87
KT
484%description
485This package contains the Linux kernel that is used to boot and run
486your system. It contains few device drivers for specific hardware.
487Most hardware is instead supported by modules loaded after booting.
488
d6e334cd 489%{Features}
d3c89e2e 490
83830b16 491%description -l de.UTF-8
492Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
493Linux-Betriebssystems. Der Kernel ist für grundliegende
601b4e87 494Systemfunktionen verantwortlich: Speicherreservierung,
83830b16 495Prozeß-Management, Geräte Ein- und Ausgaben, usw.
601b4e87 496
d6e334cd 497%{Features}
d3c89e2e 498
83830b16 499%description -l fr.UTF-8
601b4e87 500Le package kernel contient le kernel linux (vmlinuz), la partie
83830b16 501centrale d'un système d'exploitation Linux. Le noyau traite les
502fonctions basiques d'un système d'exploitation: allocation mémoire,
503allocation de process, entrée/sortie de peripheriques, etc.
601b4e87 504
d6e334cd 505%{Features}
d3c89e2e 506
83830b16 507%description -l pl.UTF-8
508Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania
509Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego
510się w komputerze, takiego jak sterowniki dysków itp.
69965db2 511
d6e334cd 512%{Features}
d3c89e2e 513
c4057ded 514%package vmlinux
c5d76354 515Summary: vmlinux - uncompressed kernel image
d6e334cd 516Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild
e28463de 517Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra
c4057ded 518Group: Base/Kernel
2c421faa 519Obsoletes: kernel-smp-vmlinux
c4057ded 520
521%description vmlinux
c5d76354
JB
522vmlinux - uncompressed kernel image.
523
d6e334cd 524%description vmlinux -l de.UTF-8
525vmlinux - dekompressiertes Kernel Bild.
526
83830b16 527%description vmlinux -l pl.UTF-8
528vmlinux - rozpakowany obraz jądra.
c4057ded 529
35fde00b
JB
530%package drm
531Summary: DRM kernel modules
d6e334cd 532Summary(de.UTF-8): DRM Kernel Treiber
2c421faa 533Summary(pl.UTF-8): Sterowniki DRM
35fde00b 534Group: Base/Kernel
2c421faa 535Requires(postun): %{name} = %{epoch}:%{version}-%{release}
536Requires: %{name} = %{epoch}:%{version}-%{release}
2c421faa 537Obsoletes: kernel-smp-drm
a508d02c 538Autoreqprov: no
35fde00b
JB
539
540%description drm
3f5783f6 541DRM kernel modules.
35fde00b 542
d6e334cd 543%description drm -l de.UTF-8
544DRM Kernel Treiber.
545
83830b16 546%description drm -l pl.UTF-8
3f5783f6 547Sterowniki DRM.
35fde00b
JB
548
549%package pcmcia
550Summary: PCMCIA modules
d6e334cd 551Summary(de.UTF-8): PCMCIA Module
2c421faa 552Summary(pl.UTF-8): Moduły PCMCIA
35fde00b 553Group: Base/Kernel
2c421faa 554Requires(postun): %{name} = %{epoch}:%{version}-%{release}
555Requires: %{name} = %{epoch}:%{version}-%{release}
2c421faa 556Obsoletes: kernel-smp-pcmcia
ccb58aaf 557Conflicts: pcmcia-cs < 3.1.21
558Conflicts: pcmciautils < 004
a508d02c 559Autoreqprov: no
35fde00b
JB
560
561%description pcmcia
12c62503 562PCMCIA modules.
35fde00b 563
d6e334cd 564%description pcmcia -l de.UTF-8
565PCMCIA Module.
566
83830b16 567%description pcmcia -l pl.UTF-8
12c62503 568Moduły PCMCIA.
35fde00b 569
d779450c 570%package libs
571Summary: Libraries for preparing bootable kernel on PowerPCs
2c421faa 572Summary(pl.UTF-8): Biblioteki do przygotowania bootowalnego jądra dla PowerPC
d779450c 573Group: Base/Kernel
2c421faa 574Requires: %{name} = %{epoch}:%{version}-%{release}
3f5783f6 575Requires: mkvmlinuz >= 1.3
2c421faa 576Obsoletes: kernel-smp-libs
d779450c 577Autoreqprov: no
578
579%description libs
002ed53c
ER
580Libraries for preparing bootable kernel on PowerPCs. Script called
581mkvmlinuz may be useful for this.
d779450c 582
83830b16 583%description libs -l pl.UTF-8
584Biblioteki do przygotowania bootowalnego jądra dla PowerPC. Skrypt
585mkvmlinuz może być do tego przydatny.
d779450c 586
35fde00b
JB
587%package sound-alsa
588Summary: ALSA kernel modules
d6e334cd 589Summary(de.UTF-8): ALSA Kernel Module
2c421faa 590Summary(pl.UTF-8): Sterowniki dźwięku ALSA
35fde00b 591Group: Base/Kernel
2c421faa 592Requires(postun): %{name} = %{epoch}:%{version}-%{release}
593Requires: %{name} = %{epoch}:%{version}-%{release}
594Obsoletes: kernel-smp-sound-alsa
a508d02c 595Autoreqprov: no
35fde00b
JB
596
597%description sound-alsa
598ALSA (Advanced Linux Sound Architecture) sound drivers.
599
d6e334cd 600%description sound-alsa -l de.UTF-8
601ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
602
83830b16 603%description sound-alsa -l pl.UTF-8
604Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture).
35fde00b
JB
605
606%package sound-oss
607Summary: OSS kernel modules
d6e334cd 608Summary(de.UTF-8): OSS Kernel Module
2c421faa 609Summary(pl.UTF-8): Sterowniki dźwięku OSS
35fde00b 610Group: Base/Kernel
2c421faa 611Requires(postun): %{name} = %{epoch}:%{version}-%{release}
612Requires: %{name} = %{epoch}:%{version}-%{release}
613Obsoletes: kernel-smp-sound-oss
a508d02c 614Autoreqprov: no
35fde00b
JB
615
616%description sound-oss
617OSS (Open Sound System) drivers.
618
d6e334cd 619%description sound-oss -l de.UTF-8
620OSS (Open Sound System) Treiber.
621
83830b16 622%description sound-oss -l pl.UTF-8
623Sterowniki dźwięku OSS (Open Sound System).
35fde00b 624
601b4e87
KT
625%package headers
626Summary: Header files for the Linux kernel
d6e334cd 627Summary(de.UTF-8): Header Dateien für den Linux-Kernel
2c421faa 628Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa
6c6b034d 629Group: Development/Building
12c62503 630Provides: %{name}-headers(netfilter) = %{netfilter_snap}
601b4e87
KT
631Autoreqprov: no
632
633%description headers
634These are the C header files for the Linux kernel, which define
40eea4ff
SP
635structures and constants that are needed when rebuilding the kernel or
636building kernel modules.
601b4e87 637
d6e334cd 638%description headers -l de.UTF-8
639Dies sind die C Header Dateien für den Linux-Kernel, die definierte
9157d402
ER
640Strukturen und Konstante beinhalten, die beim rekompilieren des
641Kernels oder bei Kernel Modul kompilationen gebraucht werden.
d6e334cd 642
83830b16 643%description headers -l pl.UTF-8
644Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra
645oraz budowania modułów jądra.
601b4e87 646
d20b1dc0 647%package module-build
2bc32647 648Summary: Development files for building kernel modules
d6e334cd 649Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebraucht werden
2c421faa 650Summary(pl.UTF-8): Pliki służące do budowania modułów jądra
e687965c 651Group: Development/Building
d20b1dc0 652Requires: %{name}-headers = %{epoch}:%{version}-%{release}
bf135ec7 653Conflicts: rpmbuild(macros) < 1.321
a508d02c 654Autoreqprov: no
d20b1dc0 655
656%description module-build
2bc32647
JB
657Development files from kernel source tree needed to build Linux kernel
658modules from external packages.
659
d6e334cd 660%description module-build -l de.UTF-8
661Development Dateien des Linux-Kernels die beim kompilieren externer
662Kernel Module gebraucht werden.
663
83830b16 664%description module-build -l pl.UTF-8
665Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra
666Linuksa z zewnętrznych pakietów.
d20b1dc0 667
601b4e87
KT
668%package source
669Summary: Kernel source tree
d6e334cd 670Summary(de.UTF-8): Der Kernel Quelltext
2c421faa 671Summary(pl.UTF-8): Kod źródłowy jądra Linuksa
e687965c 672Group: Development/Building
2bc32647 673Requires: %{name}-module-build = %{epoch}:%{version}-%{release}
a508d02c 674Autoreqprov: no
601b4e87
KT
675
676%description source
12c62503
ER
677This is the source code for the Linux kernel. You can build a custom
678kernel that is better tuned to your particular hardware.
601b4e87 679
83830b16 680%description source -l de.UTF-8
681Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
601b4e87 682Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
9eb43334 683C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
83830b16 684im Kernel-Source definiert sind. Die Source-Dateien können auch
9eb43334 685benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
601b4e87
KT
686Hardware ausgerichtet ist.
687
83830b16 688%description source -l fr.UTF-8
601b4e87 689Le package pour le kernel-source contient le code source pour le noyau
83830b16 690linux. Ces sources sont nécessaires pour compiler la plupart des
691programmes C, car il dépend de constantes définies dans le code
692source. Les sources peuvent être aussi utilisée pour compiler un noyau
693personnalisé pour avoir de meilleures performances sur des matériels
601b4e87
KT
694particuliers.
695
83830b16 696%description source -l pl.UTF-8
697Pakiet zawiera kod źródłowy jądra systemu.
cf06f88a 698
9b3bab6e
JR
699%package doc
700Summary: Kernel documentation
d6e334cd 701Summary(de.UTF-8): Kernel Dokumentation
2c421faa 702Summary(pl.UTF-8): Dokumentacja do jądra Linuksa
e687965c 703Group: Documentation
9b3bab6e 704Autoreqprov: no
cf06f88a 705
9b3bab6e
JR
706%description doc
707This is the documentation for the Linux kernel, as found in
708/usr/src/linux/Documentation directory.
cf06f88a 709
d6e334cd 710%description doc -l de.UTF-8
711Dies ist die Kernel Dokumentation wie sie im 'Documentation'
712Verzeichniss vorgefunden werden kann.
713
83830b16 714%description doc -l pl.UTF-8
715Pakiet zawiera dokumentację do jądra Linuksa pochodzącą z katalogu
9b3bab6e 716/usr/src/linux/Documentation.
cf06f88a 717
601b4e87 718%prep
249a4c7b
ER
719%setup -qc
720cd linux-%{basever}
1362b2d9 721
2c421faa 722# hack against warning in pax/grsec
723%ifarch alpha
724sed -i 's/-Werror//' arch/alpha/kernel/Makefile
725%endif
34debd54 726
1362b2d9
JR
727%ifarch ppc
728install %{SOURCE5} Makefile.ppclibs
729%endif
846aafa3 730
52bb7759 731%if "%{postver}" != "%{nil}"
38c14daa 732%{__bzip2} -dc %{SOURCE1} | patch -p1 -s
733%endif
734
c00d3452 735# tuxonice:
736%if %{with tuxonice}
2c421faa 737##ifarch %{ix86} %{x8664} ia64 ppc alpha
737ba2a2 738%patch69 -p1
33a10a0a 739%patch70 -p1
2c421faa 740##endif
0e9a441a 741%endif
04352f3d 742
e43054fa 743%patch2 -p1
275eff18 744%if %{with fbcondecor}
df97710f 745%patch3 -p1
1362b2d9 746%endif
df97710f 747%patch4 -p1
24b722f9 748
16b2d858 749# squashfs
275eff18 750%patch5 -p1
eb475ca7 751
275eff18 752%patch6 -p1
4a28820e 753
23f15e1c 754## netfilter
1519495f 755#
f0c5ac07 756
88f0e9ff 757# kernel-pom-ng-IPV4OPTSSTRIP.patch
1fbbe25c 758%patch10 -p1
88f0e9ff 759
760# kernel-pom-ng-ipv4options.patch
848a2d02 761%patch11 -p1
88f0e9ff 762
28713bdb 763# kernel-pom-ng-ROUTE.patch
1fbbe25c 764%patch14 -p1
28713bdb 765
88f0e9ff 766# kernel-pom-ng-mms-conntrack-nat.patch
1fbbe25c 767%patch16 -p1
88f0e9ff 768
f5fbd9ea 769# kernel-pom-ng-rsh.patch
1fbbe25c 770%patch22 -p1
f5fbd9ea 771
253b8b20 772# kernel-pom-ng-rpc.patch
1fbbe25c 773%patch23 -p1
253b8b20 774
78382233 775# kernel-nf_rtsp.patch
1fbbe25c 776%patch36 -p1
78382233 777
fcf7a306 778# kernel-owner-xid.patch
793722d1 779%if %{with vserver}
9a5f3f20 780%patch37 -p1
793722d1 781%endif
fcf7a306 782
2cd49126 783# kernel-ipt_account.patch
784%patch38 -p1
785
d5d1afcf 786# kernel-ipt_ACCOUNT.patch
787%patch39 -p1
788
88f0e9ff 789# kernel-layer7.patch
6f4d2f35 790%patch40 -p1
1519495f 791
28713bdb 792# ipvs-nfct
6f4d2f35 793%patch41 -p1
28713bdb 794
52986594 795##
796# end of netfilter
36f2faae 797
a60cb6c9 798# zph
799%patch49 -p1
800
347a6801 801%if %{with imq}
802%patch50 -p1
803%endif
4170601d 804
32edb06c 805# reiser4
806%if %{with reiser4}
807%patch51 -p1
808%endif
809
2c421faa 810# esfq
89715f5b 811%patch53 -p1
2c421faa 812
813%if %{with wrr}
90cf2c6a 814%patch52 -p1
2c421faa 815%endif
816
ed5063af 817# toshiba_acpi
77e482ca 818%patch54 -p1
2c421faa 819
7e77e535
JR
820%patch55 -p1
821%patch56 -p1
b9f8c4e8 822
1f543321 823%patch58 -p1
6344ff36 824
28713bdb 825# kernel-rndis_host-wm5.patch
826%patch59 -p1
560ff042 827
2eee54b8
PS
828%patch61 -p1
829
2c421faa 830# hostap enhancements from/for aircrack-ng
60d1c35d 831%patch85 -p1
832
410d7f63
JR
833# LSI MPT Fusion driver update
834%patch90 -p1
835
b13fd6d5
AM
836%patch95 -p1
837
2c421faa 838# vserver
839%if %{with vserver}
f79903d9 840%patch100 -p1
1f3f622a 841%patch101 -p1
31c3042b 842%endif
a6a6ac0b 843
844#%if %{with xen0} || %{with xenU}
845#%ifarch %{ix86} %{x8664} ia64
846#%patch120 -p1
847#%endif
848#%endif
849
97013b4b 850# tproxy
2d8a42d9 851%if %{without rescuecd} && %{with vserver}
81a50533 852#patch42 -p1
16a7bd96 853%endif
97013b4b 854
7d31896b 855# forcedeth
8b0541be 856%patch130 -p1
857
60d6f988 858# unionfs
997e0ae9 859%patch140 -p1
0ee88483 860%{?with_apparmor:%patch141 -p1}
60d6f988 861
627c4101
PS
862# autofs4-v5-update
863%patch142 -p1
864
c1d95c69 865%patch2500 -p1
2c421faa 866
512e1dc7 867%if %{with rescuecd}
868%patch7000 -p1
edb27ca0 869%patch7001 -p1
512e1dc7 870%endif
871
befdc142 872# grsecurity & pax stuff
2c421faa 873#
2c421faa 874%if %{with pax_full}
875%patch9999 -p1
7d31896b 876%{?with_vserver:%patch10000 -p1}
a636f0fc 877%{?with_vserver:%patch10001 -p1}
78f2a203 878%{?with_vserver:%patch10002 -p1}
7001cd3f 879%{?with_vserver:%patch10003 -p1}
2c421faa 880%else
881
64c7b6c3 882%if %{with grsec_full}
883%patch9999 -p1
7d31896b 884%{?with_vserver:%patch10000 -p1}
a636f0fc 885%{?with_vserver:%patch10001 -p1}
78f2a203 886%{?with_vserver:%patch10002 -p1}
7001cd3f 887%{?with_vserver:%patch10003 -p1}
2c421faa 888%else
889%if %{with grsec_minimal}
890%patch1000 -p1
891# remember that we have the same config file for grsec_minimal and
892# grsec_full, but the patches are different.
893%endif
64c7b6c3 894%endif
a6a6ac0b 895
60d1c35d 896%if %{with pax}
2c421faa 897# now we have an separate testing pax-only patch - in the future we
898# could have single grsecurity patch and will have to prepare separate
899# configs for grsec_minimal, grsec_full and pax to support such
900# configurations like pax & grsec_minimal.
901# So, in a future there could be no patch9998, but only config
902# would tell which options should be enabled.
903# The second option is to maintain separate pax-only patch.
904%patch9998 -p1
905#patch9997 -p1 - needs update
60d1c35d 906%endif
907
2c421faa 908%endif
909
910#
911# end of grsecurity & pax stuff
60d1c35d 912
b02a74a2 913# apparmor
914%if %{with apparmor}
a02681d3 915%if %{with grsec_full} || %{with pax_full}
916%patch5001 -p1
917%patch5002 -p1
918%else
b02a74a2 919%patch5000 -p1
a02681d3 920%patch5002 -p1
921%endif
b02a74a2 922%endif
923
01053713
AM
924%patch150 -p1
925
1b0af130 926%ifarch ppc ppc64
8dee06f0 927#patch200 -p1
1b0af130 928%endif
7e4e533b 929
27d09b3b 930# routes
dc024c24 931%patch300 -p1
27d09b3b 932
2c421faa 933# Small fixes:
1b0af130 934%patch2000 -p1
a636f0fc 935%patch2001 -p1
9aa8852b 936%patch2002 -p1
7c796d57 937#%patch2003 -p1
b5297306 938
bd6ac90c 939# Fix EXTRAVERSION in main Makefile
249a4c7b 940sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{postver}%{?alt_kernel:_%{alt_kernel}}#g' Makefile
074c0526 941
1cbd66e6
JB
942# on sparc this line causes CONFIG_INPUT=m (instead of =y), thus breaking build
943sed -i -e '/select INPUT/d' net/bluetooth/hidp/Kconfig
944
acc00c76 945# on sparc64 avoid building break due to NULL pointer type warrning
946sed -i -e 's/^EXTRA_CFLAGS := -Werror/EXTRA_CFLAGS := /' arch/sparc64/kernel/Makefile
947
e74bcc8b 948# cleanup backups after patching
12c62503 949find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
e74bcc8b 950
951%build
249a4c7b 952cd linux-%{basever}
60d1c35d 953PaXconfig () {
954 set -x
330af2a1 955 cat <<-EOCONFIG > $1
60d1c35d 956 %ifarch %{ix86}
330af2a1 957 CONFIG_PAX_SEGMEXEC=y
e9006c08 958 # performance impact on CPUs without NX bit
330af2a1 959 CONFIG_PAX_PAGEEXEC=n
2c421faa 960 # Testing KERNEXEC
961
330af2a1 962 CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n
963 CONFIG_PCI_BIOS=n
964 CONFIG_EFI=n
60d1c35d 965 %endif
330af2a1 966
60d1c35d 967 %ifarch ppc64
330af2a1 968 CONFIG_PAX_NOELFRELOCS=n
60d1c35d 969 %endif
970 %ifarch ppc
330af2a1 971 CONFIG_PAX_EMUTRAMP=y
972 CONFIG_PAX_EMUSIGRT=y
973 CONFIG_PAX_EMUPLT=y
60d1c35d 974 %endif
2c421faa 975
976 %ifarch sparc sparc64 alpha
330af2a1 977 CONFIG_PAX_EMUPLT=y
2c421faa 978 %endif
979
2c421faa 980 # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
981 # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
982 # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
983 # PAX_HOOK_ACL_FLAGS. SELinux should also be able to make PaX settings via hooks
984
985 %if %{with grsec_full}
512e1dc7 986 # Hardening grsec options if with pax
330af2a1 987 CONFIG_GRKERNSEC_PROC_MEMMAP=y
512e1dc7 988 # almost rational (see HIDESYM help)
330af2a1 989 CONFIG_GRKERNSEC_HIDESYM=y
b769102c 990
2c421faa 991 # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
992 %else
b769102c 993 # selinux or other hooks?
330af2a1 994 CONFIG_PAX_HAVE_ACL_FLAGS=n
995 CONFIG_PAX_HOOK_ACL_FLAGS=y
2c421faa 996 %endif
330af2a1 997EOCONFIG
2c421faa 998
60d1c35d 999 return 0
1000}
1001
512e1dc7 1002RescueConfig() {
1003 set -x
330af2a1 1004 cat <<-EOCONFIG > $1
1005 # CONFIG_SOUND is not set
1006 # CONFIG_AUDIT is not set
1007 # CONFIG_TR is not set
1008 # CONFIG_BT is not set
1009 # CONFIG_VIDEO_DEV is not set
1010 # CONFIG_DVB_CORE is not set
1011 # CONFIG_HAMRADIO is not set
1012 # CONFIG_ARCNET is not set
1013 # CONFIG_FB is not set
1014 # CONFIG_DRM is not set
1015 # CONFIG_WATCHDOG is not set
1016 # CONFIG_INPUT_JOYSTICK is not set
1017 # CONFIG_DEBUG_KERNEL is not set
1018 # CONFIG_ISDN is not set
1019 # CONFIG_AGP is not set
1020 # CONFIG_SECURITY is not set
1021 # CONFIG_PARIDE is not set
1022 # CONFIG_CPU_FREQ is not set
1023 # CONFIG_GAMEPORT is not set
1024 # CONFIG_KVM is not set
1025 # CONFIG_PHONE is not set
1026 CONFIG_BLK_DEV_LOOP=y
1027 CONFIG_ISO9660_FS=y
1028 CONFIG_NLS_UTF8=y
1029EOCONFIG
1030
1031 return 0
512e1dc7 1032}
1033
89311a3c 1034BuildConfig() {
2e23b44b 1035 %{?debug:set -x}
330af2a1 1036 set -e
1037
20a19493 1038 Config="kernel-%{target_arch_dir}.config"
1039 echo "Building config file for %{_target_cpu} using $Config et al."
d6a63a09 1040
330af2a1 1041 # prepare local and important options
1042 cat <<-EOCONFIG > important.config
1043%if 0%{?debug:1}
1044 CONFIG_DEBUG_SLAB=y
2d0f2103 1045 CONFIG_DEBUG_SLAB_LEAK=y
330af2a1 1046 CONFIG_DEBUG_PREEMPT=y
1047 CONFIG_RT_DEADLOCK_DETECT=y
1048%endif
2c421faa 1049
39258f30 1050%if %{without smp}
1051 CONFIG_SMP=n
1052%endif
1053
330af2a1 1054# apparmor, will be moved to external file if works
1055%if %{with apparmor}
1056 CONFIG_SECURITY_APPARMOR=y
1057 CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
1058 CONFIG_SECURITY_APPARMOR_DISABLE=n
330af2a1 1059%endif
2c421faa 1060
28713bdb 1061%if %{without ipv6}
330af2a1 1062 CONFIG_IPV6=n
28713bdb 1063%endif
1064
11dc80a5 1065%ifarch i686 athlon pentium3 pentium4
1066 %if %{with pae}
1067 CONFIG_HIGHMEM4G=n
1068 CONFIG_HIGHMEM64G=y
1069 CONFIG_X86_PAE=y
1070 %endif
1071%endif
1072
fd56bde4 1073%if %{without pcmcia}
1074 CONFIG_PCMCIA=n
1075%endif
1076
330af2a1 1077%if %{with fbcondecor}
1078 CONFIG_FB_S3=n
1079 CONFIG_FB_VT8623=n
1080 CONFIG_FB_ARK=n
1081 CONFIG_FB_TILEBLITTING=n
1082 CONFIG_FB_CON_DECOR=y
dcc54002
JR
1083%endif
1084
330af2a1 1085%if %{with nfsroot}
1086 CONFIG_NFS_FS=y
1087 CONFIG_ROOT_NFS=y
60d1c35d 1088%endif
2c421faa 1089
7197f3a3 1090# Temporary disabled RELOCATABLE. Needed only on x86??
1091%if %{with pax} || %{with grsec_full}
20a19493 1092 CONFIG_RELOCATABLE=n
347a6801 1093%endif
20a19493 1094EOCONFIG
1095
1096 RescueConfig rescue.config
1097 PaXconfig pax.config
347a6801 1098
330af2a1 1099 # prepare kernel-style config file from multiple config files
c69b2ed9 1100 %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \
330af2a1 1101 important.config \
1102%if %{with rescuecd}
1103 %{SOURCE58} \
1104 %{SOURCE59} \
1105 rescue.config \
2c421faa 1106%endif
330af2a1 1107%if %{with xenU}
1108 %{SOURCE47} \
60d1c35d 1109%endif
de0d7ee0 1110%if %{with xen0}
330af2a1 1111 %{SOURCE46} \
bf135ec7 1112%endif
330af2a1 1113 \
1114%if %{with pax_full}
1115 %{SOURCE45} \
1116 %{SOURCE49} \
1117 pax.config \
1118%else
1119 %if %{with grsec_full}
1120 %{SOURCE45} \
1121 %{SOURCE50} \
1122 %else
b8c817d6 1123 %if %{with grsec_minimal}
330af2a1 1124 %{SOURCE51} \
b8c817d6 1125 %endif
330af2a1 1126 %endif
1127 %if %{with pax}
1128 %{SOURCE49} \
1129 pax.config \
1130 %endif
bf135ec7 1131%endif
330af2a1 1132 \
1133%if %{with reiser4}
1134 %{SOURCE56} \
43e67452 1135%endif
330af2a1 1136%if %{with wrr}
1137 %{SOURCE57} \
740dff65 1138%endif
330af2a1 1139%if %{with imq}
1140 %{SOURCE55} \
512e1dc7 1141%endif
330af2a1 1142%if %{with vserver}
1143 %{SOURCE43} \
b02a74a2 1144%endif
330af2a1 1145%if %{with tuxonice}
1146%ifarch %{ix86} %{x8664} ia64 ppc ppc64
1147 %{SOURCE42} \
1148%endif
1149%endif
1150 %{SOURCE40} %{?0:netfilter} \
20a19493 1151 %{SOURCE41} %{?0:patches} \
fa35f1bb 1152 %{SOURCE20} \
20a19493 1153 $RPM_SOURCE_DIR/$Config \
330af2a1 1154 > %{defconfig}
32108e5b 1155}
1156
1f52db0a 1157BuildKernel() {
2e23b44b 1158 %{?debug:set -x}
40eea4ff 1159 echo "Building kernel $1 ..."
28d40a00 1160 install .config %{defconfig}
2fdc58ef 1161 %{__make} %{MakeOpts} mrproper \
8bd86dbb 1162 RCS_FIND_IGNORE='-name build-done -prune -o'
52e8aad6 1163 ln -sf %{defconfig} .config
601b4e87 1164
2fdc58ef 1165 %{__make} %{MakeOpts} clean \
c86751b7 1166 RCS_FIND_IGNORE='-name build-done -prune -o'
2fdc58ef 1167 %{__make} %{MakeOpts} include/linux/version.h \
81259751 1168 %{?with_verbose:V=1}
601b4e87 1169
2fdc58ef 1170 %{__make} %{MakeOpts} scripts/mkcompile_h \
2c421faa 1171 %{?with_verbose:V=1}
1172
3190e2e5 1173# make does vmlinux, modules and bzImage at once
84418e64 1174%ifarch sparc64
2fdc58ef 1175 %{__make} %{MakeOpts} image \
84418e64 1176 %{?with_verbose:V=1}
2eede5c5 1177
2fdc58ef 1178 %{__make} %{MakeOpts} modules \
460faec9 1179 %{?with_verbose:V=1}
cf06f88a 1180%else
2fdc58ef 1181 %{__make} %{MakeOpts} \
ade3916a 1182 %{?with_verbose:V=1}
601b4e87 1183%endif
41f05bdd 1184}
1185
89311a3c 1186PreInstallKernel() {
2c421faa 1187 Config="%{_target_base_arch}"
1188 KernelVer=%{kernel_release}
601b4e87
KT
1189
1190 mkdir -p $KERNEL_INSTALL_DIR/boot
1191 install System.map $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer
45d0ae91 1192%ifarch %{ix86} %{x8664}
24d8b028 1193 install arch/x86/boot/bzImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
21843074 1194 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
97365a5a 1195%endif
601b4e87
KT
1196%ifarch alpha sparc sparc64
1197 gzip -cfv vmlinux > vmlinuz
1198 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
1199 install vmlinuz $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
2fd967ba 1200%ifarch sparc
1201 elftoaout arch/sparc/boot/image -o vmlinux.aout
1202 install vmlinux.aout $KERNEL_INSTALL_DIR/boot/vmlinux.aout-$KernelVer
1203%endif
1204%ifarch sparc64
84418e64 1205 elftoaout arch/sparc64/boot/image -o vmlinux.aout
2fd967ba 1206 install vmlinux.aout $KERNEL_INSTALL_DIR/boot/vmlinux.aout-$KernelVer
46bb4084 1207%endif
601b4e87 1208%endif
3fa68acf 1209%ifarch ppc ppc64
cf06f88a
KT
1210 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
1211 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
6fb3ffc0 1212%endif
1213%ifarch ppc-broken
d779450c 1214 %{__make} -f Makefile.ppclibs install \
1215 DESTDIR=$KERNEL_INSTALL_DIR/boot/libs-$KernelVer
8cd1b586
JB
1216%endif
1217%ifarch ia64
1218 gzip -cfv vmlinux > vmlinuz
1219 install -d $KERNEL_INSTALL_DIR/boot/efi
8cd1b586
JB
1220 install vmlinuz $KERNEL_INSTALL_DIR/boot/efi/vmlinuz-$KernelVer
1221 ln -sf efi/vmlinuz-$KernelVer $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
9b3bab6e 1222%endif
2a261cfb 1223%ifarch arm
1224 install arch/arm/boot/zImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1225%endif
1226
47068aef 1227 %{__make} %{MakeOpts} modules_install firmware_install \
e7d99ddd 1228 %{?with_verbose:V=1} \
2e23b44b 1229 DEPMOD=%DepMod \
a602ba1f 1230 INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR \
47068aef 1231 INSTALL_FW_PATH=$KERNEL_INSTALL_DIR/lib/firmware/$KernelVer \
e7d99ddd 1232 KERNELRELEASE=$KernelVer
6dc0a2ea 1233
f6d2eacd 1234 # You'd probabelly want to make it somewhat different
a2b2199b 1235 install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}
2c421faa 1236 install Module.symvers $KERNEL_INSTALL_DIR%{_kernelsrcdir}/Module.symvers-dist
77c976a9 1237
6dc0a2ea 1238 echo "CHECKING DEPENDENCIES FOR KERNEL MODULES"
2e23b44b
ER
1239 if [ %DepMod = /sbin/depmod ]; then
1240 /sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae -F $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer || :
2e23b44b 1241 fi
2c421faa 1242 touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
9fe786e6
ER
1243 # binary cache produced by depmod at runtime
1244 touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.{alias,dep,symbols}.bin
6dc0a2ea 1245 echo "KERNEL RELEASE $KernelVer DONE"
601b4e87
KT
1246}
1247
1248KERNEL_BUILD_DIR=`pwd`
52bb7759 1249echo "-%{localversion}" > localversion
601b4e87 1250
2c421faa 1251KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR/build-done/kernel"
7f1ae99e 1252rm -rf $KERNEL_INSTALL_DIR
2a261cfb 1253%if %{without myown}
e74bcc8b 1254BuildConfig
2a261cfb 1255%else
1256cat $RPM_SOURCE_DIR/kernel-myown.config > %{defconfig}
1257%endif
1258ln -sf %{defconfig} .config
1259install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux
1260rm -f include/linux/autoconf.h
2fdc58ef 1261%{__make} %{MakeOpts} include/linux/autoconf.h
2a261cfb 1262install include/linux/autoconf.h \
1263 $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux/autoconf-dist.h
1264install .config \
1265 $KERNEL_INSTALL_DIR%{_kernelsrcdir}/config-dist
75287058 1266
70796952 1267%{__awk} %{?debug:-v dieOnError=1} -v infile=%{defconfig} -f %{SOURCE8} .config
75287058 1268
25d2967b
ER
1269BuildKernel
1270PreInstallKernel
7f1ae99e 1271
2fdc58ef 1272%{__make} %{MakeOpts} include/linux/utsrelease.h
86c1d748 1273cp include/linux/utsrelease.h{,.save}
2c421faa 1274cp include/linux/version.h{,.save}
1275cp scripts/mkcompile_h{,.save}
86c1d748 1276
601b4e87
KT
1277%install
1278rm -rf $RPM_BUILD_ROOT
249a4c7b 1279cd linux-%{basever}
728a94de 1280
249a4c7b 1281umask 022
2e23b44b 1282export DEPMOD=%DepMod
728a94de 1283
5253d53f 1284install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
2c421faa 1285install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
601b4e87 1286
09a8e490
ER
1287# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
1288if cp -al COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
1289 l=l
1290 rm -f $RPM_BUILD_ROOT/COPYING
1291fi
1292
601b4e87 1293KERNEL_BUILD_DIR=`pwd`
601b4e87 1294
2c421faa 1295cp -a$l $KERNEL_BUILD_DIR/build-done/kernel/* $RPM_BUILD_ROOT
9b3bab6e 1296
20a19493 1297if [ -e $RPM_BUILD_ROOT/lib/modules/%{kernel_release} ] ; then
2c421faa 1298 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
1299 ln -sf %{_kernelsrcdir} $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
1300 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{cluster,misc}
1301fi
9b3bab6e 1302
a2b2199b 1303find . -maxdepth 1 ! -name "build-done" ! -name "." -exec cp -a$l "{}" "$RPM_BUILD_ROOT%{_kernelsrcdir}/" ";"
8ba9ecd1 1304
5253d53f 1305cd $RPM_BUILD_ROOT%{_kernelsrcdir}
601b4e87 1306
2fdc58ef 1307%{__make} %{MakeOpts} mrproper archclean \
8bd86dbb 1308 RCS_FIND_IGNORE='-name build-done -prune -o'
edcebaac 1309
2c421faa 1310if [ -e $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/include/linux/autoconf-dist.h ]; then
1311 install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/include/linux/autoconf-dist.h \
1312 $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1313 install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/config-dist \
1314 $RPM_BUILD_ROOT%{_kernelsrcdir}
1cb88365 1315fi
08856617 1316
a2b2199b
ER
1317cp -Rdp$l $KERNEL_BUILD_DIR/include/linux/* \
1318 $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
601b4e87 1319
2fdc58ef 1320%{__make} %{MakeOpts} mrproper
c2986d7e
PS
1321mv -f include/linux/utsrelease.h{.save,}
1322mv -f include/linux/version.h{.save,}
1323mv -f scripts/mkcompile_h{.save,}
5253d53f
ER
1324install %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
1325install %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
5fe99c7d 1326
d89749b7 1327# collect module-build files and directories
249a4c7b 1328perl %{SOURCE7} %{_kernelsrcdir} %{_builddir}/%{name}-%{version}
d89749b7 1329
9153b8a3 1330# ghosted initrd
f9f0c8d1 1331touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
9153b8a3 1332
d67dd90c
ER
1333# rpm obeys filelinkto checks for ghosted symlinks, convert to files
1334rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1335touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1336
7c7ef692 1337# remove unnecessary dir with dead symlink
1338rm -rf $RPM_BUILD_ROOT/arch/i386
1339
601b4e87
KT
1340%clean
1341rm -rf $RPM_BUILD_ROOT
601b4e87 1342
224eb801 1343%preun
3b1bd92e 1344if [ -x /sbin/new-kernel-pkg ]; then
5253d53f 1345 /sbin/new-kernel-pkg --remove %{kernel_release}
3b1bd92e 1346fi
224eb801 1347
601b4e87 1348%post
8cd1b586 1349%ifarch ia64
f9f0c8d1 1350mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
249a4c7b 1351%{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
2dd0543f 1352ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
249a4c7b 1353%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
8cd1b586 1354%endif
f9f0c8d1 1355mv -f /boot/vmlinuz{,.old} 2> /dev/null
249a4c7b 1356%{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
f9f0c8d1 1357mv -f /boot/System.map{,.old} 2> /dev/null
249a4c7b 1358%{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
2dd0543f 1359ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
249a4c7b 1360%{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
2dd0543f 1361ln -sf System.map-%{kernel_release} /boot/System.map
249a4c7b 1362%{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
601b4e87 1363
5253d53f 1364%depmod %{kernel_release}
7392d4ab 1365
be35816e 1366/sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
97013b4b 1367mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
249a4c7b 1368%{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
2dd0543f 1369ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
249a4c7b 1370%{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
601b4e87 1371
3b1bd92e 1372if [ -x /sbin/new-kernel-pkg ]; then
249a4c7b 1373 title="PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
3bfefb8d 1374
5253d53f 1375 /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "$title"
3b1bd92e 1376elif [ -x /sbin/rc-boot ]; then
9b3bab6e
JR
1377 /sbin/rc-boot 1>&2 || :
1378fi
cf06f88a 1379
c5d76354 1380%post vmlinux
f9f0c8d1 1381mv -f /boot/vmlinux{,.old} 2> /dev/null
1382%{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
2dd0543f 1383ln -sf vmlinux-%{kernel_release} /boot/vmlinux
f9f0c8d1 1384%{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
c5d76354 1385
3383ab6c 1386%post libs
5253d53f 1387%{_sbindir}/mkvmlinuz /boot/zImage-%{kernel_release} %{kernel_release}
3383ab6c 1388
35fde00b 1389%post drm
5253d53f 1390%depmod %{kernel_release}
35fde00b
JB
1391
1392%postun drm
5253d53f 1393%depmod %{kernel_release}
35fde00b 1394
e7ae6cd3 1395%post pcmcia
5253d53f 1396%depmod %{kernel_release}
9b3bab6e 1397
e7ae6cd3 1398%postun pcmcia
5253d53f 1399%depmod %{kernel_release}
9b3bab6e 1400
35fde00b 1401%post sound-alsa
5253d53f 1402%depmod %{kernel_release}
cf06f88a 1403
35fde00b 1404%postun sound-alsa
5253d53f 1405%depmod %{kernel_release}
0575d61d 1406
1407%post sound-oss
5253d53f 1408%depmod %{kernel_release}
0575d61d 1409
1410%postun sound-oss
5253d53f 1411%depmod %{kernel_release}
0575d61d 1412
601b4e87 1413%post headers
869e45ec 1414ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
601b4e87
KT
1415
1416%postun headers
32d93861 1417if [ "$1" = "0" ]; then
869e45ec 1418 if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
1419 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
1420 rm -f %{_prefix}/src/linux%{_alt_kernel}
33e92923 1421 fi
601b4e87
KT
1422 fi
1423fi
1424
869e45ec 1425%triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
1426ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
1427ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
1428
1429%triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
1430if [ "$1" = 0 ]; then
1431 rm -f /lib/modules/%{kernel_release}/{build,source}
1432fi
1433
c5d76354 1434%files
601b4e87 1435%defattr(644,root,root,755)
46bb4084 1436%ifarch sparc sparc64
5253d53f 1437/boot/vmlinux.aout-%{kernel_release}
46bb4084 1438%endif
8cd1b586 1439%ifarch ia64
5253d53f 1440/boot/efi/vmlinuz-%{kernel_release}
8cd1b586 1441%endif
5253d53f
ER
1442/boot/vmlinuz-%{kernel_release}
1443/boot/System.map-%{kernel_release}
f9f0c8d1 1444%ghost %{initrd_dir}/initrd-%{kernel_release}.gz
47068aef 1445/lib/firmware/%{kernel_release}
5253d53f
ER
1446%dir /lib/modules/%{kernel_release}
1447%dir /lib/modules/%{kernel_release}/kernel
f959288b 1448%ifnarch sparc
5253d53f 1449/lib/modules/%{kernel_release}/kernel/arch
672a0690 1450%endif
5253d53f
ER
1451/lib/modules/%{kernel_release}/kernel/crypto
1452/lib/modules/%{kernel_release}/kernel/drivers
2a261cfb 1453%if %{have_drm} && %{without myown}
0a2b8395 1454%exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu
6c5df6cc 1455%endif
5253d53f 1456/lib/modules/%{kernel_release}/kernel/fs
2c421faa 1457
1458# this directory will be removed after disabling rcutorture mod. in 2.6.20.
5253d53f 1459/lib/modules/%{kernel_release}/kernel/kernel
2c421faa 1460
5253d53f
ER
1461/lib/modules/%{kernel_release}/kernel/lib
1462/lib/modules/%{kernel_release}/kernel/net
2a261cfb 1463%if %{have_sound} && %{without myown}
5253d53f 1464%dir /lib/modules/%{kernel_release}/kernel/sound
b3721d7e 1465/lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1466/lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
2a261cfb 1467%ifnarch sparc
ff4421de 1468%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
b3721d7e 1469%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1470%exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
04f9b17e 1471%endif
2a261cfb 1472%endif
5253d53f 1473%dir /lib/modules/%{kernel_release}/misc
2a261cfb 1474%if %{with pcmcia} && %{without myown}
b3721d7e 1475%exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
1476%exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
5253d53f 1477%exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
512e1dc7 1478%if %{without rescuecd}
ff4421de 1479%exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
5253d53f 1480%exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
5253d53f 1481%exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
b1e75fda 1482%exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
144cab6f 1483%exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
68831084 1484%exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
512e1dc7 1485%endif
1486%exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/legacy/ide-cs.ko*
5253d53f 1487%exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
ff4421de 1488%exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
5253d53f 1489%exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
ff4421de 1490%exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
5253d53f
ER
1491%exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1492%exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
5253d53f
ER
1493%exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1494%endif
5253d53f 1495%ghost /lib/modules/%{kernel_release}/modules.*
abe120f9 1496# symlinks pointing to kernelsrcdir
1497%ghost /lib/modules/%{kernel_release}/build
1498%ghost /lib/modules/%{kernel_release}/source
5253d53f 1499%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
cf06f88a 1500
c5d76354
JB
1501%ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
1502%files vmlinux
1503%defattr(644,root,root,755)
5253d53f 1504/boot/vmlinux-%{kernel_release}
c5d76354
JB
1505%endif
1506
2a261cfb 1507%if %{have_drm} && %{without myown}
35fde00b
JB
1508%files drm
1509%defattr(644,root,root,755)
0a2b8395 1510/lib/modules/%{kernel_release}/kernel/drivers/gpu
35fde00b
JB
1511%endif
1512
2a261cfb 1513%if %{with pcmcia} && %{without myown}
e7ae6cd3 1514%files pcmcia
cf06f88a 1515%defattr(644,root,root,755)
b3721d7e 1516/lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
5253d53f 1517/lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
b3721d7e 1518%exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
512e1dc7 1519%if %{without rescuecd}
5253d53f 1520/lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
5253d53f 1521/lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
b1e75fda 1522/lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
144cab6f 1523/lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
512e1dc7 1524%endif
ff4421de 1525/lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
512e1dc7 1526/lib/modules/%{kernel_release}/kernel/drivers/ide/legacy/ide-cs.ko*
5253d53f 1527/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
ff4421de 1528/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
5253d53f 1529/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
ff4421de 1530/lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
5253d53f
ER
1531/lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1532/lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
5253d53f 1533/lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
35fde00b 1534%endif
9b3bab6e 1535
6fb3ffc0 1536%ifarch ppc-broken
b443ca49 1537%if "%{_arch}" == "ppc"
d779450c 1538%files libs
1539%defattr(644,root,root,755)
5253d53f
ER
1540%dir /boot/libs-%{kernel_release}
1541/boot/libs-%{kernel_release}/common
1542/boot/libs-%{kernel_release}/kernel
1543/boot/libs-%{kernel_release}/lib
1544/boot/libs-%{kernel_release}/of1275
1545/boot/libs-%{kernel_release}/openfirmware
1546/boot/libs-%{kernel_release}/simple
1547%dir /boot/libs-%{kernel_release}/utils
1548%attr(755,root,root) /boot/libs-%{kernel_release}/utils/*
1549/boot/libs-%{kernel_release}/ld.script
d779450c 1550%endif
b443ca49 1551%endif
d779450c 1552
2a261cfb 1553%if %{have_sound} && %{without myown}
35fde00b
JB
1554%files sound-alsa
1555%defattr(644,root,root,755)
5253d53f
ER
1556/lib/modules/%{kernel_release}/kernel/sound
1557%exclude %dir /lib/modules/%{kernel_release}/kernel/sound
b3721d7e 1558%exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1559%exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
fbb03e0d 1560%if %{have_oss}
5253d53f 1561%exclude /lib/modules/%{kernel_release}/kernel/sound/oss
f12ce97e 1562%endif
2a261cfb 1563%ifnarch sparc
ff4421de 1564/lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
ff4421de 1565/lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
b3721d7e 1566/lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1567/lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
2a261cfb 1568%endif
35fde00b 1569
2a261cfb 1570%if %{have_oss} && %{without myown}
35fde00b 1571%files sound-oss
9b3bab6e 1572%defattr(644,root,root,755)
5253d53f 1573/lib/modules/%{kernel_release}/kernel/sound/oss
7291f0f8 1574%endif
512e1dc7 1575%endif
601b4e87
KT
1576
1577%files headers
1578%defattr(644,root,root,755)
5253d53f
ER
1579%dir %{_kernelsrcdir}
1580%{_kernelsrcdir}/include
2c421faa 1581%{_kernelsrcdir}/config-dist
1582%{_kernelsrcdir}/Module.symvers-dist
d20b1dc0 1583
ecc2a0f6 1584%files module-build -f aux_files
d20b1dc0 1585%defattr(644,root,root,755)
2c421faa 1586# symlinks pointint to kernelsrcdir
1587%dir /lib/modules/%{kernel_release}
1588/lib/modules/%{kernel_release}/build
5253d53f 1589%{_kernelsrcdir}/localversion
01053713
AM
1590%ifarch ppc ppc64
1591%{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1592%endif
08c11c7a 1593%{_kernelsrcdir}/arch/*/kernel/asm-offsets*
7bef4bf5 1594%{_kernelsrcdir}/arch/*/kernel/sigframe*.h
27dad056 1595%{_kernelsrcdir}/drivers/lguest/lg.h
8b54ea24 1596%{_kernelsrcdir}/kernel/bounds.c
5253d53f
ER
1597%dir %{_kernelsrcdir}/scripts
1598%dir %{_kernelsrcdir}/scripts/kconfig
1599%{_kernelsrcdir}/scripts/Kbuild.include
1600%{_kernelsrcdir}/scripts/Makefile*
1601%{_kernelsrcdir}/scripts/basic
1602%{_kernelsrcdir}/scripts/mkmakefile
1603%{_kernelsrcdir}/scripts/mod
1604%{_kernelsrcdir}/scripts/setlocalversion
1605%{_kernelsrcdir}/scripts/*.c
1606%{_kernelsrcdir}/scripts/*.sh
1607%{_kernelsrcdir}/scripts/kconfig/*
2c421faa 1608%{_kernelsrcdir}/scripts/mkcompile_h
601b4e87
KT
1609
1610%files doc
1611%defattr(644,root,root,755)
76fa8c91 1612%dir %{_kernelsrcdir}
5253d53f 1613%{_kernelsrcdir}/Documentation
601b4e87 1614
402404fb 1615%if %{with source}
ecc2a0f6 1616%files source -f aux_files_exc
601b4e87 1617%defattr(644,root,root,755)
5253d53f
ER
1618%{_kernelsrcdir}/arch/*/[!Mk]*
1619%{_kernelsrcdir}/arch/*/kernel/[!M]*
763091d9
PS
1620%{_kernelsrcdir}/arch/ia64/kvm
1621%{_kernelsrcdir}/arch/powerpc/kvm
01053713 1622%ifarch ppc ppc64
bb1e7be4 1623%exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
01053713 1624%endif
763091d9 1625%{_kernelsrcdir}/arch/s390/kvm
27dad056 1626%{_kernelsrcdir}/arch/x86/kvm
08c11c7a 1627%exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
7bef4bf5 1628%exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
27dad056 1629%exclude %{_kernelsrcdir}/drivers/lguest/lg.h
5253d53f
ER
1630%{_kernelsrcdir}/block
1631%{_kernelsrcdir}/crypto
1632%{_kernelsrcdir}/drivers
1633%{_kernelsrcdir}/fs
a52b9424 1634%if %{with grsecurity} && %{without rescuecd}
5253d53f
ER
1635%{_kernelsrcdir}/grsecurity
1636%endif
1637%{_kernelsrcdir}/init
1638%{_kernelsrcdir}/ipc
1639%{_kernelsrcdir}/kernel
8b54ea24 1640%exclude %{_kernelsrcdir}/kernel/bounds.c
5253d53f
ER
1641%{_kernelsrcdir}/lib
1642%{_kernelsrcdir}/mm
1643%{_kernelsrcdir}/net
27dad056 1644%{_kernelsrcdir}/virt
5253d53f
ER
1645%{_kernelsrcdir}/scripts/*
1646%exclude %{_kernelsrcdir}/scripts/Kbuild.include
1647%exclude %{_kernelsrcdir}/scripts/Makefile*
1648%exclude %{_kernelsrcdir}/scripts/basic
1649%exclude %{_kernelsrcdir}/scripts/kconfig
1650%exclude %{_kernelsrcdir}/scripts/mkmakefile
1651%exclude %{_kernelsrcdir}/scripts/mod
1652%exclude %{_kernelsrcdir}/scripts/setlocalversion
1653%exclude %{_kernelsrcdir}/scripts/*.c
1654%exclude %{_kernelsrcdir}/scripts/*.sh
1655%{_kernelsrcdir}/sound
1656%{_kernelsrcdir}/security
1657%{_kernelsrcdir}/usr
1658%{_kernelsrcdir}/COPYING
1659%{_kernelsrcdir}/CREDITS
1660%{_kernelsrcdir}/MAINTAINERS
1661%{_kernelsrcdir}/README
1662%{_kernelsrcdir}/REPORTING-BUGS
869e45ec 1663%{_kernelsrcdir}/.mailmap
9b3bab6e 1664%endif
This page took 1.637258 seconds and 4 git commands to generate.