2 # STATUS: 2.6.25 works, needs testing
5 # - suspend2 renamed to tuxonice (as project name)
8 # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
9 # - apparmor (needs testing)
13 # - pom-ng quake3-conntrack-nat -> nf_conntrack ?
14 # - pom-ng talk-conntrack-nat -> nf_conntrack ?
16 # - pax hooks for selinux (experimental)
19 %bcond_without source # don't build kernel-source package
20 %bcond_without pcmcia # don't build pcmcia
22 %bcond_with verbose # verbose build (V=1)
23 %bcond_with xen0 # added Xen0 support
24 %bcond_with xenU # added XenU support
25 %bcond_without reiser4 # support for reiser4 fs (experimental)
27 %bcond_without grsecurity # don't build grsecurity nor pax at all
28 %bcond_without grsec_minimal # build only minimal subset (proc,link,fifo,shm)
29 %bcond_with grsec_full # build full grsecurity
30 %bcond_with pax_full # build pax and full grsecurity (ie. grsec_full && pax)
31 %bcond_with pax # build pax support
33 %bcond_with fbcondecor # fbsplash/fbcondecor instead of bootsplash
34 %bcond_with pae # build PAE (HIGHMEM64G) support on uniprocessor
35 %bcond_with nfsroot # build with root on NFS support
37 %bcond_without imq # imq support
38 %bcond_without wrr # wrr support
39 %bcond_without ipv6 # ipv6 support
41 %bcond_without vserver # support for VServer (enabled by default)
42 %bcond_without tuxonice # support for tuxonice (ex-suspend2) (enabled by default)
43 %bcond_with vs22 # use vserver 2.2 instead of 2.3 (see comment near patch 102)
44 %bcond_with apparmor # build kernel with apparmor (very exerimental mix)
46 %bcond_with rescuecd # build kernel for our rescue
48 %bcond_with myown # build with your own config (kernel-myown.config)
50 %{?debug:%define with_verbose 1}
52 %if %{without grsecurity}
53 %undefine with_grsec_full
54 %undefine with_grsec_minimal
56 %undefine with_pax_full
60 %undefine with_grsec_minimal
61 %define with_grsec_full 1
62 %define with_grsecurity 1
66 %if %{with grsec_full}
67 %undefine with_grsec_minimal
68 %define with_grsecurity 1
70 %define with_pax_full 1
74 %if %{with grsec_minimal}
75 %undefine with_grsec_full
76 %undefine with_pax_full
77 %define with_grsecurity 1
85 %undefine with_tuxonice
86 %undefine with_grsec_full
87 %undefine with_grsec_minimal
89 %undefine with_pax_full
90 %undefine with_vserver
95 %ifarch %{ix86} alpha ppc
101 %ifarch sparc sparc64
102 %undefine with_pcmcia
107 %define _basever 2.6.25
109 %define _prepatch %{nil}
110 %define _pre_rc %{nil}
114 %define _enable_debug_packages 0
116 %define squashfs_version 3.3
117 %define tuxonice_version 3.0-rc7
118 %define netfilter_snap 20070806
119 %define xen_version 3.0.2
121 %define _alt_kernel %{?with_pax:-pax}%{?with_grsec_full:-grsecurity}%{?with_xen0:-xen0}%{?with_xenU:-xenU}%{?with_rescuecd:-rescuecd}%{?with_pae:-pae}%{?with_myown:-myown}%{?with_apparmor:-aa}
123 # kernel release (used in filesystem and eventually in uname -r)
124 # modules will be looked from /lib/modules/%{kernel_release}
125 %define kernel_release %{version}%{?_alt_kernel:%{_alt_kernel}}_%{KABI}
127 # Our Kernel ABI, increase this when you want the out of source modules being rebuilt
128 # Usually same as %{_rel}. Never decrement this (policy).
131 Summary: The Linux kernel (the core of the Linux operating system)
132 Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
133 Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
134 Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme)
135 Summary(pl.UTF-8): JÄ…dro Linuksa
136 Name: kernel%{_alt_kernel}
138 %if "%{_prepatch}" == "%{nil}"
139 Version: %{_basever}%{_postver}
142 Version: %{_prepatch}
143 Release: 0.%{_pre_rc}.%{_rel}
149 #Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/testing/linux-%{version}%{_rc}.tar.bz2
150 Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{_basever}%{_rc}.tar.bz2
151 # Source0-md5: db95a49a656a3247d4995a797d333153
152 %if "%{_prepatch}" != "%{nil}"
153 Source90: http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-%{_prepatch}-%{_pre_rc}.bz2
154 # Source90-md5: b78873f8a3aff5bdc719fc7fb4c66a9b
156 %if "%{_postver}" != "%{nil}"
157 Source1: http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
158 # Source1-md5: ad3c4b32bf293722500160a2bb6100b6
161 Source3: kernel-autoconf.h
162 Source4: kernel-config.h
163 Source5: kernel-ppclibs.Makefile
164 Source6: kernel-config.py
165 Source7: kernel-module-build.pl
167 Source19: kernel-multiarch.config
168 Source20: kernel-i386.config
169 Source21: kernel-x86_64.config
170 Source22: kernel-sparc.config
171 Source23: kernel-sparc64.config
172 Source24: kernel-alpha.config
173 Source25: kernel-ppc.config
174 Source26: kernel-ia64.config
175 Source27: kernel-ppc64.config
177 Source40: kernel-netfilter.config
178 Source41: kernel-squashfs.config
179 Source42: kernel-tuxonice.config
180 Source43: kernel-vserver.config
181 Source45: kernel-grsec.config
182 Source46: kernel-xen0.config
183 Source47: kernel-xenU.config
185 Source49: kernel-pax.config
186 Source50: kernel-no-pax.config
187 Source51: kernel-grsec_minimal.config
188 Source55: kernel-imq.config
189 Source56: kernel-reiser4.config
190 Source57: kernel-wrr.config
192 Source58: kernel-inittmpfs.config
193 Source59: kernel-bzip2-lzma.config
198 # tahoe9XX http://tahoe.pl/drivers/tahoe9xx-2.6.11.5.patch
199 Patch2: tahoe9xx-2.6.11.5.patch
201 # ftp://ftp.openbios.org/pub/bootsplash/kernel/bootsplash-3.1.6-2.6.21.diff.gz
202 Patch3: linux-2.6-bootsplash.patch
203 # http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.4-2.6.25-rc6.patch
204 Patch4: kernel-fbcondecor.patch
206 # based on http://mesh.dl.sourceforge.net/sourceforge/squashfs/squashfs3.3.tgz
207 # squashfs3.3/kernel-patches/linux-2.6.24/squashfs3.3-patch
208 Patch6: kernel-squashfs.patch
209 Patch8: linux-fbcon-margins.patch
210 Patch9: linux-static-dev.patch
212 # netfilter related stuff mostly based on patch-o-matic-ng
213 # snapshot 20061213 with some fixes related to changes in
214 # netfilter api in 2.6.19 up to 2.6.22. Some modules
215 # were ported to nf_conntrack. Some of these are unique.
217 Patch10: kernel-pom-ng-IPV4OPTSSTRIP.patch
218 Patch11: kernel-pom-ng-ipv4options.patch
219 Patch12: kernel-pom-ng-set.patch
220 Patch14: kernel-pom-ng-ROUTE.patch
221 Patch16: kernel-pom-ng-mms-conntrack-nat.patch
222 Patch22: kernel-pom-ng-rsh.patch
223 Patch23: kernel-pom-ng-rpc.patch
225 # based on http://mike.it-loops.com/rtsp/rtsp-2.6.24.patch
226 Patch36: kernel-nf_rtsp.patch
228 # http://ftp.linux-vserver.org/pub/people/dhozac/p/k/delta-owner-xid-feat02.diff
229 Patch37: kernel-owner-xid.patch
231 # based on http://www.svn.barbara.eu.org/ipt_account/attachment/wiki/Software/ipt_account-0.1.21-20070804164729.tar.gz?format=raw
232 Patch38: kernel-ipt_account.patch
234 # based on http://www.intra2net.com/de/produkte/opensource/ipt_account/pom-ng-ipt_ACCOUNT-1.12.tgz
235 Patch39: kernel-ipt_ACCOUNT.patch
237 # kernel-2.6.25-layer7-2.18.patch from
238 # http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.18.tar.gz
239 Patch40: kernel-layer7.patch
241 # http://www.ssi.bg/~ja/nfct/ipvs-nfct-2.6.25-1.diff
242 Patch41: kernel-ipvs-nfct.patch
244 # based on http://www.balabit.com/downloads/files/tproxy/tproxy-kernel-2.6.25-20080509-164605-1210344365.tar.bz2
245 Patch42: kernel-tproxy.patch
249 # http://zph.bratcheda.org/linux-2.6.25-zph.patch
250 Patch49: kernel-zph.patch
252 # based on http://www.linuximq.net/patchs/linux-2.6.24-imq.diff
253 # some people report problems when using imq with wrr.
254 # try unoficial version: http://kapturkiewicz.name/linux-2.6.25-imq1.diff
255 Patch50: kernel-imq.patch
257 # previously based on ftp://ftp.namesys.com/pub/reiser4-for-2.6/2.6.22/reiser4-for-2.6.22-2.patch.gz
258 # now based on http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.25.patch.bz2
259 Patch51: kernel-reiser4.patch
261 # http://www.zz9.dk/patches/wrr-linux-071203-2.6.25.patch.gz
262 Patch52: kernel-wrr.patch
264 # http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2
265 Patch53: esfq-kernel.patch
267 # http://memebeam.org/free-software/toshiba_acpi/toshiba_acpi-dev_toshiba_test5-linux_2.6.21.patch
268 Patch54: linux-2.6-toshiba_acpi.patch
269 # by Baggins request:
270 # derived from ftp://ftp.cmf.nrl.navy.mil/pub/chas/linux-atm/vbr/vbr-kernel-diffs
271 Patch55: linux-2.6-atm-vbr.patch
272 Patch56: linux-2.6-atmdd.patch
274 # http://www.ntop.org/PF_RING.html 20070610
275 Patch58: linux-PF_RING.patch
277 # http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
278 Patch59: kernel-rndis_host-wm5.patch
280 # Project suspend2 renamed to tuxonice
281 # http://tuxonice.org/downloads/all/tuxonice-3.0-rc7-for-2.6.25.patch.bz2
282 Patch69: linux-2.6-suspend2.patch
283 Patch70: kernel-suspend2-headers.patch
284 Patch71: linux-2.6-suspend2-page.patch
285 Patch72: kernel-2.6-ueagle-atm-freezer.patch
287 # adds some ids for hostap suported cards and monitor_enable from/for aircrack-ng
288 # http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
289 Patch85: hostap-kernel-2.6.18.patch
291 # http://vserver.13thfloor.at/Experimental/patch-2.6.25.4-vs2.3.0.34.11.diff
292 Patch100: linux-2.6-vs2.3.patch
293 Patch101: kernel-vserver-fixes.patch
294 # based on http://vserver.13thfloor.at/Experimental/patch-2.6.24-rc7-vs2.2.0.5.0.7-pre.diff
295 Patch102: linux-2.6-vs2.2.patch
296 # note about vserver 2.2 vs 2.3: 2.2 is "stable", 2.3 is "development", currently (2007-09-03)
297 # the preferred 2.3 vserver needs CONFIG_IPV6=y config, which break things for some users;
298 # it was proposed to use 2.2 as a temp replacement. One could use vs 2.2 instead of 2.3
299 # by using vs22 bcond - this bcond also changes IPV6 option from "y" to "m".
301 # from http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-3.0.2-src.tgz
302 #Patch120: xen-3.0-2.6.16.patch
304 # Wake-On-Lan fix for nForce drivers; using http://atlas.et.tudelft.nl/verwei90/nforce2/wol.html
305 # Fix verified for that kernel version.
306 Patch130: linux-2.6-forcedeth-WON.patch
308 # http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.2.4_for_2.6.25-rc2.diff.gz
309 Patch140: kernel-unionfs.patch
310 Patch141: kernel-unionfs-vserver.patch
312 # aic94xx patch based on http://georgi.unixsol.org/programs/aic94xx_with_included_firmware_2.6.21.diff
313 Patch160: linux-2.6-aic94xx_with_included_firmware.patch
315 Patch200: linux-2.6-ppc-ICE-hacks.patch
317 Patch205: linux-2.6-ppc-mediabay.patch
319 # The following patch extend the routing functionality in Linux
320 # to support static routes (defined by user), new way to use the
321 # alternative routes, the reverse path protection (rp_filter),
322 # the NAT processing to use correctly the routing when multiple
324 # http://www.ssi.bg/~ja/routes-2.6.25-15.diff
325 # We need to disable CONFIG_IP_ROUTE_MULTIPATH_CACHED
326 Patch300: kernel-routes.patch
328 Patch1000: linux-2.6-grsec-minimal.patch
330 Patch2000: kernel-small_fixes.patch
331 Patch2001: linux-2.6.21.1-pwc-uncompress.patch
333 # kill some thousands of warnings
334 # (only warnings, so just remove parts of this patch if conflics)
335 Patch2500: linux-2.6-warnings.patch
337 # based on https://forgesvn1.novell.com/svn/apparmor/trunk/kernel-patches/2.6.25 rev 1266
338 # repatched and adapted for vserver/grsec changes in vfs API, very experimental
339 Patch5000: kernel-apparmor.patch
340 #Patch5001: linux-2.6-apparmor-caps.patch
343 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
344 Patch7000: kernel-inittmpfs.patch
345 # based on http://www.udpcast.linux.lu/download/bzip2-lzma-kernel-2.6.23.12.patch.gz
346 Patch7001: kernel-bzip2-lzma.patch
348 Patch9996: linux-2.6-security-opt.patch
351 Patch9997: pax_selinux_hooks-2.6.20.patch
353 # based on http://www.grsecurity.net/~paxguy1/pax-linux-2.6.24.6-test45.patch
354 Patch9998: kernel-pax.patch
356 # based on http://www.grsecurity.net/~spender/grsecurity-2.1.12-2.6.25.4-200805181334.patch
357 Patch9999: linux-2.6-grsec_full.patch
358 Patch10000: linux-2.6-grsec-caps.patch
359 Patch10001: linux-2.6-grsec-common.patch
360 Patch10002: kernel-grsec_fixes.patch
362 URL: http://www.kernel.org/
363 BuildRequires: binutils >= 3:2.14.90.0.7
364 %ifarch sparc sparc64
365 BuildRequires: elftoaout
368 BuildRequires: uboot-mkimage
370 BuildRequires: /sbin/depmod
371 BuildRequires: gcc >= 5:3.2
372 %{?with_rescuecd:BuildRequires: lzma >= 1:4.42.2}
373 # for hostname command
374 BuildRequires: net-tools
375 BuildRequires: perl-base
376 BuildRequires: python
377 BuildRequires: python-modules
378 BuildRequires: rpmbuild(macros) >= 1.217
380 Requires(post): coreutils
381 Requires(post): geninitrd >= 2.57
382 Requires(post): module-init-tools >= 0.9.9
383 Requires: /sbin/depmod
385 Requires: geninitrd >= 2.57
386 Requires: module-init-tools >= 0.9.9
387 Provides: %{name}(netfilter) = %{netfilter_snap}
388 Provides: %{name}(vermagic) = %{kernel_release}
389 %if %{with xen0} || %{with xenU}
390 Provides: kernel(xen) = %{_xen_version}
392 Obsoletes: kernel-misc-fuse
393 Obsoletes: kernel-modules
394 Obsoletes: kernel-net-hostap
395 Obsoletes: kernel-net-ieee80211
396 Obsoletes: kernel-net-ipp2p
397 Obsoletes: kernel-smp
398 Conflicts: e2fsprogs < 1.29
399 Conflicts: isdn4k-utils < 3.1pre1
400 Conflicts: jfsutils < 1.1.3
401 Conflicts: module-init-tools < 0.9.10
402 Conflicts: nfs-utils < 1.0.5
403 Conflicts: oprofile < 0.9
404 Conflicts: ppp < 1:2.4.0
405 Conflicts: procps < 3.2.0
406 Conflicts: quota-tools < 3.09
407 %if %{with reiserfs4}
408 Conflicts: reiser4progs < 1.0.0
410 Conflicts: reiserfsprogs < 3.6.3
411 Conflicts: udev < 1:071
412 Conflicts: util-linux < 2.10o
413 Conflicts: xfsprogs < 2.6.0
414 %if %{with xen0} || %{with xenU} || %{with pae}
415 ExclusiveArch: %{ix86}
417 ExcludeArch: i386 i486 i586
420 ExclusiveArch: %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
423 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
425 %ifarch %{ix86} %{x8664}
426 %define target_arch_dir x86
429 %define target_arch_dir powerpc
431 %ifnarch %{ix86} %{x8664} ppc ppc64
432 %define target_arch_dir %{_target_base_arch}
435 %define defconfig arch/%{target_arch_dir}/defconfig
437 # No ELF objects there to strip (skips processing 27k files)
438 %define _noautostrip .*%{_kernelsrcdir}/.*
439 %define _noautochrpath .*%{_kernelsrcdir}/.*
442 %define initrd_dir /boot/efi
444 %define initrd_dir /boot
447 %define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
449 %if "%{_target_base_arch}" != "%{_arch}"
450 %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
451 %define DepMod /bin/true
453 %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
454 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
455 %define DepMod /sbin/depmod
458 %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc"
459 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
460 %define DepMod /sbin/depmod
463 %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
464 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
465 %define DepMod /sbin/depmod
469 %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux-
473 %define CrossOpts ARCH=powerpc CC="%{__cc}"
475 %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
477 %define DepMod /sbin/depmod
480 %define __features Netfilter module dated: %{netfilter_snap}\
481 %{?with_grsec_full:Grsecurity full support - enabled}\
482 %{?with_pax:PaX support - enabled}\
483 %{?with_xen0:Xen 0 - enabled}\
484 %{?with_xenU:Xen U - enabled}\
485 %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
486 %{?with_nfsroot:Root on NFS - enabled}
488 %define Features %(echo "%{__features}" | sed '/^$/d')
491 This package contains the Linux kernel that is used to boot and run
492 your system. It contains few device drivers for specific hardware.
493 Most hardware is instead supported by modules loaded after booting.
497 %description -l de.UTF-8
498 Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
499 Linux-Betriebssystems. Der Kernel ist für grundliegende
500 Systemfunktionen verantwortlich: Speicherreservierung,
501 Prozeß-Management, Geräte Ein- und Ausgaben, usw.
505 %description -l fr.UTF-8
506 Le package kernel contient le kernel linux (vmlinuz), la partie
507 centrale d'un système d'exploitation Linux. Le noyau traite les
508 fonctions basiques d'un système d'exploitation: allocation mémoire,
509 allocation de process, entrée/sortie de peripheriques, etc.
513 %description -l pl.UTF-8
514 Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania
515 Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego
516 się w komputerze, takiego jak sterowniki dysków itp.
521 Summary: vmlinux - uncompressed kernel image
522 Summary(de.UTF-8): vmlinux - dekompressiertes Kernel Bild
523 Summary(pl.UTF-8): vmlinux - rozpakowany obraz jÄ…dra
525 Obsoletes: kernel-smp-vmlinux
528 vmlinux - uncompressed kernel image.
530 %description vmlinux -l de.UTF-8
531 vmlinux - dekompressiertes Kernel Bild.
533 %description vmlinux -l pl.UTF-8
534 vmlinux - rozpakowany obraz jÄ…dra.
537 Summary: DRM kernel modules
538 Summary(de.UTF-8): DRM Kernel Treiber
539 Summary(pl.UTF-8): Sterowniki DRM
541 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
542 Requires: %{name} = %{epoch}:%{version}-%{release}
543 Obsoletes: kernel-smp-drm
549 %description drm -l de.UTF-8
552 %description drm -l pl.UTF-8
556 Summary: PCMCIA modules
557 Summary(de.UTF-8): PCMCIA Module
558 Summary(pl.UTF-8): Moduły PCMCIA
560 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
561 Requires: %{name} = %{epoch}:%{version}-%{release}
562 Obsoletes: kernel-smp-pcmcia
563 Conflicts: pcmcia-cs < 3.1.21
564 Conflicts: pcmciautils < 004
570 %description pcmcia -l de.UTF-8
573 %description pcmcia -l pl.UTF-8
577 Summary: Libraries for preparing bootable kernel on PowerPCs
578 Summary(pl.UTF-8): Biblioteki do przygotowania bootowalnego jÄ…dra dla PowerPC
580 Requires: %{name} = %{epoch}:%{version}-%{release}
581 Requires: mkvmlinuz >= 1.3
582 Obsoletes: kernel-smp-libs
586 Libraries for preparing bootable kernel on PowerPCs. Script called
587 mkvmlinuz may be useful for this.
589 %description libs -l pl.UTF-8
590 Biblioteki do przygotowania bootowalnego jÄ…dra dla PowerPC. Skrypt
591 mkvmlinuz może być do tego przydatny.
594 Summary: ALSA kernel modules
595 Summary(de.UTF-8): ALSA Kernel Module
596 Summary(pl.UTF-8): Sterowniki dźwięku ALSA
598 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
599 Requires: %{name} = %{epoch}:%{version}-%{release}
600 Obsoletes: kernel-smp-sound-alsa
603 %description sound-alsa
604 ALSA (Advanced Linux Sound Architecture) sound drivers.
606 %description sound-alsa -l de.UTF-8
607 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
609 %description sound-alsa -l pl.UTF-8
610 Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture).
613 Summary: OSS kernel modules
614 Summary(de.UTF-8): OSS Kernel Module
615 Summary(pl.UTF-8): Sterowniki dźwięku OSS
617 Requires(postun): %{name} = %{epoch}:%{version}-%{release}
618 Requires: %{name} = %{epoch}:%{version}-%{release}
619 Obsoletes: kernel-smp-sound-oss
622 %description sound-oss
623 OSS (Open Sound System) drivers.
625 %description sound-oss -l de.UTF-8
626 OSS (Open Sound System) Treiber.
628 %description sound-oss -l pl.UTF-8
629 Sterowniki dźwięku OSS (Open Sound System).
632 Summary: Header files for the Linux kernel
633 Summary(de.UTF-8): Header Dateien für den Linux-Kernel
634 Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa
635 Group: Development/Building
636 Provides: %{name}-headers(netfilter) = %{netfilter_snap}
640 These are the C header files for the Linux kernel, which define
641 structures and constants that are needed when rebuilding the kernel or
642 building kernel modules.
644 %description headers -l de.UTF-8
645 Dies sind die C Header Dateien für den Linux-Kernel, die definierte
646 Strukturen und Konstante beinhalten, die beim rekompilieren des
647 Kernels oder bei Kernel Modul kompilationen gebraucht werden.
649 %description headers -l pl.UTF-8
650 Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra
651 oraz budowania modułów jądra.
653 %package module-build
654 Summary: Development files for building kernel modules
655 Summary(de.UTF-8): Development Dateien die beim Kernel Modul kompilationen gebraucht werden
656 Summary(pl.UTF-8): Pliki służące do budowania modułów jądra
657 Group: Development/Building
658 Requires: %{name}-headers = %{epoch}:%{version}-%{release}
659 Conflicts: rpmbuild(macros) < 1.321
662 %description module-build
663 Development files from kernel source tree needed to build Linux kernel
664 modules from external packages.
666 %description module-build -l de.UTF-8
667 Development Dateien des Linux-Kernels die beim kompilieren externer
668 Kernel Module gebraucht werden.
670 %description module-build -l pl.UTF-8
671 Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra
672 Linuksa z zewnętrznych pakietów.
675 Summary: Kernel source tree
676 Summary(de.UTF-8): Der Kernel Quelltext
677 Summary(pl.UTF-8): Kod źródłowy jądra Linuksa
678 Group: Development/Building
679 Requires: %{name}-module-build = %{epoch}:%{version}-%{release}
683 This is the source code for the Linux kernel. You can build a custom
684 kernel that is better tuned to your particular hardware.
686 %description source -l de.UTF-8
687 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
688 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
689 C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
690 im Kernel-Source definiert sind. Die Source-Dateien können auch
691 benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
692 Hardware ausgerichtet ist.
694 %description source -l fr.UTF-8
695 Le package pour le kernel-source contient le code source pour le noyau
696 linux. Ces sources sont nécessaires pour compiler la plupart des
697 programmes C, car il dépend de constantes définies dans le code
698 source. Les sources peuvent être aussi utilisée pour compiler un noyau
699 personnalisé pour avoir de meilleures performances sur des matériels
702 %description source -l pl.UTF-8
703 Pakiet zawiera kod źródłowy jądra systemu.
706 Summary: Kernel documentation
707 Summary(de.UTF-8): Kernel Dokumentation
708 Summary(pl.UTF-8): Dokumentacja do jÄ…dra Linuksa
713 This is the documentation for the Linux kernel, as found in
714 /usr/src/linux/Documentation directory.
716 %description doc -l de.UTF-8
717 Dies ist die Kernel Dokumentation wie sie im 'Documentation'
718 Verzeichniss vorgefunden werden kann.
720 %description doc -l pl.UTF-8
721 Pakiet zawiera dokumentacjÄ™ do jÄ…dra Linuksa pochodzÄ…cÄ… z katalogu
722 /usr/src/linux/Documentation.
725 %setup -q -n linux-%{_basever}%{_rc}
727 # hack against warning in pax/grsec
729 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
733 install %{SOURCE5} Makefile.ppclibs
736 # sources 1 and 90 should be mutually exclusive btw.
738 %if "%{_prepatch}" != "%{nil}"
739 %{__bzip2} -dc %{SOURCE90} | patch -p1 -s
742 %if "%{_postver}" != "%{nil}"
743 %{__bzip2} -dc %{SOURCE1} | patch -p1 -s
746 install -m 755 %{SOURCE6} .
750 ##ifarch %{ix86} %{x8664} ia64 ppc alpha
754 # kernel-2.6-ueagle-atm-freezer.patch
763 %if !%{with fbcondecor}
777 # kernel-pom-ng-IPV4OPTSSTRIP.patch
780 # kernel-pom-ng-ipv4options.patch
783 # kernel-pom-ng-set.patch
786 # kernel-pom-ng-ROUTE.patch
789 # kernel-pom-ng-mms-conntrack-nat.patch
792 # kernel-pom-ng-rsh.patch
795 # kernel-pom-ng-rpc.patch
798 # kernel-nf_rtsp.patch
801 # kernel-owner-xid.patch
806 # kernel-ipt_account.patch
809 # kernel-ipt_ACCOUNT.patch
812 # kernel-layer7.patch
848 # kernel-rndis_host-wm5.patch
851 # hostap enhancements from/for aircrack-ng
864 #%if %{with xen0} || %{with xenU}
865 #%ifarch %{ix86} %{x8664} ia64
871 %if %{without rescuecd} && %{with vserver}
880 %{?with_vserver:%patch141 -p1}
882 # aic94xx linux-2.6-aic94xx_with_included_firmware.patch
892 # grsecurity & pax stuff
896 %{?with_vserver:%patch10000 -p1}
897 %{?with_vserver:%patch10001 -p1}
898 #{?with_vserver:%patch10002 -p1}
901 %if %{with grsec_full}
903 %{?with_vserver:%patch10000 -p1}
904 %{?with_vserver:%patch10001 -p1}
905 #{?with_vserver:%patch10002 -p1}
907 %if %{with grsec_minimal}
909 # remember that we have the same config file for grsec_minimal and
910 # grsec_full, but the patches are different.
917 # now we have an separate testing pax-only patch - in the future we
918 # could have single grsecurity patch and will have to prepare separate
919 # configs for grsec_minimal, grsec_full and pax to support such
920 # configurations like pax & grsec_minimal.
921 # So, in a future there could be no patch9998, but only config
922 # would tell which options should be enabled.
923 # The second option is to maintain separate pax-only patch.
925 #patch9997 -p1 - needs update
931 # end of grsecurity & pax stuff
952 # Fix EXTRAVERSION in main Makefile
953 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}%{?_alt_kernel:%{_alt_kernel}}#g' Makefile
955 # on sparc this line causes CONFIG_INPUT=m (instead of =y), thus breaking build
956 sed -i -e '/select INPUT/d' net/bluetooth/hidp/Kconfig
958 # on sparc64 avoid building break due to NULL pointer type warrning
959 sed -i -e 's/^EXTRA_CFLAGS := -Werror/EXTRA_CFLAGS := /' arch/sparc64/kernel/Makefile
961 # cleanup backups after patching
962 find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
965 TuneUpConfigForIX86 () {
969 [ "$2" = "yes" ] && pae=yes
974 sed -i 's:CONFIG_M386=y:# CONFIG_M386 is not set:' $1
977 sed -i 's:# CONFIG_M486 is not set:CONFIG_M486=y:' $1
980 sed -i 's:# CONFIG_M586 is not set:CONFIG_M586=y:' $1
983 sed -i 's:# CONFIG_M686 is not set:CONFIG_M686=y:' $1
986 sed -i 's:# CONFIG_MPENTIUMIII is not set:CONFIG_MPENTIUMIII=y:' $1
989 sed -i 's:# CONFIG_MPENTIUM4 is not set:CONFIG_MPENTIUM4=y:' $1
992 sed -i 's:# CONFIG_MK7 is not set:CONFIG_MK7=y:' $1
994 %ifarch i686 athlon pentium3 pentium4
995 if [ "$pae" = "yes" ]; then
996 sed -i "s:CONFIG_HIGHMEM4G=y:# CONFIG_HIGHMEM4G is not set:" $1
997 sed -i "s:# CONFIG_HIGHMEM64G is not set:CONFIG_HIGHMEM64G=y\nCONFIG_X86_PAE=y:" $1
999 sed -i 's:CONFIG_MATH_EMULATION=y:# CONFIG_MATH_EMULATION is not set:' $1
1008 sed -i 's:# CONFIG_PAX_SEGMEXEC is not set:CONFIG_PAX_SEGMEXEC=y:' $1
1009 # performance impact on CPUs without NX bit
1010 sed -i 's:CONFIG_PAX_PAGEEXEC=y:# CONFIG_PAX_PAGEEXEC is not set:' $1
1013 # sed -i 's:CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y:# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set:' $1
1014 # sed -i 's:CONFIG_PCI_BIOS=y:# CONFIG_PCI_BIOS is not set:' $1
1015 # sed -i 's:CONFIG_EFI=y:# CONFIG_EFI is not set:' $1
1019 sed -i 's:CONFIG_PAX_NOELFRELOCS=y:# CONFIG_PAX_NOELFRELOCS is not set:' $1
1022 sed -i 's:# CONFIG_PAX_EMUTRAMP is not set:CONFIG_PAX_EMUTRAMP=y:' $1
1023 sed -i 's:# CONFIG_PAX_EMUSIGRT is not set:CONFIG_PAX_EMUSIGRT=y:' $1
1024 sed -i 's:# CONFIG_PAX_EMUPLT is not set:CONFIG_PAX_EMUPLT=y:' $1
1027 %ifarch sparc sparc64 alpha
1028 sed -i 's:# CONFIG_PAX_EMUPLT is not set:CONFIG_PAX_EMUPLT=y:' $1
1031 # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
1032 # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
1033 # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
1034 # PAX_HOOK_ACL_FLAGS. SELinux should also be able to make PaX settings via hooks
1036 %if %{with grsec_full}
1037 # Hardening grsec options if with pax
1038 sed -i "s:# CONFIG_GRKERNSEC_PROC_MEMMAP is not set:CONFIG_GRKERNSEC_PROC_MEMMAP=y:" $1
1039 # almost rational (see HIDESYM help)
1040 sed -i "s:# CONFIG_GRKERNSEC_HIDESYM is not set:CONFIG_GRKERNSEC_HIDESYM=y:" $1
1042 # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
1044 # selinux or other hooks?
1045 sed -i 's:CONFIG_PAX_HAVE_ACL_FLAGS=y:# CONFIG_PAX_HAVE_ACL_FLAGS is not set:' $1
1046 sed -i 's:# CONFIG_PAX_HOOK_ACL_FLAGS is not set:CONFIG_PAX_HOOK_ACL_FLAGS=y:' $1
1054 cat %{SOURCE58} >> $1
1055 cat %{SOURCE59} >> $1
1056 sed -i "s:CONFIG_SOUND=.:# CONFIG_SOUND is not set:" $1
1057 sed -i "s:CONFIG_AUDIT=.:# CONFIG_AUDIT is not set:" $1
1058 sed -i "s:CONFIG_TR=.:# CONFIG_TR is not set:" $1
1059 sed -i "s:CONFIG_BT=.:# CONFIG_BT is not set:" $1
1060 sed -i "s:CONFIG_VIDEO_DEV=.:# CONFIG_VIDEO_DEV is not set:" $1
1061 sed -i "s:CONFIG_DVB_CORE=.:# CONFIG_DVB_CORE is not set:" $1
1062 sed -i "s:CONFIG_HAMRADIO=.:# CONFIG_HAMRADIO is not set:" $1
1063 sed -i "s:CONFIG_ARCNET=.:# CONFIG_ARCNET is not set:" $1
1064 sed -i "s:CONFIG_FB=.:# CONFIG_FB is not set:" $1
1065 sed -i "s:CONFIG_DRM\(.*\)=.:# CONFIG_DRM\1 is not set:" $1
1066 sed -i "s:CONFIG_WATCHDOG=.:# CONFIG_WATCHDOG is not set:" $1
1067 sed -i "s:CONFIG_INPUT_JOYSTICK=.:# CONFIG_INPUT_JOYSTICK is not set:" $1
1068 sed -i "s:CONFIG_DEBUG_KERNEL=.:# CONFIG_DEBUG_KERNEL is not set:" $1
1069 sed -i "s:CONFIG_ISDN=.:# CONFIG_ISDN is not set:" $1
1070 sed -i "s:CONFIG_AGP\(.*\)=.:# CONFIG_AGP\1 is not set:" $1
1071 sed -i "s:CONFIG_SECURITY=.:# CONFIG_SECURITY is not set:" $1
1072 sed -i "s:CONFIG_PARIDE=.:# CONFIG_PARIDE is not set:" $1
1073 sed -i "s:CONFIG_CPU_FREQ=.:# CONFIG_CPU_FREQ is not set:" $1
1074 sed -i "s:CONFIG_GAMEPORT=.:# CONFIG_GAMEPORT is not set:" $1
1075 sed -i "s:CONFIG_KVM=.:# CONFIG_KVM is not set:" $1
1076 sed -i "s:CONFIG_PHONE=.:# CONFIG_PHONE is not set:" $1
1077 sed -i "s:CONFIG_BLK_DEV_LOOP=m:CONFIG_BLK_DEV_LOOP=y:" $1
1078 sed -i "s:CONFIG_ISO9660_FS=m:CONFIG_ISO9660_FS=y:" $1
1079 sed -i "s:CONFIG_NLS_UTF8=m:CONFIG_NLS_UTF8=y:" $1
1084 # is this a special kernel we want to build?
1085 Config="%{_target_base_arch}"
1086 KernelVer=%{kernel_release}
1087 echo "Building config file using $Config.conf..."
1088 cat $RPM_SOURCE_DIR/kernel-$Config.config > %{defconfig}
1089 ./kernel-config.py %{_target_base_arch} $RPM_SOURCE_DIR/kernel-multiarch.config \
1090 %{defconfig} %{defconfig}
1091 TuneUpConfigForIX86 %{defconfig}
1094 cat %{SOURCE40} >> %{defconfig}
1097 cat %{SOURCE41} >> %{defconfig}
1100 %if %{with tuxonice}
1101 %ifarch %{ix86} %{x8664} ia64 ppc ppc64
1102 cat %{SOURCE42} >> %{defconfig}
1105 sed -i "s:CONFIG_TOI=y:# CONFIG_TOI is not set:" %{defconfig}
1110 cat %{SOURCE43} >> %{defconfig}
1112 sed -i "s:CONFIG_IPV6=y:CONFIG_IPV6=m:" %{defconfig}
1117 sed -i "s:CONFIG_IPV6=.:# CONFIG_IPV6 is not set:" %{defconfig}
1120 # grsecurity & pax stuff
1123 %if %{with pax_full}
1124 cat %{SOURCE45} >> %{defconfig}
1125 cat %{SOURCE49} >> %{defconfig}
1126 PaXconfig %{defconfig}
1129 %if %{with grsec_full}
1130 cat %{SOURCE45} >> %{defconfig}
1131 cat %{SOURCE50} >> %{defconfig}
1133 %if %{with grsec_minimal}
1134 cat %{SOURCE51} >> %{defconfig}
1139 cat %{SOURCE49} >> %{defconfig}
1140 PaXconfig %{defconfig}
1145 # Temporary disabled RELOCATABLE. Needed only on x86??
1146 %if %{with pax} || %{with grsec_full}
1147 sed -i "s:CONFIG_RELOCATABLE=y:# CONFIG_RELOCATABLE is not set:" %{defconfig}
1151 # end of grsecurity & pax stuff
1154 cat %{SOURCE55} >> %{defconfig}
1158 cat %{SOURCE57} >> %{defconfig}
1162 cat %{SOURCE56} >> %{defconfig}
1166 cat %{SOURCE46} >> %{defconfig}
1170 cat %{SOURCE47} >> %{defconfig}
1173 %if %{with fbcondecor}
1174 echo "CONFIG_FB_CON_DECOR=y" >> %{defconfig}
1176 echo "CONFIG_BOOTSPLASH=y" >> %{defconfig}
1180 sed -i "s:CONFIG_NFS_FS=m:CONFIG_NFS_FS=y:" %{defconfig}
1181 echo "CONFIG_ROOT_NFS=y" >> %{defconfig}
1184 %if %{with rescuecd}
1185 RescueConfig %{defconfig}
1188 # apparmor, will be moved to external file if works
1189 %if %{with apparmor}
1190 echo CONFIG_SECURITY_APPARMOR=y >> %{defconfig}
1191 echo CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1 >> %{defconfig}
1192 echo "# CONFIG_SECURITY_APPARMOR_DISABLE is not set" >> %{defconfig}
1193 # patch for unionfs not ready yet
1194 sed -i "s:CONFIG_UNION_FS=m:# CONFIG_UNION_FS is not set:" %{defconfig}
1195 # some conflict with smack, todo
1196 sed -i "s:CONFIG_SECURITY_SMACK=y:# CONFIG_SECURITY_SMACK is not set:" %{defconfig}
1199 %{?debug:sed -i "s:# CONFIG_DEBUG_SLAB is not set:CONFIG_DEBUG_SLAB=y:" %{defconfig}}
1200 %{?debug:sed -i "s:# CONFIG_DEBUG_PREEMPT is not set:CONFIG_DEBUG_PREEMPT=y:" %{defconfig}}
1201 %{?debug:sed -i "s:# CONFIG_RT_DEADLOCK_DETECT is not set:CONFIG_RT_DEADLOCK_DETECT=y:" %{defconfig}}
1207 echo "Building kernel $1 ..."
1208 %{__make} %CrossOpts mrproper \
1209 RCS_FIND_IGNORE='-name build-done -prune -o'
1210 ln -sf %{defconfig} .config
1212 %{__make} %CrossOpts clean \
1213 RCS_FIND_IGNORE='-name build-done -prune -o'
1214 %{__make} %CrossOpts include/linux/version.h \
1215 %{?with_verbose:V=1}
1217 %{__make} %CrossOpts scripts/mkcompile_h \
1218 %{?with_verbose:V=1}
1220 # make does vmlinux, modules and bzImage at once
1222 %{__make} %CrossOpts image \
1223 %{?with_verbose:V=1}
1225 %{__make} %CrossOpts modules \
1226 %{?with_verbose:V=1}
1228 %{__make} %CrossOpts \
1229 %{?with_verbose:V=1}
1233 PreInstallKernel() {
1234 Config="%{_target_base_arch}"
1235 KernelVer=%{kernel_release}
1237 mkdir -p $KERNEL_INSTALL_DIR/boot
1238 install System.map $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer
1239 %ifarch %{ix86} %{x8664}
1240 install arch/x86/boot/bzImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1241 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
1243 %ifarch alpha sparc sparc64
1244 gzip -cfv vmlinux > vmlinuz
1245 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
1246 install vmlinuz $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1248 elftoaout arch/sparc/boot/image -o vmlinux.aout
1249 install vmlinux.aout $KERNEL_INSTALL_DIR/boot/vmlinux.aout-$KernelVer
1252 elftoaout arch/sparc64/boot/image -o vmlinux.aout
1253 install vmlinux.aout $KERNEL_INSTALL_DIR/boot/vmlinux.aout-$KernelVer
1257 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
1258 install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1261 %{__make} -f Makefile.ppclibs install \
1262 DESTDIR=$KERNEL_INSTALL_DIR/boot/libs-$KernelVer
1265 gzip -cfv vmlinux > vmlinuz
1266 install -d $KERNEL_INSTALL_DIR/boot/efi
1267 install vmlinuz $KERNEL_INSTALL_DIR/boot/efi/vmlinuz-$KernelVer
1268 ln -sf efi/vmlinuz-$KernelVer $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1271 install arch/arm/boot/zImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
1274 %{__make} %CrossOpts modules_install \
1275 %{?with_verbose:V=1} \
1277 INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR \
1278 KERNELRELEASE=$KernelVer
1280 # You'd probabelly want to make it somewhat different
1281 install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}
1282 install Module.symvers $KERNEL_INSTALL_DIR%{_kernelsrcdir}/Module.symvers-dist
1284 echo "CHECKING DEPENDENCIES FOR KERNEL MODULES"
1285 if [ %DepMod = /sbin/depmod ]; then
1286 /sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae -F $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer || :
1288 touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
1289 echo "KERNEL RELEASE $KernelVer DONE"
1292 KERNEL_BUILD_DIR=`pwd`
1293 echo "_%{KABI}" > localversion
1295 KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR/build-done/kernel"
1296 rm -rf $KERNEL_INSTALL_DIR
1297 %if %{without myown}
1300 cat $RPM_SOURCE_DIR/kernel-myown.config > %{defconfig}
1302 ln -sf %{defconfig} .config
1303 install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux
1304 rm -f include/linux/autoconf.h
1305 %{__make} %CrossOpts include/linux/autoconf.h
1306 install include/linux/autoconf.h \
1307 $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux/autoconf-dist.h
1309 $KERNEL_INSTALL_DIR%{_kernelsrcdir}/config-dist
1313 %{__make} %CrossOpts include/linux/utsrelease.h
1314 cp include/linux/utsrelease.h{,.save}
1315 cp include/linux/version.h{,.save}
1316 cp scripts/mkcompile_h{,.save}
1319 rm -rf $RPM_BUILD_ROOT
1322 export DEPMOD=%DepMod
1324 install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
1325 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
1327 # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
1328 if cp -al COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
1330 rm -f $RPM_BUILD_ROOT/COPYING
1333 KERNEL_BUILD_DIR=`pwd`
1335 cp -a$l $KERNEL_BUILD_DIR/build-done/kernel/* $RPM_BUILD_ROOT
1337 if [ -e $RPM_BUILD_ROOT/lib/modules/%{kernel_release} ] ; then
1338 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
1339 ln -sf %{_kernelsrcdir} $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
1340 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{cluster,misc}
1343 find . -maxdepth 1 ! -name "build-done" ! -name "." -exec cp -a$l "{}" "$RPM_BUILD_ROOT%{_kernelsrcdir}/" ";"
1345 cd $RPM_BUILD_ROOT%{_kernelsrcdir}
1347 %{__make} %CrossOpts mrproper archclean \
1348 RCS_FIND_IGNORE='-name build-done -prune -o'
1350 if [ -e $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/include/linux/autoconf-dist.h ]; then
1351 install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/include/linux/autoconf-dist.h \
1352 $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1353 install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/config-dist \
1354 $RPM_BUILD_ROOT%{_kernelsrcdir}
1357 cp -Rdp$l $KERNEL_BUILD_DIR/include/linux/* \
1358 $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1360 %{__make} %CrossOpts mrproper
1361 mv -f include/linux/utsrelease.h.save $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/utsrelease.h
1362 cp include/linux/version.h{.save,}
1363 cp scripts/mkcompile_h{.save,}
1364 rm -rf include/linux/version.h.save
1365 rm -rf scripts/mkcompile_h.save
1366 install %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
1367 install %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
1369 # collect module-build files and directories
1370 perl %{SOURCE7} %{_kernelsrcdir} $KERNEL_BUILD_DIR
1373 touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
1375 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
1376 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1377 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1379 # remove unnecessary dir with dead symlink
1380 rm -rf $RPM_BUILD_ROOT/arch/i386
1383 rm -rf $RPM_BUILD_ROOT
1386 if [ -x /sbin/new-kernel-pkg ]; then
1387 /sbin/new-kernel-pkg --remove %{kernel_release}
1392 mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
1393 %{?_alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1394 ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
1395 %{?_alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
1397 mv -f /boot/vmlinuz{,.old} 2> /dev/null
1398 %{?_alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1399 mv -f /boot/System.map{,.old} 2> /dev/null
1400 %{?_alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
1401 ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
1402 %{?_alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
1403 ln -sf System.map-%{kernel_release} /boot/System.map
1404 %{?_alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
1406 %depmod %{kernel_release}
1408 /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
1409 mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
1410 %{?_alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
1411 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
1412 %{?_alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
1414 if [ -x /sbin/new-kernel-pkg ]; then
1415 if [ -f /etc/pld-release ]; then
1416 title=$(sed 's/^[0-9.]\+ //' < /etc/pld-release)
1421 ext='%{_alt_kernel}'
1426 /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "$title"
1427 elif [ -x /sbin/rc-boot ]; then
1428 /sbin/rc-boot 1>&2 || :
1432 mv -f /boot/vmlinux{,.old} 2> /dev/null
1433 %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
1434 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
1435 %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
1438 %{_sbindir}/mkvmlinuz /boot/zImage-%{kernel_release} %{kernel_release}
1441 %depmod %{kernel_release}
1444 %depmod %{kernel_release}
1447 %depmod %{kernel_release}
1450 %depmod %{kernel_release}
1453 %depmod %{kernel_release}
1456 %depmod %{kernel_release}
1459 %depmod %{kernel_release}
1462 %depmod %{kernel_release}
1465 ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
1468 if [ "$1" = "0" ]; then
1469 if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
1470 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
1471 rm -f %{_prefix}/src/linux%{_alt_kernel}
1476 %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
1477 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
1478 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
1480 %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
1481 if [ "$1" = 0 ]; then
1482 rm -f /lib/modules/%{kernel_release}/{build,source}
1486 %defattr(644,root,root,755)
1487 %ifarch sparc sparc64
1488 /boot/vmlinux.aout-%{kernel_release}
1491 /boot/efi/vmlinuz-%{kernel_release}
1493 /boot/vmlinuz-%{kernel_release}
1494 /boot/System.map-%{kernel_release}
1495 %ghost %{initrd_dir}/initrd-%{kernel_release}.gz
1496 %dir /lib/modules/%{kernel_release}
1497 %dir /lib/modules/%{kernel_release}/kernel
1499 /lib/modules/%{kernel_release}/kernel/arch
1501 /lib/modules/%{kernel_release}/kernel/crypto
1502 /lib/modules/%{kernel_release}/kernel/drivers
1503 %if %{have_drm} && %{without myown}
1504 %exclude /lib/modules/%{kernel_release}/kernel/drivers/char/drm
1506 /lib/modules/%{kernel_release}/kernel/fs
1508 # this directory will be removed after disabling rcutorture mod. in 2.6.20.
1509 /lib/modules/%{kernel_release}/kernel/kernel
1511 /lib/modules/%{kernel_release}/kernel/lib
1512 /lib/modules/%{kernel_release}/kernel/net
1513 %if %{have_sound} && %{without myown}
1514 %dir /lib/modules/%{kernel_release}/kernel/sound
1515 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1516 /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1518 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1519 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1520 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1523 %dir /lib/modules/%{kernel_release}/misc
1524 %if %{with pcmcia} && %{without myown}
1525 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
1526 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
1527 %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1528 %if %{without rescuecd}
1529 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1530 %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1531 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1532 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1533 %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1534 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1536 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/legacy/ide-cs.ko*
1537 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1538 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1539 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1540 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1541 %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1542 %exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1543 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1545 %ghost /lib/modules/%{kernel_release}/modules.*
1546 # symlinks pointing to kernelsrcdir
1547 %ghost /lib/modules/%{kernel_release}/build
1548 %ghost /lib/modules/%{kernel_release}/source
1549 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
1551 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
1553 %defattr(644,root,root,755)
1554 /boot/vmlinux-%{kernel_release}
1557 %if %{have_drm} && %{without myown}
1559 %defattr(644,root,root,755)
1560 /lib/modules/%{kernel_release}/kernel/drivers/char/drm
1563 %if %{with pcmcia} && %{without myown}
1565 %defattr(644,root,root,755)
1566 /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
1567 /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1568 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
1569 %if %{without rescuecd}
1570 /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1571 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1572 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1573 /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1575 /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1576 /lib/modules/%{kernel_release}/kernel/drivers/ide/legacy/ide-cs.ko*
1577 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1578 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1579 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1580 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1581 /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1582 /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1583 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1587 %if "%{_arch}" == "ppc"
1589 %defattr(644,root,root,755)
1590 %dir /boot/libs-%{kernel_release}
1591 /boot/libs-%{kernel_release}/common
1592 /boot/libs-%{kernel_release}/kernel
1593 /boot/libs-%{kernel_release}/lib
1594 /boot/libs-%{kernel_release}/of1275
1595 /boot/libs-%{kernel_release}/openfirmware
1596 /boot/libs-%{kernel_release}/simple
1597 %dir /boot/libs-%{kernel_release}/utils
1598 %attr(755,root,root) /boot/libs-%{kernel_release}/utils/*
1599 /boot/libs-%{kernel_release}/ld.script
1603 %if %{have_sound} && %{without myown}
1605 %defattr(644,root,root,755)
1606 /lib/modules/%{kernel_release}/kernel/sound
1607 %exclude %dir /lib/modules/%{kernel_release}/kernel/sound
1608 %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1609 %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1611 %exclude /lib/modules/%{kernel_release}/kernel/sound/oss
1614 /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1615 /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1616 /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1617 /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1620 %if %{have_oss} && %{without myown}
1622 %defattr(644,root,root,755)
1623 /lib/modules/%{kernel_release}/kernel/sound/oss
1628 %defattr(644,root,root,755)
1629 %dir %{_kernelsrcdir}
1630 %{_kernelsrcdir}/include
1631 %{_kernelsrcdir}/config-dist
1632 %{_kernelsrcdir}/Module.symvers-dist
1634 %files module-build -f aux_files
1635 %defattr(644,root,root,755)
1636 # symlinks pointint to kernelsrcdir
1637 %dir /lib/modules/%{kernel_release}
1638 /lib/modules/%{kernel_release}/build
1639 %{_kernelsrcdir}/Kbuild
1640 %{_kernelsrcdir}/localversion
1641 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1642 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1643 %{_kernelsrcdir}/drivers/lguest/lg.h
1644 %dir %{_kernelsrcdir}/scripts
1645 %dir %{_kernelsrcdir}/scripts/kconfig
1646 %{_kernelsrcdir}/scripts/Kbuild.include
1647 %{_kernelsrcdir}/scripts/Makefile*
1648 %{_kernelsrcdir}/scripts/basic
1649 %{_kernelsrcdir}/scripts/mkmakefile
1650 %{_kernelsrcdir}/scripts/mod
1651 %{_kernelsrcdir}/scripts/setlocalversion
1652 %{_kernelsrcdir}/scripts/*.c
1653 %{_kernelsrcdir}/scripts/*.sh
1654 %{_kernelsrcdir}/scripts/kconfig/*
1655 %{_kernelsrcdir}/scripts/mkcompile_h
1658 %defattr(644,root,root,755)
1659 %dir %{_kernelsrcdir}
1660 %{_kernelsrcdir}/Documentation
1663 %files source -f aux_files_exc
1664 %defattr(644,root,root,755)
1665 %{_kernelsrcdir}/arch/*/[!Mk]*
1666 %{_kernelsrcdir}/arch/*/kernel/[!M]*
1667 %{_kernelsrcdir}/arch/x86/kvm
1668 %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1669 %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1670 %exclude %{_kernelsrcdir}/drivers/lguest/lg.h
1671 %{_kernelsrcdir}/block
1672 %{_kernelsrcdir}/crypto
1673 %{_kernelsrcdir}/drivers
1675 %if %{with grsecurity} && %{without rescuecd}
1676 %{_kernelsrcdir}/grsecurity
1678 %{_kernelsrcdir}/init
1679 %{_kernelsrcdir}/ipc
1680 %{_kernelsrcdir}/kernel
1681 %{_kernelsrcdir}/lib
1683 %{_kernelsrcdir}/net
1684 %{_kernelsrcdir}/virt
1685 %{_kernelsrcdir}/scripts/*
1686 %exclude %{_kernelsrcdir}/scripts/Kbuild.include
1687 %exclude %{_kernelsrcdir}/scripts/Makefile*
1688 %exclude %{_kernelsrcdir}/scripts/basic
1689 %exclude %{_kernelsrcdir}/scripts/kconfig
1690 %exclude %{_kernelsrcdir}/scripts/mkmakefile
1691 %exclude %{_kernelsrcdir}/scripts/mod
1692 %exclude %{_kernelsrcdir}/scripts/setlocalversion
1693 %exclude %{_kernelsrcdir}/scripts/*.c
1694 %exclude %{_kernelsrcdir}/scripts/*.sh
1695 %{_kernelsrcdir}/sound
1696 %{_kernelsrcdir}/security
1697 %{_kernelsrcdir}/usr
1698 %{_kernelsrcdir}/COPYING
1699 %{_kernelsrcdir}/CREDITS
1700 %{_kernelsrcdir}/MAINTAINERS
1701 %{_kernelsrcdir}/README
1702 %{_kernelsrcdir}/REPORTING-BUGS
1703 %{_kernelsrcdir}/.mailmap