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