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