]>
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 | ||
d039881e | 95 | %define basever 3.1 |
74d7880b | 96 | %define postver .0 |
d039881e | 97 | %define rel 0.1 |
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 |
d039881e AM |
141 | Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%{basever}.tar.xz |
142 | # Source0-md5: edbdc798f23ae0f8045c82f6fa22c536 | |
4d8c31dd | 143 | %if "%{postver}" != ".0" |
d039881e AM |
144 | Patch0: http://www.kernel.org/pub/linux/kernel/v3.x/patch-%{version}.bz2 |
145 | # Patch0-md5: 7526abc1f3df0506c71e0918ffaedb11 | |
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 | |
7b17263b | 243 | # http://vserver.13thfloor.at/Experimental/patch-3.0.4-vs2.3.1.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 | |
6b53c3da | 251 | # http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.10_for_3.1.0-rc4.diff.gz |
351f379b | 252 | Patch140: kernel-unionfs.patch |
351f379b | 253 | |
53392da6 | 254 | # git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git, read README |
b752ccd1 | 255 | # Patch creation: |
53392da6 AM |
256 | # git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git |
257 | # cd aufs3-standalone | |
258 | # git checkout -b aufs3.0 origin/aufs3.0 | |
259 | # cat aufs3-kbuild.patch aufs3-base.patch aufs3-standalone.patch > ~/rpm/packages/kernel/kernel-aufs3.patch | |
b752ccd1 AM |
260 | # mkdir linux |
261 | # cp -a Documentation fs include linux | |
53392da6 | 262 | # diff -urN /usr/share/empty linux >> ~/rpm/packages/kernel/kernel-aufs3.patch |
0c5527e5 | 263 | # |
53392da6 | 264 | Patch145: kernel-aufs3.patch |
20493b41 | 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 | ||
087770d6 | 288 | # based on http://grsecurity.net/~spender/grsecurity-2.2.2-3.0.7-201110200052.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 | |
629cbd08 | 328 | Obsoletes: kernel%{_alt_kernel}-char-lirc-ene0100 |
84fce0ae | 329 | Obsoletes: kernel%{_alt_kernel}-char-lirc-it87 |
5167b891 | 330 | Obsoletes: kernel%{_alt_kernel}-char-lirc-ite8709 |
cde4ab95 | 331 | Obsoletes: kernel%{_alt_kernel}-char-lirc-mceusb |
353211e2 | 332 | Obsoletes: kernel%{_alt_kernel}-char-lirc-streamzap |
26b1ceeb | 333 | Obsoletes: kernel-firmware |
351f379b JR |
334 | Obsoletes: kernel-misc-acer_acpi |
335 | Obsoletes: kernel-misc-fuse | |
336 | Obsoletes: kernel-misc-uvc | |
a5585a68 | 337 | Obsoletes: kernel-modules |
351f379b JR |
338 | Obsoletes: kernel-net-ar81 |
339 | Obsoletes: kernel-net-hostap | |
340 | Obsoletes: kernel-net-ieee80211 | |
341 | Obsoletes: kernel-net-ipp2p | |
342 | Obsoletes: kernel-net-rt61 | |
343 | Obsoletes: kernel-smp | |
344 | Conflicts: e2fsprogs < 1.29 | |
345 | Conflicts: isdn4k-utils < 3.1pre1 | |
346 | Conflicts: jfsutils < 1.1.3 | |
cf8de22f | 347 | Conflicts: lvm2 < 2.02.40 |
351f379b JR |
348 | Conflicts: nfs-utils < 1.0.5 |
349 | Conflicts: oprofile < 0.9 | |
350 | Conflicts: ppp < 1:2.4.0 | |
351 | Conflicts: procps < 3.2.0 | |
352 | Conflicts: quota-tools < 3.09 | |
4dabe329 | 353 | %{?with_reiserfs4:Conflicts: reiser4progs < 1.0.0} |
351f379b | 354 | Conflicts: reiserfsprogs < 3.6.3 |
4dabe329 | 355 | Conflicts: rpm < 4.4.2-0.2 |
351f379b JR |
356 | Conflicts: udev < 1:081 |
357 | Conflicts: util-linux < 2.10o | |
d3c4e01e | 358 | Conflicts: util-vserver < 0.30.216 |
351f379b JR |
359 | Conflicts: xfsprogs < 2.6.0 |
360 | %if %{with pae} | |
361 | ExcludeArch: i386 i486 i586 | |
362 | %else | |
363 | ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64 | |
364 | %endif | |
a5585a68 AM |
365 | ExclusiveOS: Linux |
366 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
367 | ||
351f379b JR |
368 | %ifarch %{ix86} %{x8664} |
369 | %define target_arch_dir x86 | |
370 | %endif | |
371 | %ifarch ppc ppc64 | |
372 | %define target_arch_dir powerpc | |
373 | %endif | |
5a99ae3d | 374 | %ifarch sparc sparc64 |
375 | %define target_arch_dir sparc | |
376 | %endif | |
377 | %ifnarch %{ix86} %{x8664} ppc ppc64 sparc sparc64 | |
351f379b JR |
378 | %define target_arch_dir %{_target_base_arch} |
379 | %endif | |
380 | ||
381 | %define defconfig arch/%{target_arch_dir}/defconfig | |
382 | ||
383 | # No ELF objects there to strip (skips processing 27k files) | |
ded910ba | 384 | %define _noautostrip \\(.*%{_kernelsrcdir}/.*\\|.*/vmlinux.*\\) |
351f379b JR |
385 | %define _noautochrpath .*%{_kernelsrcdir}/.* |
386 | ||
a5585a68 AM |
387 | %ifarch ia64 |
388 | %define initrd_dir /boot/efi | |
389 | %else | |
390 | %define initrd_dir /boot | |
391 | %endif | |
392 | ||
351f379b | 393 | %define topdir %{_builddir}/%{name}-%{version} |
67d87e28 | 394 | %define srcdir %{topdir}/linux-%{basever} |
351f379b JR |
395 | %define objdir %{topdir}/%{targetobj} |
396 | %define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion) | |
397 | ||
398 | %define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version} | |
399 | ||
400 | %if "%{_target_base_arch}" != "%{_arch}" | |
401 | %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux- | |
402 | %define DepMod /bin/true | |
403 | ||
404 | %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64" | |
405 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
406 | %define DepMod /sbin/depmod | |
407 | %endif | |
408 | ||
409 | %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc" | |
410 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
411 | %define DepMod /sbin/depmod | |
412 | %endif | |
413 | ||
414 | %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386" | |
415 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
416 | %define DepMod /sbin/depmod | |
417 | %endif | |
418 | ||
5a99ae3d | 419 | %if "%{_target_base_arch}" == "ppc" || "%{_target_base_arch}" == "ppc64" |
351f379b JR |
420 | %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux- |
421 | %endif | |
422 | %else | |
423 | %ifarch ppc ppc64 | |
424 | %define CrossOpts ARCH=powerpc CC="%{__cc}" | |
425 | %else | |
426 | %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}" | |
427 | %endif | |
428 | %define DepMod /sbin/depmod | |
429 | %endif | |
430 | %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}" | |
431 | ||
52e5f3df | 432 | %define __features \ |
15a064bf | 433 | %{?with_grsecurity:Grsecurity support - enabled}\ |
351f379b JR |
434 | %{?with_pax:PaX support - enabled}\ |
435 | %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\ | |
436 | %{?with_nfsroot:Root on NFS - enabled}\ | |
351f379b JR |
437 | |
438 | %define Features %(echo "%{__features}" | sed '/^$/d') | |
439 | ||
a5585a68 AM |
440 | %description |
441 | This package contains the Linux kernel that is used to boot and run | |
442 | your system. It contains few device drivers for specific hardware. | |
443 | Most hardware is instead supported by modules loaded after booting. | |
444 | ||
351f379b JR |
445 | %{Features} |
446 | ||
3a467bc1 JR |
447 | %description -l de.UTF-8 |
448 | Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des | |
449 | Linux-Betriebssystems. Der Kernel ist für grundliegende | |
a5585a68 | 450 | Systemfunktionen verantwortlich: Speicherreservierung, |
3a467bc1 | 451 | Prozeß-Management, Geräte Ein- und Ausgaben, usw. |
a5585a68 | 452 | |
351f379b JR |
453 | %{Features} |
454 | ||
3a467bc1 | 455 | %description -l fr.UTF-8 |
a5585a68 | 456 | Le package kernel contient le kernel linux (vmlinuz), la partie |
3a467bc1 JR |
457 | centrale d'un système d'exploitation Linux. Le noyau traite les |
458 | fonctions basiques d'un système d'exploitation: allocation mémoire, | |
459 | allocation de process, entrée/sortie de peripheriques, etc. | |
a5585a68 | 460 | |
351f379b JR |
461 | %{Features} |
462 | ||
3a467bc1 JR |
463 | %description -l pl.UTF-8 |
464 | Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania | |
465 | Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego | |
466 | się w komputerze, takiego jak sterowniki dysków itp. | |
a5585a68 | 467 | |
351f379b JR |
468 | %{Features} |
469 | ||
470 | %package vmlinux | |
471 | Summary: vmlinux - uncompressed kernel image | |
472 | Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild | |
473 | Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra | |
474 | Group: Base/Kernel | |
475 | Obsoletes: kernel-smp-vmlinux | |
476 | ||
477 | %description vmlinux | |
478 | vmlinux - uncompressed kernel image. | |
479 | ||
480 | %description vmlinux -l de.UTF-8 | |
481 | vmlinux - dekompressiertes Kernel Bild. | |
482 | ||
483 | %description vmlinux -l pl.UTF-8 | |
484 | vmlinux - rozpakowany obraz jądra. | |
485 | ||
a5585a68 AM |
486 | %package drm |
487 | Summary: DRM kernel modules | |
351f379b JR |
488 | Summary(de.UTF-8): DRM Kernel Treiber |
489 | Summary(pl.UTF-8): Sterowniki DRM | |
a5585a68 | 490 | Group: Base/Kernel |
351f379b JR |
491 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
492 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
493 | Obsoletes: kernel-smp-drm | |
07ff8614 | 494 | AutoReqProv: no |
a5585a68 AM |
495 | |
496 | %description drm | |
351f379b JR |
497 | DRM kernel modules. |
498 | ||
499 | %description drm -l de.UTF-8 | |
500 | DRM Kernel Treiber. | |
a5585a68 | 501 | |
3a467bc1 | 502 | %description drm -l pl.UTF-8 |
351f379b | 503 | Sterowniki DRM. |
a5585a68 AM |
504 | |
505 | %package pcmcia | |
506 | Summary: PCMCIA modules | |
351f379b JR |
507 | Summary(de.UTF-8): PCMCIA Module |
508 | Summary(pl.UTF-8): Moduły PCMCIA | |
a5585a68 | 509 | Group: Base/Kernel |
351f379b JR |
510 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
511 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
512 | Obsoletes: kernel-smp-pcmcia | |
513 | Conflicts: pcmcia-cs < 3.1.21 | |
514 | Conflicts: pcmciautils < 004 | |
07ff8614 | 515 | AutoReqProv: no |
a5585a68 AM |
516 | |
517 | %description pcmcia | |
351f379b JR |
518 | PCMCIA modules. |
519 | ||
520 | %description pcmcia -l de.UTF-8 | |
521 | PCMCIA Module. | |
a5585a68 | 522 | |
3a467bc1 | 523 | %description pcmcia -l pl.UTF-8 |
351f379b JR |
524 | Moduły PCMCIA. |
525 | ||
a5585a68 AM |
526 | %package sound-alsa |
527 | Summary: ALSA kernel modules | |
351f379b JR |
528 | Summary(de.UTF-8): ALSA Kernel Module |
529 | Summary(pl.UTF-8): Sterowniki dźwięku ALSA | |
a5585a68 | 530 | Group: Base/Kernel |
351f379b JR |
531 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
532 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
533 | Obsoletes: kernel-smp-sound-alsa | |
07ff8614 | 534 | AutoReqProv: no |
a5585a68 AM |
535 | |
536 | %description sound-alsa | |
537 | ALSA (Advanced Linux Sound Architecture) sound drivers. | |
538 | ||
351f379b JR |
539 | %description sound-alsa -l de.UTF-8 |
540 | ALSA (Advanced Linux Sound Architecture) Sound-Treiber. | |
541 | ||
3a467bc1 JR |
542 | %description sound-alsa -l pl.UTF-8 |
543 | Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture). | |
a5585a68 AM |
544 | |
545 | %package sound-oss | |
546 | Summary: OSS kernel modules | |
351f379b JR |
547 | Summary(de.UTF-8): OSS Kernel Module |
548 | Summary(pl.UTF-8): Sterowniki dźwięku OSS | |
a5585a68 | 549 | Group: Base/Kernel |
351f379b JR |
550 | Requires(postun): %{name} = %{epoch}:%{version}-%{release} |
551 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
552 | Obsoletes: kernel-smp-sound-oss | |
07ff8614 | 553 | AutoReqProv: no |
a5585a68 AM |
554 | |
555 | %description sound-oss | |
556 | OSS (Open Sound System) drivers. | |
557 | ||
351f379b JR |
558 | %description sound-oss -l de.UTF-8 |
559 | OSS (Open Sound System) Treiber. | |
560 | ||
3a467bc1 JR |
561 | %description sound-oss -l pl.UTF-8 |
562 | Sterowniki dźwięku OSS (Open Sound System). | |
a5585a68 | 563 | |
a5585a68 AM |
564 | %package headers |
565 | Summary: Header files for the Linux kernel | |
351f379b JR |
566 | Summary(de.UTF-8): Header Dateien für den Linux-Kernel |
567 | Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa | |
568 | Group: Development/Building | |
52e5f3df | 569 | Provides: %{name}-headers(netfilter) = 20070806 |
07ff8614 | 570 | AutoReqProv: no |
a5585a68 AM |
571 | |
572 | %description headers | |
573 | These are the C header files for the Linux kernel, which define | |
351f379b JR |
574 | structures and constants that are needed when rebuilding the kernel or |
575 | building kernel modules. | |
576 | ||
577 | %description headers -l de.UTF-8 | |
578 | Dies sind die C Header Dateien für den Linux-Kernel, die definierte | |
579 | Strukturen und Konstante beinhalten, die beim rekompilieren des | |
580 | Kernels oder bei Kernel Modul kompilationen gebraucht werden. | |
a5585a68 | 581 | |
3a467bc1 JR |
582 | %description headers -l pl.UTF-8 |
583 | Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra | |
584 | oraz budowania modułów jądra. | |
a5585a68 AM |
585 | |
586 | %package module-build | |
587 | Summary: Development files for building kernel modules | |
351f379b JR |
588 | Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebraucht werden |
589 | Summary(pl.UTF-8): Pliki służące do budowania modułów jądra | |
590 | Group: Development/Building | |
a5585a68 | 591 | Requires: %{name}-headers = %{epoch}:%{version}-%{release} |
6cdfd0b2 | 592 | Conflicts: rpmbuild(macros) < 1.619 |
07ff8614 | 593 | AutoReqProv: no |
a5585a68 AM |
594 | |
595 | %description module-build | |
596 | Development files from kernel source tree needed to build Linux kernel | |
597 | modules from external packages. | |
598 | ||
351f379b JR |
599 | %description module-build -l de.UTF-8 |
600 | Development Dateien des Linux-Kernels die beim kompilieren externer | |
601 | Kernel Module gebraucht werden. | |
602 | ||
3a467bc1 JR |
603 | %description module-build -l pl.UTF-8 |
604 | Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra | |
605 | Linuksa z zewnętrznych pakietów. | |
a5585a68 AM |
606 | |
607 | %package source | |
608 | Summary: Kernel source tree | |
351f379b JR |
609 | Summary(de.UTF-8): Der Kernel Quelltext |
610 | Summary(pl.UTF-8): Kod źródłowy jądra Linuksa | |
611 | Group: Development/Building | |
a5585a68 | 612 | Requires: %{name}-module-build = %{epoch}:%{version}-%{release} |
07ff8614 | 613 | AutoReqProv: no |
a5585a68 AM |
614 | |
615 | %description source | |
351f379b JR |
616 | This is the source code for the Linux kernel. You can build a custom |
617 | kernel that is better tuned to your particular hardware. | |
a5585a68 | 618 | |
3a467bc1 JR |
619 | %description source -l de.UTF-8 |
620 | Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des | |
a5585a68 | 621 | Linux-Kernels. Die Source-Dateien werden gebraucht, um viele |
351f379b | 622 | C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die |
3a467bc1 | 623 | im Kernel-Source definiert sind. Die Source-Dateien können auch |
351f379b | 624 | benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre |
a5585a68 AM |
625 | Hardware ausgerichtet ist. |
626 | ||
3a467bc1 | 627 | %description source -l fr.UTF-8 |
a5585a68 | 628 | Le package pour le kernel-source contient le code source pour le noyau |
3a467bc1 JR |
629 | linux. Ces sources sont nécessaires pour compiler la plupart des |
630 | programmes C, car il dépend de constantes définies dans le code | |
631 | source. Les sources peuvent être aussi utilisée pour compiler un noyau | |
632 | personnalisé pour avoir de meilleures performances sur des matériels | |
a5585a68 AM |
633 | particuliers. |
634 | ||
3a467bc1 JR |
635 | %description source -l pl.UTF-8 |
636 | Pakiet zawiera kod źródłowy jądra systemu. | |
a5585a68 AM |
637 | |
638 | %package doc | |
639 | Summary: Kernel documentation | |
351f379b JR |
640 | Summary(de.UTF-8): Kernel Dokumentation |
641 | Summary(pl.UTF-8): Dokumentacja do jądra Linuksa | |
642 | Group: Documentation | |
07ff8614 | 643 | AutoReqProv: no |
a5585a68 AM |
644 | |
645 | %description doc | |
646 | This is the documentation for the Linux kernel, as found in | |
647 | /usr/src/linux/Documentation directory. | |
648 | ||
351f379b JR |
649 | %description doc -l de.UTF-8 |
650 | Dies ist die Kernel Dokumentation wie sie im 'Documentation' | |
651 | Verzeichniss vorgefunden werden kann. | |
652 | ||
3a467bc1 JR |
653 | %description doc -l pl.UTF-8 |
654 | Pakiet zawiera dokumentację do jądra Linuksa pochodzącą z katalogu | |
a5585a68 AM |
655 | /usr/src/linux/Documentation. |
656 | ||
657 | %prep | |
351f379b JR |
658 | %setup -qc |
659 | ln -s %{SOURCE7} kernel-module-build.pl | |
660 | ln -s %{SOURCE10} Makefile | |
67d87e28 | 661 | cd linux-%{basever} |
a5585a68 | 662 | |
351f379b | 663 | # hack against warning in pax/grsec |
351f379b | 664 | sed -i 's/-Werror//' arch/alpha/kernel/Makefile |
a5585a68 | 665 | |
c6897157 | 666 | |
1c5b0f0a | 667 | %if "%{postver}" != ".0" |
c6897157 | 668 | %patch0 -p1 |
351f379b | 669 | %endif |
a5585a68 | 670 | |
7141a3b6 | 671 | %if %{without vanilla} |
672 | ||
351f379b JR |
673 | # tuxonice: |
674 | %if %{with tuxonice} | |
351f379b JR |
675 | %patch69 -p1 |
676 | %patch70 -p1 | |
351f379b | 677 | %endif |
bf6838be | 678 | |
351f379b JR |
679 | %if %{with fbcondecor} |
680 | %patch3 -p1 | |
a5585a68 | 681 | %endif |
351f379b | 682 | %patch4 -p1 |
1414594b | 683 | %patch5 -p1 |
a5585a68 | 684 | |
351f379b JR |
685 | ## netfilter |
686 | # | |
a5585a68 | 687 | |
351f379b JR |
688 | # kernel-pom-ng-IPV4OPTSSTRIP.patch |
689 | %patch10 -p1 | |
a5585a68 | 690 | |
351f379b JR |
691 | # kernel-pom-ng-mms-conntrack-nat.patch |
692 | %patch16 -p1 | |
a5585a68 | 693 | |
351f379b JR |
694 | # kernel-pom-ng-rsh.patch |
695 | %patch22 -p1 | |
a5585a68 | 696 | |
351f379b JR |
697 | # kernel-pom-ng-rpc.patch |
698 | %patch23 -p1 | |
a5585a68 | 699 | |
351f379b JR |
700 | # kernel-nf_rtsp.patch |
701 | %patch36 -p1 | |
a5585a68 | 702 | |
351f379b JR |
703 | # kernel-owner-xid.patch |
704 | %if %{with vserver} | |
705 | %patch37 -p1 | |
a5585a68 | 706 | %endif |
a5585a68 | 707 | |
351f379b JR |
708 | # kernel-layer7.patch |
709 | %patch40 -p1 | |
710 | ||
351f379b JR |
711 | ## |
712 | # end of netfilter | |
713 | ||
714 | # zph | |
715 | %patch49 -p1 | |
716 | ||
717 | %if %{with imq} | |
718 | %patch50 -p1 | |
a5585a68 | 719 | %endif |
351f379b JR |
720 | |
721 | # reiser4 | |
722 | %if %{with reiser4} | |
723 | %patch51 -p1 | |
a5585a68 | 724 | %endif |
351f379b | 725 | |
351f379b | 726 | # esfq |
068b6c82 AM |
727 | %if %{with esfq} |
728 | %patch53 -p1 | |
729 | %endif | |
351f379b JR |
730 | |
731 | %if %{with wrr} | |
732 | %patch52 -p1 | |
a5585a68 | 733 | %endif |
351f379b JR |
734 | |
735 | # toshiba_acpi | |
736 | %patch54 -p1 | |
737 | ||
738 | %patch55 -p1 | |
739 | %patch56 -p1 | |
740 | ||
351f379b JR |
741 | # kernel-rndis_host-wm5.patch |
742 | %patch59 -p1 | |
743 | ||
744 | # hostap enhancements from/for aircrack-ng | |
745 | %patch85 -p1 | |
746 | ||
351f379b JR |
747 | # vserver |
748 | %if %{with vserver} | |
749 | %patch100 -p1 | |
750 | %patch101 -p1 | |
a5585a68 | 751 | %endif |
351f379b | 752 | |
351f379b JR |
753 | # forcedeth |
754 | %patch130 -p1 | |
a5585a68 | 755 | |
17da405a | 756 | # aufs2 |
4f0767ce JR |
757 | %if %{with reiser4} |
758 | %patch148 -p1 | |
759 | %endif | |
20493b41 JR |
760 | %patch145 -p1 |
761 | %patch146 -p1 | |
762 | ||
763 | # unionfs | |
764 | %patch140 -p1 | |
a5585a68 | 765 | |
351f379b JR |
766 | %if %{with rescuecd} |
767 | %patch7000 -p1 | |
e981df17 | 768 | %endif |
a5585a68 | 769 | |
351f379b JR |
770 | # grsecurity & pax stuff |
771 | # | |
351f379b | 772 | |
17da405a | 773 | %if %{with grsecurity} |
b2fd5bd8 | 774 | %patch9999 -p1 |
52daa4ad | 775 | # aufs needs this |
285f3774 | 776 | %patch147 -p1 |
b2fd5bd8 JR |
777 | %{?with_vserver:%patch10000 -p1} |
778 | %{?with_vserver:%patch10001 -p1} | |
779 | %{?with_vserver:%patch10002 -p1} | |
351f379b | 780 | %endif |
351f379b JR |
781 | # |
782 | # end of grsecurity & pax stuff | |
783 | ||
df4db69a | 784 | # apparmor |
df4db69a | 785 | %patch5000 -p1 |
df4db69a | 786 | |
54fd642e | 787 | %patch250 -p1 |
788 | ||
31f62932 AM |
789 | # virtio-gl |
790 | %patch400 -p1 | |
791 | ||
7141a3b6 | 792 | %endif # vanilla |
793 | ||
351f379b | 794 | # Small fixes: |
08aa9d92 | 795 | %patch2000 -p1 |
351f379b JR |
796 | %patch2001 -p1 |
797 | #%patch2003 -p1 | |
a5585a68 | 798 | |
73cc1c57 | 799 | # Do not remove this, please! |
800 | #%patch50000 -p1 | |
801 | ||
351f379b | 802 | # Fix EXTRAVERSION in main Makefile |
1c5b0f0a | 803 | sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile |
a5585a68 | 804 | |
351f379b JR |
805 | # cleanup backups after patching |
806 | find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f | |
a5585a68 | 807 | |
351f379b JR |
808 | %build |
809 | install -d %{objdir} | |
810 | cat > %{targetobj}.mk <<'EOF' | |
811 | # generated by %{name}.spec | |
d85d4a9b | 812 | KERNELSRC := %{srcdir} |
351f379b JR |
813 | KERNELOUTPUT := %{objdir} |
814 | ||
815 | SRCARCH := %{target_arch_dir} | |
816 | ARCH := %{_target_base_arch} | |
817 | Q := %{!?with_verbose:@} | |
818 | MAKE_OPTS := %{MakeOpts} | |
819 | DEFCONFIG := %{defconfig} | |
820 | EOF | |
a5585a68 | 821 | |
351f379b JR |
822 | PaXconfig() { |
823 | set -x | |
824 | cat <<-EOCONFIG > $1 | |
825 | %ifarch %{ix86} | |
826 | CONFIG_PAX_SEGMEXEC=y | |
827 | # performance impact on CPUs without NX bit | |
828 | CONFIG_PAX_PAGEEXEC=n | |
829 | # Testing KERNEXEC | |
830 | ||
831 | CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n | |
832 | CONFIG_PCI_BIOS=n | |
833 | CONFIG_EFI=n | |
834 | %endif | |
a5585a68 | 835 | |
351f379b JR |
836 | %ifarch ppc64 |
837 | CONFIG_PAX_NOELFRELOCS=n | |
838 | %endif | |
839 | %ifarch ppc | |
840 | CONFIG_PAX_EMUTRAMP=y | |
841 | CONFIG_PAX_EMUSIGRT=y | |
842 | CONFIG_PAX_EMUPLT=y | |
843 | %endif | |
a5585a68 | 844 | |
351f379b JR |
845 | %ifarch sparc sparc64 alpha |
846 | CONFIG_PAX_EMUPLT=y | |
847 | %endif | |
a5585a68 | 848 | |
d615e060 | 849 | # Now we have to check MAC system integration. Grsecurity uses PAX_HAVE_ACL_FLAGS |
351f379b JR |
850 | # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably |
851 | # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used | |
e69c45e8 | 852 | # PAX_HOOK_ACL_FLAGS. |
351f379b | 853 | |
15a064bf | 854 | %if %{with grsecurity} |
351f379b JR |
855 | # Hardening grsec options if with pax |
856 | CONFIG_GRKERNSEC_PROC_MEMMAP=y | |
857 | # almost rational (see HIDESYM help) | |
858 | CONFIG_GRKERNSEC_HIDESYM=y | |
859 | ||
860 | # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config | |
861 | %else | |
351f379b JR |
862 | CONFIG_PAX_HAVE_ACL_FLAGS=n |
863 | CONFIG_PAX_HOOK_ACL_FLAGS=y | |
864 | %endif | |
865 | EOCONFIG | |
a5585a68 | 866 | |
351f379b JR |
867 | return 0 |
868 | } | |
a5585a68 | 869 | |
351f379b JR |
870 | RescueConfig() { |
871 | set -x | |
872 | cat <<-EOCONFIG > $1 | |
873 | # CONFIG_SOUND is not set | |
874 | # CONFIG_AUDIT is not set | |
875 | # CONFIG_TR is not set | |
876 | # CONFIG_BT is not set | |
877 | # CONFIG_VIDEO_DEV is not set | |
878 | # CONFIG_DVB_CORE is not set | |
879 | # CONFIG_HAMRADIO is not set | |
880 | # CONFIG_ARCNET is not set | |
881 | # CONFIG_FB is not set | |
882 | # CONFIG_DRM is not set | |
883 | # CONFIG_WATCHDOG is not set | |
884 | # CONFIG_INPUT_JOYSTICK is not set | |
885 | # CONFIG_DEBUG_KERNEL is not set | |
886 | # CONFIG_ISDN is not set | |
887 | # CONFIG_AGP is not set | |
888 | # CONFIG_SECURITY is not set | |
889 | # CONFIG_PARIDE is not set | |
890 | # CONFIG_CPU_FREQ is not set | |
891 | # CONFIG_GAMEPORT is not set | |
892 | # CONFIG_KVM is not set | |
893 | # CONFIG_PHONE is not set | |
dd55897d | 894 | # CONFIG_STRICT_DEVMEM is not set |
6bab3a31 | 895 | # CONFIG_IMA is not set |
351f379b | 896 | CONFIG_AUFS=y |
a899ef35 | 897 | CONFIG_AUFS_FS=y |
898 | CONFIG_AUFS_BR_RAMFS=y | |
62fff140 | 899 | CONFIG_AUFS_RDU=y |
351f379b JR |
900 | CONFIG_BLK_DEV_LOOP=y |
901 | CONFIG_ISO9660_FS=y | |
902 | CONFIG_NLS_UTF8=y | |
6b79006d | 903 | CONFIG_SQUASHFS=y |
351f379b JR |
904 | EOCONFIG |
905 | ||
906 | return 0 | |
907 | } | |
a5585a68 | 908 | |
351f379b JR |
909 | BuildConfig() { |
910 | %{?debug:set -x} | |
911 | set -e | |
a5585a68 | 912 | |
351f379b JR |
913 | Config="kernel-%{target_arch_dir}.config" |
914 | echo >&2 "Building config file for %{_target_cpu} using $Config et al." | |
a5585a68 | 915 | |
351f379b JR |
916 | # prepare local and important options |
917 | cat <<-EOCONFIG > important.config | |
918 | LOCALVERSION="-%{localversion}" | |
fb4e3822 | 919 | |
351f379b JR |
920 | %if 0%{?debug:1} |
921 | CONFIG_DEBUG_SLAB=y | |
922 | CONFIG_DEBUG_SLAB_LEAK=y | |
923 | CONFIG_DEBUG_PREEMPT=y | |
924 | CONFIG_RT_DEADLOCK_DETECT=y | |
a5585a68 | 925 | %endif |
351f379b | 926 | |
351f379b JR |
927 | %if %{without ipv6} |
928 | CONFIG_IPV6=n | |
929 | %endif | |
a5585a68 | 930 | |
351f379b JR |
931 | %ifarch i686 athlon pentium3 pentium4 |
932 | %if %{with pae} | |
933 | CONFIG_HIGHMEM4G=n | |
934 | CONFIG_HIGHMEM64G=y | |
935 | CONFIG_X86_PAE=y | |
7c99a84b | 936 | CONFIG_NUMA=n |
351f379b JR |
937 | %endif |
938 | %endif | |
a5585a68 | 939 | |
351f379b JR |
940 | %if %{without pcmcia} |
941 | CONFIG_PCMCIA=n | |
942 | %endif | |
a5585a68 | 943 | |
351f379b JR |
944 | %if %{with fbcondecor} |
945 | CONFIG_FB_S3=n | |
946 | CONFIG_FB_VT8623=n | |
947 | CONFIG_FB_ARK=n | |
948 | CONFIG_FB_TILEBLITTING=n | |
949 | CONFIG_FB_CON_DECOR=y | |
950 | %endif | |
a5585a68 | 951 | |
351f379b JR |
952 | %if %{with nfsroot} |
953 | CONFIG_NFS_FS=y | |
954 | CONFIG_ROOT_NFS=y | |
955 | %endif | |
a5585a68 | 956 | |
351f379b | 957 | # Temporary disabled RELOCATABLE. Needed only on x86?? |
15a064bf | 958 | %if %{with pax} || %{with grsecurity} |
351f379b JR |
959 | CONFIG_RELOCATABLE=n |
960 | %endif | |
961 | EOCONFIG | |
a5585a68 | 962 | |
351f379b JR |
963 | %if %{with rescuecd} |
964 | RescueConfig rescue.config | |
965 | %endif | |
17da405a | 966 | %if %{with pax} |
351f379b JR |
967 | PaXconfig pax.config |
968 | %endif | |
a5585a68 | 969 | |
351f379b JR |
970 | # prepare kernel-style config file from multiple config files |
971 | %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \ | |
101ae904 | 972 | %if %{with myown} |
973 | $RPM_SOURCE_DIR/kernel-%{alt_kernel}.config \ | |
974 | %endif | |
351f379b | 975 | important.config \ |
7141a3b6 | 976 | %if %{without vanilla} |
351f379b JR |
977 | %if %{with rescuecd} |
978 | %{SOURCE58} \ | |
351f379b JR |
979 | rescue.config \ |
980 | %endif | |
981 | \ | |
17da405a | 982 | %if %{with pax} |
351f379b JR |
983 | %{SOURCE45} \ |
984 | %{SOURCE49} \ | |
985 | pax.config \ | |
986 | %else | |
15a064bf | 987 | %if %{with grsecurity} |
351f379b JR |
988 | %{SOURCE45} \ |
989 | %{SOURCE50} \ | |
351f379b | 990 | %endif |
351f379b JR |
991 | %endif |
992 | \ | |
993 | %if %{with reiser4} | |
994 | %{SOURCE56} \ | |
995 | %endif | |
996 | %if %{with wrr} | |
997 | %{SOURCE57} \ | |
998 | %endif | |
999 | %if %{with imq} | |
1000 | %{SOURCE55} \ | |
1001 | %endif | |
1002 | %if %{with vserver} | |
1003 | %{SOURCE43} \ | |
1004 | %endif | |
1005 | %if %{with tuxonice} | |
1006 | %ifarch %{ix86} %{x8664} ia64 ppc ppc64 | |
1007 | %{SOURCE42} \ | |
1008 | %endif | |
351f379b | 1009 | %endif |
351f379b | 1010 | %{SOURCE41} %{?0:patches} \ |
7141a3b6 | 1011 | %endif |
351f379b JR |
1012 | %{SOURCE20} \ |
1013 | $RPM_SOURCE_DIR/$Config | |
1014 | } | |
a5585a68 | 1015 | |
351f379b JR |
1016 | cd %{objdir} |
1017 | install -d arch/%{target_arch_dir} | |
351f379b | 1018 | BuildConfig > %{defconfig} |
351f379b JR |
1019 | ln -sf %{defconfig} .config |
1020 | cd - | |
a5585a68 | 1021 | |
7856c5e8 AM |
1022 | %{__make} \ |
1023 | TARGETOBJ=%{targetobj} \ | |
1024 | %{?with_verbose:V=1} \ | |
1025 | oldconfig | |
a5585a68 | 1026 | |
351f379b | 1027 | %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config |
a5585a68 | 1028 | |
351f379b | 1029 | # build kernel |
7856c5e8 AM |
1030 | %{__make} \ |
1031 | TARGETOBJ=%{targetobj} \ | |
1032 | %{?with_verbose:V=1} \ | |
1033 | all | |
a5585a68 | 1034 | |
351f379b JR |
1035 | %install |
1036 | rm -rf $RPM_BUILD_ROOT | |
4505b6c5 | 1037 | %{__make} %{MakeOpts} -j1 %{!?with_verbose:-s} modules_install firmware_install \ |
351f379b JR |
1038 | -C %{objdir} \ |
1039 | %{?with_verbose:V=1} \ | |
1040 | DEPMOD=%{DepMod} \ | |
1041 | INSTALL_MOD_PATH=$RPM_BUILD_ROOT \ | |
1042 | INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware/%{kernel_release} \ | |
1043 | KERNELRELEASE=%{kernel_release} | |
1044 | ||
1045 | install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc | |
1046 | ||
101ae904 | 1047 | # create directories which may be missing, to simplyfy %files |
64d14572 | 1048 | install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm} |
101ae904 | 1049 | |
351f379b JR |
1050 | # rpm obeys filelinkto checks for ghosted symlinks, convert to files |
1051 | rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source} | |
1052 | touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source} | |
1053 | ||
6d54bd67 ER |
1054 | # no point embed content for %ghost files. empty them |
1055 | for a in \ | |
1056 | dep{,.bin} \ | |
1057 | alias{,.bin} \ | |
8ee3ac38 AM |
1058 | devname \ |
1059 | softdep \ | |
6d54bd67 ER |
1060 | symbols{,.bin} \ |
1061 | {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \ | |
1062 | ; do | |
09e63f4a | 1063 | test -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a |
6d54bd67 ER |
1064 | > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a |
1065 | done | |
1066 | ||
351f379b JR |
1067 | # /boot |
1068 | install -d $RPM_BUILD_ROOT/boot | |
1069 | cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release} | |
1070 | %ifarch %{ix86} %{x8664} | |
1db9a2c1 ER |
1071 | cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1072 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release} | |
351f379b JR |
1073 | %endif |
1074 | %ifarch ppc ppc64 | |
1db9a2c1 ER |
1075 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1076 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release} | |
a5585a68 | 1077 | %endif |
a5585a68 | 1078 | %ifarch ia64 |
1db9a2c1 ER |
1079 | %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz |
1080 | cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/efi/vmlinuz-%{kernel_release} | |
1081 | ln -sf efi/vmlinuz-%{kernel_release} $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} | |
351f379b JR |
1082 | %endif |
1083 | %ifarch alpha sparc sparc64 | |
1084 | %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz | |
1085 | cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} | |
1db9a2c1 ER |
1086 | install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
1087 | %ifarch sparc | |
1088 | elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout | |
1089 | install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release} | |
1090 | %endif | |
1091 | %ifarch sparc64 | |
1092 | elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout | |
1093 | install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release} | |
1094 | %endif | |
351f379b JR |
1095 | %endif |
1096 | %ifarch arm | |
1db9a2c1 | 1097 | install -p %{objdir}/arch/arm/boot/zImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release} |
a5585a68 | 1098 | %endif |
a5585a68 | 1099 | |
351f379b JR |
1100 | # ghosted initrd |
1101 | touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz | |
a5585a68 | 1102 | |
351f379b JR |
1103 | %if "%{_target_base_arch}" != "%{_arch}" |
1104 | touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep | |
1105 | %endif | |
a5585a68 | 1106 | |
351f379b JR |
1107 | # /etc/modrobe.d |
1108 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release} | |
a5585a68 | 1109 | |
351f379b | 1110 | # /usr/src/linux |
82833fcc AM |
1111 | install -d $RPM_BUILD_ROOT%{_kernelsrcdir} |
1112 | ||
351f379b JR |
1113 | # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition |
1114 | if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then | |
1115 | l=l | |
1116 | rm -f $RPM_BUILD_ROOT/COPYING | |
a5585a68 | 1117 | fi |
a5585a68 | 1118 | |
351f379b JR |
1119 | cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir} |
1120 | cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist | |
1121 | cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist | |
df0bb851 JR |
1122 | cp -a %{objdir}/include/generated $RPM_BUILD_ROOT%{_kernelsrcdir}/include |
1123 | mv $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf{,-dist}.h | |
11b2646e AM |
1124 | cp -a %{objdir}/include/linux/version.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux |
1125 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf.h | |
351f379b JR |
1126 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h |
1127 | ||
1128 | # collect module-build files and directories | |
1129 | # Usage: kernel-module-build.pl $rpmdir $fileoutdir | |
1130 | fileoutdir=$(pwd) | |
1131 | cd $RPM_BUILD_ROOT%{_kernelsrcdir} | |
1132 | %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir | |
1133 | cd - | |
1134 | ||
30f08736 ER |
1135 | # move to %{_docdir} so we wouldn't depend on any kernel package for dirs |
1136 | install -d $RPM_BUILD_ROOT%{_docdir} | |
1137 | mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}} | |
1138 | ||
d3a69071 ER |
1139 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff |
1140 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile | |
1141 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile | |
1142 | rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile | |
1143 | ||
351f379b JR |
1144 | %clean |
1145 | rm -rf $RPM_BUILD_ROOT | |
1146 | ||
1147 | %preun | |
1148 | if [ -x /sbin/new-kernel-pkg ]; then | |
1149 | /sbin/new-kernel-pkg --remove %{kernel_release} | |
a5585a68 | 1150 | fi |
351f379b JR |
1151 | |
1152 | %post | |
1153 | %ifarch ia64 | |
1154 | mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null | |
1155 | %{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null} | |
1156 | ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz | |
1157 | %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}} | |
1158 | %endif | |
1159 | mv -f /boot/vmlinuz{,.old} 2> /dev/null | |
1160 | %{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null} | |
1161 | mv -f /boot/System.map{,.old} 2> /dev/null | |
1162 | %{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null} | |
1163 | ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz | |
1164 | %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}} | |
1165 | ln -sf System.map-%{kernel_release} /boot/System.map | |
1166 | %{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}} | |
1167 | ||
1168 | %depmod %{kernel_release} | |
1169 | ||
4dabe329 ER |
1170 | %posttrans |
1171 | # generate initrd after all dependant modules are installed | |
351f379b JR |
1172 | /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release} |
1173 | mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null | |
1174 | %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null} | |
1175 | ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd | |
1176 | %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}} | |
1177 | ||
4dabe329 | 1178 | # update boot loaders when old package files are gone from filesystem |
c5de1ad5 | 1179 | if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then |
4dabe329 ER |
1180 | if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-no})" = "yes" ]; then |
1181 | /sbin/update-grub >/dev/null | |
c5de1ad5 ER |
1182 | fi |
1183 | fi | |
351f379b JR |
1184 | if [ -x /sbin/new-kernel-pkg ]; then |
1185 | /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 |
1186 | fi |
1187 | if [ -x /sbin/rc-boot ]; then | |
351f379b | 1188 | /sbin/rc-boot 1>&2 || : |
a5585a68 | 1189 | fi |
a5585a68 | 1190 | |
351f379b JR |
1191 | %post vmlinux |
1192 | mv -f /boot/vmlinux{,.old} 2> /dev/null | |
1193 | %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null} | |
1194 | ln -sf vmlinux-%{kernel_release} /boot/vmlinux | |
1195 | %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}} | |
1196 | ||
351f379b JR |
1197 | %post drm |
1198 | %depmod %{kernel_release} | |
a5585a68 | 1199 | |
351f379b JR |
1200 | %postun drm |
1201 | %depmod %{kernel_release} | |
a5585a68 | 1202 | |
351f379b JR |
1203 | %post pcmcia |
1204 | %depmod %{kernel_release} | |
a5585a68 | 1205 | |
351f379b JR |
1206 | %postun pcmcia |
1207 | %depmod %{kernel_release} | |
a5585a68 | 1208 | |
351f379b JR |
1209 | %post sound-alsa |
1210 | %depmod %{kernel_release} | |
a5585a68 | 1211 | |
351f379b JR |
1212 | %postun sound-alsa |
1213 | %depmod %{kernel_release} | |
a5585a68 | 1214 | |
351f379b JR |
1215 | %post sound-oss |
1216 | %depmod %{kernel_release} | |
a5585a68 | 1217 | |
351f379b JR |
1218 | %postun sound-oss |
1219 | %depmod %{kernel_release} | |
a5585a68 AM |
1220 | |
1221 | %post headers | |
351f379b | 1222 | ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel} |
a5585a68 AM |
1223 | |
1224 | %postun headers | |
351f379b JR |
1225 | if [ "$1" = "0" ]; then |
1226 | if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then | |
1227 | if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then | |
1228 | rm -f %{_prefix}/src/linux%{_alt_kernel} | |
a5585a68 AM |
1229 | fi |
1230 | fi | |
1231 | fi | |
1232 | ||
351f379b JR |
1233 | %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release} |
1234 | ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build | |
1235 | ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source | |
1236 | ||
1237 | %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release} | |
1238 | if [ "$1" = 0 ]; then | |
1239 | rm -f /lib/modules/%{kernel_release}/{build,source} | |
1240 | fi | |
1241 | ||
a5585a68 AM |
1242 | %files |
1243 | %defattr(644,root,root,755) | |
a5585a68 | 1244 | %ifarch sparc sparc64 |
351f379b | 1245 | /boot/vmlinux.aout-%{kernel_release} |
a5585a68 AM |
1246 | %endif |
1247 | %ifarch ia64 | |
351f379b JR |
1248 | /boot/efi/vmlinuz-%{kernel_release} |
1249 | %endif | |
1250 | /boot/vmlinuz-%{kernel_release} | |
1251 | /boot/System.map-%{kernel_release} | |
1252 | %ghost %{initrd_dir}/initrd-%{kernel_release}.gz | |
ae1c66e5 | 1253 | /lib/firmware/%{kernel_release} |
351f379b JR |
1254 | |
1255 | %dir /lib/modules/%{kernel_release} | |
1256 | %dir /lib/modules/%{kernel_release}/kernel | |
351f379b | 1257 | /lib/modules/%{kernel_release}/kernel/arch |
351f379b JR |
1258 | /lib/modules/%{kernel_release}/kernel/crypto |
1259 | /lib/modules/%{kernel_release}/kernel/drivers | |
101ae904 | 1260 | %if %{have_drm} |
351f379b JR |
1261 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu |
1262 | %endif | |
1263 | /lib/modules/%{kernel_release}/kernel/fs | |
351f379b | 1264 | /lib/modules/%{kernel_release}/kernel/kernel |
351f379b JR |
1265 | /lib/modules/%{kernel_release}/kernel/lib |
1266 | /lib/modules/%{kernel_release}/kernel/net | |
fecce547 | 1267 | /lib/modules/%{kernel_release}/kernel/mm |
101ae904 | 1268 | %if %{have_sound} |
351f379b JR |
1269 | %dir /lib/modules/%{kernel_release}/kernel/sound |
1270 | /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko* | |
1271 | /lib/modules/%{kernel_release}/kernel/sound/sound*.ko* | |
1272 | %ifnarch sparc | |
1273 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko* | |
1274 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko* | |
1275 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko* | |
1276 | %endif | |
1277 | %endif | |
1278 | %dir /lib/modules/%{kernel_release}/misc | |
101ae904 | 1279 | %if %{have_pcmcia} |
351f379b JR |
1280 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]* |
1281 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko* | |
1282 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia | |
1283 | %if %{without rescuecd} | |
1284 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko* | |
1285 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko* | |
1286 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko* | |
1287 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko* | |
1288 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko* | |
1289 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko* | |
1290 | %endif | |
1291 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko* | |
1292 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko* | |
1293 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43 | |
1294 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko* | |
1295 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko* | |
1296 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko* | |
30812fb8 | 1297 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/serial_cs.ko* |
351f379b JR |
1298 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko* |
1299 | %endif | |
101ae904 | 1300 | %if %{with myown} |
1301 | /lib/modules/%{kernel_release}/kernel/sound | |
1302 | %endif | |
30812fb8 | 1303 | /lib/modules/%{kernel_release}/kernel/security |
6d54bd67 ER |
1304 | |
1305 | %dir %{_sysconfdir}/modprobe.d/%{kernel_release} | |
1306 | ||
1307 | # provided by build | |
1308 | /lib/modules/%{kernel_release}/modules.order | |
8ee3ac38 | 1309 | /lib/modules/%{kernel_release}/modules.builtin* |
6d54bd67 ER |
1310 | |
1311 | # rest modules.* are ghost (regenerated by post depmod -a invocation) | |
1312 | %ghost /lib/modules/%{kernel_release}/modules.alias | |
1313 | %ghost /lib/modules/%{kernel_release}/modules.alias.bin | |
1314 | %ghost /lib/modules/%{kernel_release}/modules.ccwmap | |
1315 | %ghost /lib/modules/%{kernel_release}/modules.dep | |
1316 | %ghost /lib/modules/%{kernel_release}/modules.dep.bin | |
8ee3ac38 | 1317 | %ghost /lib/modules/%{kernel_release}/modules.devname |
6d54bd67 ER |
1318 | %ghost /lib/modules/%{kernel_release}/modules.ieee1394map |
1319 | %ghost /lib/modules/%{kernel_release}/modules.inputmap | |
1320 | %ghost /lib/modules/%{kernel_release}/modules.isapnpmap | |
1321 | %ghost /lib/modules/%{kernel_release}/modules.ofmap | |
1322 | %ghost /lib/modules/%{kernel_release}/modules.pcimap | |
1323 | %ghost /lib/modules/%{kernel_release}/modules.seriomap | |
8ee3ac38 | 1324 | %ghost /lib/modules/%{kernel_release}/modules.softdep |
6d54bd67 ER |
1325 | %ghost /lib/modules/%{kernel_release}/modules.symbols |
1326 | %ghost /lib/modules/%{kernel_release}/modules.symbols.bin | |
1327 | %ghost /lib/modules/%{kernel_release}/modules.usbmap | |
1328 | ||
351f379b JR |
1329 | # symlinks pointing to kernelsrcdir |
1330 | %ghost /lib/modules/%{kernel_release}/build | |
1331 | %ghost /lib/modules/%{kernel_release}/source | |
351f379b | 1332 | |
351f379b JR |
1333 | %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64 |
1334 | %files vmlinux | |
a5585a68 | 1335 | %defattr(644,root,root,755) |
351f379b | 1336 | /boot/vmlinux-%{kernel_release} |
a5585a68 AM |
1337 | %endif |
1338 | ||
101ae904 | 1339 | %if %{have_drm} |
351f379b | 1340 | %files drm |
a5585a68 | 1341 | %defattr(644,root,root,755) |
351f379b | 1342 | /lib/modules/%{kernel_release}/kernel/drivers/gpu |
a5585a68 AM |
1343 | %endif |
1344 | ||
101ae904 | 1345 | %if %{have_pcmcia} |
351f379b | 1346 | %files pcmcia |
a5585a68 | 1347 | %defattr(644,root,root,755) |
351f379b JR |
1348 | /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko* |
1349 | /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia | |
1350 | %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko* | |
1351 | %if %{without rescuecd} | |
1352 | /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko* | |
1353 | /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko* | |
1354 | /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko* | |
1355 | /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko* | |
1356 | %endif | |
1357 | /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko* | |
1358 | /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko* | |
1359 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko* | |
1360 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43 | |
1361 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko* | |
1362 | /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko* | |
1363 | /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko* | |
30812fb8 | 1364 | /lib/modules/%{kernel_release}/kernel/drivers/tty/serial/serial_cs.ko* |
351f379b JR |
1365 | /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko* |
1366 | %endif | |
1367 | ||
101ae904 | 1368 | %if %{have_sound} |
351f379b | 1369 | %files sound-alsa |
a5585a68 | 1370 | %defattr(644,root,root,755) |
351f379b JR |
1371 | /lib/modules/%{kernel_release}/kernel/sound |
1372 | %exclude %dir /lib/modules/%{kernel_release}/kernel/sound | |
1373 | %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko* | |
1374 | %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko* | |
1375 | %if %{have_oss} | |
1376 | %exclude /lib/modules/%{kernel_release}/kernel/sound/oss | |
a5585a68 | 1377 | %endif |
351f379b JR |
1378 | %ifnarch sparc |
1379 | /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko* | |
1380 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko* | |
1381 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko* | |
1382 | /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko* | |
a5585a68 AM |
1383 | %endif |
1384 | ||
101ae904 | 1385 | %if %{have_oss} |
351f379b | 1386 | %files sound-oss |
a5585a68 | 1387 | %defattr(644,root,root,755) |
351f379b | 1388 | /lib/modules/%{kernel_release}/kernel/sound/oss |
a5585a68 | 1389 | %endif |
a5585a68 AM |
1390 | %endif |
1391 | ||
fecce547 | 1392 | %files headers -f files.headers_exclude_kbuild |
a5585a68 | 1393 | %defattr(644,root,root,755) |
30f08736 | 1394 | %dir %{_kernelsrcdir} |
351f379b JR |
1395 | %{_kernelsrcdir}/include |
1396 | %dir %{_kernelsrcdir}/arch | |
1397 | %dir %{_kernelsrcdir}/arch/[!K]* | |
1398 | %{_kernelsrcdir}/arch/*/include | |
1399 | %dir %{_kernelsrcdir}/security | |
1400 | %dir %{_kernelsrcdir}/security/selinux | |
1401 | %{_kernelsrcdir}/security/selinux/include | |
1402 | %{_kernelsrcdir}/config-dist | |
1403 | %{_kernelsrcdir}/Module.symvers-dist | |
1404 | ||
fecce547 | 1405 | %files module-build -f files.mb_include_modulebuild_and_dirs |
a5585a68 | 1406 | %defattr(644,root,root,755) |
351f379b JR |
1407 | %ifarch ppc ppc64 |
1408 | %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.* | |
1409 | %endif | |
fecce547 | 1410 | %exclude %dir %{_kernelsrcdir}/arch/um |
351f379b JR |
1411 | %{_kernelsrcdir}/arch/*/kernel/asm-offsets* |
1412 | %{_kernelsrcdir}/arch/*/kernel/sigframe*.h | |
1413 | %{_kernelsrcdir}/drivers/lguest/lg.h | |
2470a9dc | 1414 | %{_kernelsrcdir}/drivers/media/video/bt8xx/bttv.h |
351f379b JR |
1415 | %{_kernelsrcdir}/kernel/bounds.c |
1416 | %dir %{_kernelsrcdir}/scripts | |
351f379b JR |
1417 | %{_kernelsrcdir}/scripts/Kbuild.include |
1418 | %{_kernelsrcdir}/scripts/Makefile* | |
1419 | %{_kernelsrcdir}/scripts/basic | |
960d2e94 | 1420 | %{_kernelsrcdir}/scripts/kconfig |
1421 | %{_kernelsrcdir}/scripts/mkcompile_h | |
351f379b JR |
1422 | %{_kernelsrcdir}/scripts/mkmakefile |
1423 | %{_kernelsrcdir}/scripts/mod | |
960d2e94 | 1424 | %{_kernelsrcdir}/scripts/module-common.lds |
351f379b JR |
1425 | %{_kernelsrcdir}/scripts/setlocalversion |
1426 | %{_kernelsrcdir}/scripts/*.c | |
1427 | %{_kernelsrcdir}/scripts/*.sh | |
351f379b JR |
1428 | %dir %{_kernelsrcdir}/scripts/selinux |
1429 | %{_kernelsrcdir}/scripts/selinux/Makefile | |
9d6d5869 AM |
1430 | %dir %{_kernelsrcdir}/scripts/selinux/genheaders |
1431 | %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile | |
1432 | %{_kernelsrcdir}/scripts/selinux/genheaders/*.c | |
c78e408d PZ |
1433 | %dir %{_kernelsrcdir}/scripts/selinux/mdp |
1434 | %{_kernelsrcdir}/scripts/selinux/mdp/Makefile | |
1435 | %{_kernelsrcdir}/scripts/selinux/mdp/*.c | |
fecce547 | 1436 | %exclude %dir %{_kernelsrcdir}/security |
1437 | %exclude %dir %{_kernelsrcdir}/security/selinux | |
a696e454 | 1438 | %if %{with grsecurity} |
94a92871 | 1439 | %{_kernelsrcdir}/tools/gcc/*.c |
a696e454 | 1440 | %endif |
a5585a68 | 1441 | |
1848fd38 | 1442 | %if %{with doc} |
a5585a68 AM |
1443 | %files doc |
1444 | %defattr(644,root,root,755) | |
d3a69071 ER |
1445 | %dir %{_docdir}/%{name}-%{version} |
1446 | ||
1447 | %{_docdir}/%{name}-%{version}/[!jkz]* | |
1448 | %{_docdir}/%{name}-%{version}/[jkz]*.txt | |
1449 | %{_docdir}/%{name}-%{version}/kbuild | |
1450 | %{_docdir}/%{name}-%{version}/kdump | |
1451 | %lang(ja) %{_docdir}/%{name}-%{version}/ja_JP | |
1452 | %lang(ko) %{_docdir}/%{name}-%{version}/ko_KR | |
1453 | %lang(zh_CN) %{_docdir}/%{name}-%{version}/zh_CN | |
1848fd38 | 1454 | %endif |
a5585a68 AM |
1455 | |
1456 | %if %{with source} | |
fecce547 | 1457 | %files source -f files.source_exclude_modulebuild_and_dirs |
a5585a68 | 1458 | %defattr(644,root,root,755) |
351f379b JR |
1459 | %{_kernelsrcdir}/arch/*/[!Mik]* |
1460 | %{_kernelsrcdir}/arch/*/kernel/[!M]* | |
351f379b JR |
1461 | %{_kernelsrcdir}/arch/ia64/install.sh |
1462 | %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]* | |
1463 | %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC | |
fecce547 | 1464 | %{_kernelsrcdir}/arch/m68k/install.sh |
351f379b JR |
1465 | %{_kernelsrcdir}/arch/parisc/install.sh |
1466 | %{_kernelsrcdir}/arch/x86/ia32/[!M]* | |
1467 | %{_kernelsrcdir}/arch/ia64/kvm | |
1468 | %{_kernelsrcdir}/arch/powerpc/kvm | |
1469 | %ifarch ppc ppc64 | |
1470 | %exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.* | |
1471 | %endif | |
1472 | %{_kernelsrcdir}/arch/s390/kvm | |
1473 | %{_kernelsrcdir}/arch/x86/kvm | |
1474 | %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets* | |
1475 | %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h | |
1476 | %exclude %{_kernelsrcdir}/drivers/lguest/lg.h | |
2470a9dc | 1477 | %exclude %{_kernelsrcdir}/drivers/media/video/bt8xx/bttv.h |
351f379b JR |
1478 | %{_kernelsrcdir}/block |
1479 | %{_kernelsrcdir}/crypto | |
1480 | %{_kernelsrcdir}/drivers | |
1481 | %{_kernelsrcdir}/firmware | |
1482 | %{_kernelsrcdir}/fs | |
1483 | %if %{with grsecurity} && %{without rescuecd} | |
1484 | %{_kernelsrcdir}/grsecurity | |
1485 | %endif | |
1486 | %{_kernelsrcdir}/init | |
1487 | %{_kernelsrcdir}/ipc | |
1488 | %{_kernelsrcdir}/kernel | |
1489 | %exclude %{_kernelsrcdir}/kernel/bounds.c | |
1490 | %{_kernelsrcdir}/lib | |
1491 | %{_kernelsrcdir}/mm | |
1492 | %{_kernelsrcdir}/net | |
1493 | %{_kernelsrcdir}/virt | |
1494 | %{_kernelsrcdir}/samples | |
1495 | %{_kernelsrcdir}/scripts/* | |
1496 | %exclude %{_kernelsrcdir}/scripts/Kbuild.include | |
1497 | %exclude %{_kernelsrcdir}/scripts/Makefile* | |
1498 | %exclude %{_kernelsrcdir}/scripts/basic | |
1499 | %exclude %{_kernelsrcdir}/scripts/kconfig | |
960d2e94 | 1500 | %exclude %{_kernelsrcdir}/scripts/mkcompile_h |
351f379b JR |
1501 | %exclude %{_kernelsrcdir}/scripts/mkmakefile |
1502 | %exclude %{_kernelsrcdir}/scripts/mod | |
960d2e94 | 1503 | %exclude %{_kernelsrcdir}/scripts/module-common.lds |
351f379b JR |
1504 | %exclude %{_kernelsrcdir}/scripts/setlocalversion |
1505 | %exclude %{_kernelsrcdir}/scripts/*.c | |
1506 | %exclude %{_kernelsrcdir}/scripts/*.sh | |
960d2e94 | 1507 | %exclude %dir %{_kernelsrcdir}/scripts/selinux |
1508 | %exclude %{_kernelsrcdir}/scripts/selinux/Makefile | |
c78e408d PZ |
1509 | %exclude %dir %{_kernelsrcdir}/scripts/selinux/genheaders |
1510 | %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile | |
1511 | %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/*.c | |
960d2e94 | 1512 | %exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp |
1513 | %exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile | |
1514 | %exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c | |
351f379b JR |
1515 | %{_kernelsrcdir}/sound |
1516 | %{_kernelsrcdir}/security | |
1517 | %exclude %{_kernelsrcdir}/security/selinux/include | |
94a92871 | 1518 | %{_kernelsrcdir}/tools/* |
a696e454 | 1519 | %if %{with grsecurity} |
94a92871 | 1520 | %exclude %{_kernelsrcdir}/tools/gcc/*.c |
a696e454 | 1521 | %endif |
351f379b JR |
1522 | %{_kernelsrcdir}/usr |
1523 | %{_kernelsrcdir}/COPYING | |
1524 | %{_kernelsrcdir}/CREDITS | |
1525 | %{_kernelsrcdir}/MAINTAINERS | |
1526 | %{_kernelsrcdir}/README | |
1527 | %{_kernelsrcdir}/REPORTING-BUGS | |
a5585a68 | 1528 | %endif |