]> git.pld-linux.org Git - packages/kernel.git/blobdiff - kernel.spec
- http://grsecurity.net/~spender/grsecurity-2.9-2.6.32.59-201204272005.patch
[packages/kernel.git] / kernel.spec
index 4fec1f682dc65b442b0d7d3cd87a16d9a9d3df58..5b5ff154f5a9a465b8b90c807be86665294b3798 100644 (file)
@@ -5,39 +5,42 @@
 #   - with_apparmor
 #   - with_grsec_minimal
 #   - with_grsec_full
-#   - with_tomoyo
+#
+# LATEST VERSION CHECKER:
+# # curl -s http://www.kernel.org/kdist/finger_banner
 #
 # TODO:
 # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
-# - add a subpackage (kernel-firmware?) for ~35 firmware files
-#
-# FUTURE:
-# - pom-ng quake3-conntrack-nat -> nf_conntrack ?
-# - pom-ng talk-conntrack-nat -> nf_conntrack ?
-# - nf-hipac ?
-# - pax hooks for selinux (experimental)
+# - update or remove tahoe9xx patch2
+# - update or remove mpt-fusion patch90
+# - update grsec_minimal patch1000:
+#   fs/proc/base.c:1484: error: 'struct task_struct' has no member named 'uid'
 #
-# HOWTO:
-# - update main config: ./kernel-config-sort.pl ./BUILD/kernel-*/linux-2.6.29 kernel-multiarch.config
+# HOWTO update configuration files:
+# - run build
+# - add new options to proper config (kernel-multiarch.config, kernel-x86.config, kernel-powerpc.config etc)
+# - sort configuration files using:
+#   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version}/ -a x86 kernel-x86_84.config
+#   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version} kernel-multiarch.config
 #
 # Conditional build:
 %bcond_without source          # don't build kernel-source package
+%bcond_without doc                     # don't build kernel-doc package
 %bcond_without pcmcia          # don't build pcmcia
 
 %bcond_with    verbose         # verbose build (V=1)
 %bcond_without reiser4         # support for reiser4 fs (experimental)
 
 %bcond_without grsecurity      # don't build grsecurity nor pax at all
-%bcond_without grsec_minimal   # build only minimal subset (proc,link,fifo,shm)
 %bcond_without grsec_full      # build full grsecurity
-%bcond_with    pax_full        # build pax and full grsecurity (ie. grsec_full && pax)
-%bcond_with    pax             # build pax support
+%bcond_with    grsec_minimal   # build only minimal subset (proc,link,fifo,shm)
+%bcond_with    pax             # build pax and full grsecurity (ie. grsec_full && pax)
 
 %bcond_with    fbcondecor      # build fbcondecor (disable FB_TILEBLITTING and affected fb modules)
 %bcond_with    pae             # build PAE (HIGHMEM64G) support on uniprocessor
 %bcond_with    nfsroot         # build with root on NFS support
 
-%bcond_with    imq             # imq support
+%bcond_without imq             # imq support
 %bcond_without wrr             # wrr support
 %bcond_without esfq            # esfq support
 %bcond_without ipv6            # ipv6 support
@@ -45,7 +48,6 @@
 %bcond_without vserver         # support for VServer (enabled by default)
 %bcond_without tuxonice        # support for tuxonice (ex-suspend2) (enabled by default)
 %bcond_without apparmor        # build kernel with apparmor (exerimental mix)
-%bcond_with    tomoyo          # build kernel with tomoyo support [ disables apparmor ]
 
 %bcond_with    rescuecd        # build kernel for our rescue
 
 %{?debug:%define with_verbose 1}
 
 %if %{without grsecurity}
-%undefine      with_grsec_full
-%undefine      with_grsec_minimal
-%undefine      with_pax
-%undefine      with_pax_full
+%unglobal      with_grsec_full
+%unglobal      with_grsec_minimal
+%unglobal      with_pax
 %endif
 
-%if %{with pax_full}
-%undefine      with_grsec_minimal
+%if %{with pax}
+%unglobal      with_grsec_minimal
 %define                with_grsec_full         1
 %define                with_grsecurity         1
 %define                with_pax                1
 %endif
 
-%if %{with grsec_full}
-%undefine      with_grsec_minimal
+%if %{with grsec_minimal}
+%unglobal      with_pax
+%unglobal      with_grsec_full
 %define                with_grsecurity         1
-%if %{with pax}
-%define                with_pax_full           1
-%endif
 %endif
 
-%if %{with grsec_minimal}
-%undefine      with_grsec_full
-%undefine      with_pax_full
+%if %{with grsec_full}
+%unglobal      with_grsec_minimal
 %define                with_grsecurity         1
 %endif
 
 %define                have_pcmcia     1
 
 %if %{with rescuecd}
-%undefine      with_apparmor
-%undefine      with_tuxonice
-%undefine      with_grsec_full
-%undefine      with_grsec_minimal
-%undefine      with_pax
-%undefine      with_pax_full
-%undefine      with_vserver
+%unglobal      with_apparmor
+%unglobal      with_tuxonice
+%unglobal      with_grsecurity
+%unglobal      with_grsec_full
+%unglobal      with_grsec_minimal
+%unglobal      with_pax
+%unglobal      with_vserver
 %define                have_drm        0
 %define                have_sound      0
 %endif
 %endif
 
 %ifarch sparc sparc64
-%undefine      with_pcmcia
+%unglobal      with_pcmcia
 %define                have_drm        0
 %define                have_oss        0
 %endif
 %define                have_pcmcia     0
 %endif
 
-%define                basever         2.6.29
-%define                postver         .4
-%define                rel             0.2
+%define                basever         2.6.32
+%define                postver         .58
+%define                rel             1
 
 %define                _enable_debug_packages                  0
 
-%define                squashfs_version        3.4
 %define                tuxonice_version        3.0.1
 %define                netfilter_snap          20070806
 
 %define                alt_kernel      myown
 %endif
 %else
-%if %{without rescuecd}
 %define                __alt_kernel    %{?with_pax:pax}%{!?with_grsec_full:nogrsecurity}%{!?with_apparmor:noaa}%{?with_pae:pae}
 %if "%{__alt_kernel}" != ""
 %define                alt_kernel      %{__alt_kernel}
 %endif
-%else
-%define                alt_kernel      rescuecd
 %endif
+
+%if %{with rescuecd}
+%define                alt_kernel      rescuecd
 %endif
 
 # kernel release (used in filesystem and eventually in uname -r)
@@ -158,15 +155,14 @@ Epoch:            3
 License:       GPL v2
 Group:         Base/Kernel
 Source0:       http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
-# Source0-md5: 64921b5ff5cdadbccfcd3820f03be7d8
+# Source0-md5: 260551284ac224c3a43c4adac7df4879
 %if "%{postver}" != "%{nil}"
-Source1:       http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
-# Source1-md5: 03f1a0236cc37d8594d2f3c837d81c9d
+Source1:       http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v%{basever}/patch-%{version}.bz2
+# Source1-md5: a32385ccb645eea5bb33e88adb4af5b8
 %endif
 
 Source3:       kernel-autoconf.h
 Source4:       kernel-config.h
-Source5:       kernel-ppclibs.Makefile
 Source6:       kernel-config.awk
 Source7:       kernel-module-build.pl
 Source8:       kernel-track-config-change.awk
@@ -197,9 +193,6 @@ Source57:   kernel-wrr.config
 Source58:      kernel-inittmpfs.config
 Source59:      kernel-bzip2-lzma.config
 
-Source6000:    http://globalbase.dl.sourceforge.jp/tomoyo/30297/ccs-patch-1.6.6-20090202.tar.gz
-# Source6000-md5:      cceb1731d3720030eac34ed128848b32
-
 # tahoe9xx http://www.tahoe.pl/drivers/tahoe9xx-2.6.24.patch
 Patch2:                kernel-tahoe9xx.patch
 
@@ -208,9 +201,8 @@ Patch3:             kernel-fbcondecor.patch
 Patch4:                kernel-fbcon-margins.patch
 
 # netfilter related stuff mostly based on patch-o-matic-ng
-# snapshot 20061213 with some fixes related to changes in
-# netfilter api in 2.6.19 up to 2.6.22. Some modules
-# were ported to nf_conntrack. Some of these are unique.
+# snapshot 20070806 with some fixes. Some modules
+# were ported to nf_conntrack.
 
 Patch10:       kernel-pom-ng-IPV4OPTSSTRIP.patch
 Patch11:       kernel-pom-ng-ipv4options.patch
@@ -244,9 +236,7 @@ Patch41:    kernel-ipvs-nfct.patch
 # http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
 Patch49:       kernel-zph.patch
 
-# based on http://www.linuximq.net/patchs/linux-2.6.24-imq.diff
-# some people report problems when using imq with wrr.
-# try unoficial version: http://kapturkiewicz.name/linux-2.6.25-imq1.diff
+# http://www.linuximq.net/patchs/linux-2.6.32-imq-test2.diff
 Patch50:       kernel-imq.patch
 
 # http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.28.patch.bz2
@@ -266,14 +256,11 @@ Patch54:  kernel-toshiba_acpi.patch
 Patch55:       kernel-atm-vbr.patch
 Patch56:       kernel-atmdd.patch
 
-# http://www.ntop.org/PF_RING.html 20070610
-Patch58:       kernel-PF_RING.patch
-
 # http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
 Patch59:       kernel-rndis_host-wm5.patch
 
 # Project suspend2 renamed to tuxonice
-# http://www.tuxonice.net/downloads/all/tuxonice-3.0.1-for-head.patch.bz2
+# http://www.tuxonice.net/downloads/all/tuxonice-3.0.99.32-for-2.6.32.patch.bz2
 Patch69:       kernel-tuxonice.patch
 Patch70:       kernel-tuxonice-headers.patch
 
@@ -281,10 +268,10 @@ Patch70:  kernel-tuxonice-headers.patch
 # http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
 Patch85:       kernel-hostap.patch
 
-# Taken from http://download.opensuse.org/factory/repo/src-oss/suse/src/kernel-source-2.6.27.7-3.1.src.rpm
+# Taken from http://download.opensuse.org/factory/repo/src-oss/suse/src/kernel-source-2.6.30-10.3.src.rpm
 Patch90:       kernel-mpt-fusion.patch
 
-# based on http://vserver.13thfloor.at/Experimental/patch-2.6.29-vs2.3.0.36.9-pre3.diff
+# based on http://vserver.13thfloor.at/Experimental/patch-2.6.32.8-vs2.3.0.36.29.1.diff
 Patch100:      kernel-vserver-2.3.patch
 Patch101:      kernel-vserver-fixes.patch
 
@@ -292,19 +279,21 @@ Patch101: kernel-vserver-fixes.patch
 # Fix verified for that kernel version.
 Patch130:      kernel-forcedeth-WON.patch
 
-# http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.1_for_2.6.28.1.diff.gz
+# http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.3_for_2.6.31.diff.gz
 Patch140:      kernel-unionfs.patch
-Patch141:      kernel-unionfs-apparmor.patch
 
 # aufs1, http://aufs.sourceforge.net/
+# aufs1 is NOT maintained since Jan 2009.
 Patch145:      kernel-aufs.patch
 Patch146:      kernel-aufs-support.patch
-Patch147:      kernel-aufs-apparmor.patch
 
 Patch148:      kernel-aufs2.patch
 
 Patch150:      kernel-ppc-crtsavres.patch
 
+# git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-devel.git
+Patch160:      kernel-squashfs-lzma.patch
+
 Patch200:      kernel-ppc-ICE-hacks.patch
 
 # The following patch extend the routing functionality in Linux
@@ -325,38 +314,21 @@ Patch2003:        kernel-regressions.patch
 # (only warnings, so just remove parts of this patch if conflics)
 Patch2500:     kernel-warnings.patch
 
-# based on https://forgesvn1.novell.com/svn/apparmor/trunk/kernel-patches/2.6.27 rev 1303
-# repatched and adapted for vserver/grsec changes in vfs API, experimental
+# git://kernel.ubuntu.com/ubuntu/ubuntu-karmic.git
+# see ubuntu/apparmor dir
 Patch5000:     kernel-apparmor.patch
-# with grsec_full version
-Patch5001:     kernel-apparmor-after-grsec_full.patch
-Patch5002:     kernel-apparmor-common.patch
-
-# tomoyo based on patch from ccs-patch-1.6.6-20090202 tarball
-Patch6000:     kernel-tomoyo-with-apparmor.patch
-Patch6001:     kernel-tomoyo-without-apparmor.patch
 
 # for rescuecd
 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
 Patch7000:     kernel-inittmpfs.patch
 
-# http://lkml.org/lkml/2009/3/26/267
-Patch7001:     kernel-bzip2-lzma.patch
-
-# not ready yet
-Patch9997:     kernel-pax_selinux_hooks.patch
-
-# based on http://www.grsecurity.net/~paxguy1/pax-linux-2.6.24.6-test45.patch
-Patch9998:     kernel-pax.patch
-
-# based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.29-200903281534.patch
+# based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.32.7-201001291848.patch kernel-grsec_full.patch
 # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
 #       (since upstream deletes older patches)
 Patch9999:     kernel-grsec_full.patch
 Patch10000:    kernel-grsec-caps.patch
 Patch10001:    kernel-grsec-common.patch
 Patch10002:    kernel-grsec_fixes.patch
-Patch10003:    kernel-grsec-no-stupid-SbO.patch
 
 URL:           http://www.kernel.org/
 BuildRequires: binutils >= 3:2.18
@@ -366,14 +338,15 @@ BuildRequires:    elftoaout
 %ifarch ppc
 BuildRequires: uboot-mkimage
 %endif
-AutoReqProv:   no
 BuildRequires: /sbin/depmod
+##BuildRequires:       gcc < 6:4.6
 BuildRequires: gcc >= 5:3.2
 BuildRequires: xz >= 1:4.999.7
+AutoReqProv:   no
 # for hostname command
 BuildRequires: net-tools
 BuildRequires: perl-base
-BuildRequires: rpm-build >= 4.4.9-56
+BuildRequires: rpm-build >= 4.5-24
 BuildRequires: rpmbuild(macros) >= 1.217
 Requires(post):        coreutils
 Requires(post):        geninitrd >= 10000-3
@@ -385,6 +358,7 @@ Requires:   module-init-tools >= 0.9.9
 Provides:      %{name}(netfilter) = %{netfilter_snap}
 Provides:      %{name}(vermagic) = %{kernel_release}
 Obsoletes:     kernel%{_alt_kernel}-isdn-mISDN
+Obsoletes:     kernel-firmware
 Obsoletes:     kernel-misc-acer_acpi
 Obsoletes:     kernel-misc-fuse
 Obsoletes:     kernel-misc-uvc
@@ -436,7 +410,7 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                defconfig       arch/%{target_arch_dir}/defconfig
 
 # No ELF objects there to strip (skips processing 27k files)
-%define                _noautostrip    .*%{_kernelsrcdir}/.*
+%define                _noautostrip    \\(.*%{_kernelsrcdir}/.*\\|.*/vmlinux.*\\)
 %define                _noautochrpath  .*%{_kernelsrcdir}/.*
 
 %ifarch ia64
@@ -485,12 +459,12 @@ BuildRoot:        %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
 
 %define __features Netfilter module dated: %{netfilter_snap}\
-%{?with_grsec_full:Grsecurity full support - enabled}\
+%{?with_grsec_full:Grsecurity support - enabled}\
+%{?with_grsec_minimal:Grsecurity minimal support /proc,link,fifo,shm/ - enabled}\
 %{?with_pax:PaX support - enabled}\
 %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
 %{?with_nfsroot:Root on NFS - enabled}\
 %{?with_apparmor:apparmor support - enabled}\
-%{?with_tomoyo:tomoyo support - enabled}
 
 %define Features %(echo "%{__features}" | sed '/^$/d')
 
@@ -540,19 +514,6 @@ vmlinux - dekompressiertes Kernel Bild.
 %description vmlinux -l pl.UTF-8
 vmlinux - rozpakowany obraz jądra.
 
-%package dirs
-Summary:       common dirs for kernel packages
-Summary(pl.UTF-8):     Katalogi wspólne dla pakietów kernela
-Group:         Base/Kernel
-
-%description dirs
-This package provides common dirs shared between various kernel
-packages.
-
-%description dirs -l pl.UTF-8
-Katalog ten udostepnia katalogi współdzielone pomiędzy różnymi
-pakietami kernela.
-
 %package drm
 Summary:       DRM kernel modules
 Summary(de.UTF-8):     DRM Kernel Treiber
@@ -561,7 +522,7 @@ Group:              Base/Kernel
 Requires(postun):      %{name} = %{epoch}:%{version}-%{release}
 Requires:      %{name} = %{epoch}:%{version}-%{release}
 Obsoletes:     kernel-smp-drm
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description drm
 DRM kernel modules.
@@ -582,7 +543,7 @@ Requires:   %{name} = %{epoch}:%{version}-%{release}
 Obsoletes:     kernel-smp-pcmcia
 Conflicts:     pcmcia-cs < 3.1.21
 Conflicts:     pcmciautils < 004
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description pcmcia
 PCMCIA modules.
@@ -593,23 +554,6 @@ PCMCIA Module.
 %description pcmcia -l pl.UTF-8
 Moduły PCMCIA.
 
-%package libs
-Summary:       Libraries for preparing bootable kernel on PowerPCs
-Summary(pl.UTF-8):     Biblioteki do przygotowania bootowalnego jądra dla PowerPC
-Group:         Base/Kernel
-Requires:      %{name} = %{epoch}:%{version}-%{release}
-Requires:      mkvmlinuz >= 1.3
-Obsoletes:     kernel-smp-libs
-Autoreqprov:   no
-
-%description libs
-Libraries for preparing bootable kernel on PowerPCs. Script called
-mkvmlinuz may be useful for this.
-
-%description libs -l pl.UTF-8
-Biblioteki do przygotowania bootowalnego jądra dla PowerPC. Skrypt
-mkvmlinuz może być do tego przydatny.
-
 %package sound-alsa
 Summary:       ALSA kernel modules
 Summary(de.UTF-8):     ALSA Kernel Module
@@ -618,7 +562,7 @@ Group:              Base/Kernel
 Requires(postun):      %{name} = %{epoch}:%{version}-%{release}
 Requires:      %{name} = %{epoch}:%{version}-%{release}
 Obsoletes:     kernel-smp-sound-alsa
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description sound-alsa
 ALSA (Advanced Linux Sound Architecture) sound drivers.
@@ -637,7 +581,7 @@ Group:              Base/Kernel
 Requires(postun):      %{name} = %{epoch}:%{version}-%{release}
 Requires:      %{name} = %{epoch}:%{version}-%{release}
 Obsoletes:     kernel-smp-sound-oss
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description sound-oss
 OSS (Open Sound System) drivers.
@@ -654,7 +598,7 @@ Summary(de.UTF-8):  Header Dateien für den Linux-Kernel
 Summary(pl.UTF-8):     Pliki nagłówkowe jądra Linuksa
 Group:         Development/Building
 Provides:      %{name}-headers(netfilter) = %{netfilter_snap}
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description headers
 These are the C header files for the Linux kernel, which define
@@ -677,7 +621,7 @@ Summary(pl.UTF-8):  Pliki służące do budowania modułów jądra
 Group:         Development/Building
 Requires:      %{name}-headers = %{epoch}:%{version}-%{release}
 Conflicts:     rpmbuild(macros) < 1.321
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description module-build
 Development files from kernel source tree needed to build Linux kernel
@@ -697,7 +641,7 @@ Summary(de.UTF-8):  Der Kernel Quelltext
 Summary(pl.UTF-8):     Kod źródłowy jądra Linuksa
 Group:         Development/Building
 Requires:      %{name}-module-build = %{epoch}:%{version}-%{release}
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description source
 This is the source code for the Linux kernel. You can build a custom
@@ -727,7 +671,7 @@ Summary:    Kernel documentation
 Summary(de.UTF-8):     Kernel Dokumentation
 Summary(pl.UTF-8):     Dokumentacja do jądra Linuksa
 Group:         Documentation
-Autoreqprov:   no
+AutoReqProv:   no
 
 %description doc
 This is the documentation for the Linux kernel, as found in
@@ -748,13 +692,7 @@ ln -s %{SOURCE10} Makefile
 cd linux-%{basever}
 
 # hack against warning in pax/grsec
-%ifarch alpha
 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
-%endif
-
-%ifarch ppc
-install %{SOURCE5} Makefile.ppclibs
-%endif
 
 %if "%{postver}" != "%{nil}"
 %{__bzip2} -dc %{SOURCE1} | patch -p1 -s
@@ -762,13 +700,11 @@ install %{SOURCE5} Makefile.ppclibs
 
 # tuxonice:
 %if %{with tuxonice}
-##ifarch %{ix86} %{x8664} ia64 ppc alpha
 %patch69 -p1
 %patch70 -p1
-##endif
 %endif
 
-# XXX: 2.6.29 - need update
+# tahoe9xx: 2.6.29 - need update
 #%patch2 -p1
 
 %if %{with fbcondecor}
@@ -847,8 +783,6 @@ install %{SOURCE5} Makefile.ppclibs
 %patch55 -p1
 %patch56 -p1
 
-%patch58 -p1
-
 # kernel-rndis_host-wm5.patch
 %patch59 -p1
 
@@ -856,7 +790,8 @@ install %{SOURCE5} Makefile.ppclibs
 %patch85 -p1
 
 # LSI MPT Fusion driver update (by LSI via SUSE folks)
-%patch90 -p1
+# FIXME!
+#%patch90 -p1
 
 # vserver
 %if %{with vserver}
@@ -867,19 +802,18 @@ install %{SOURCE5} Makefile.ppclibs
 # forcedeth
 %patch130 -p1
 
-# unionfs (disabled for rescuecd - problems with aufs2)
+# unionfs (problems with aufs2, needed for aufs1 patch)
 %if %{without rescuecd}
 %patch140 -p1
-%{?with_apparmor:%patch141 -p1}
 %endif
 
 %if %{with rescuecd}
+# aufs2
 %patch148 -p1
 %else
-# 2.6.29 FIXME - needs port to creds
-#%patch145 -p1
-#%patch146 -p1
-#%{?with_apparmor:%patch147 -p1}
+# aufs1
+#patch145 -p1
+#patch146 -p1
 %endif
 
 %patch2500 -p1
@@ -888,72 +822,35 @@ install %{SOURCE5} Makefile.ppclibs
 %patch7000 -p1
 %endif
 
-# merged into 2.6.30 git :)
-%patch7001 -p1
-
 # grsecurity & pax stuff
 #
-%if %{with pax_full}
-%patch9999 -p1
-%{?with_vserver:%patch10000 -p1}
-%{?with_vserver:%patch10001 -p1}
-%{?with_vserver:%patch10002 -p1}
-%{?with_vserver:%patch10003 -p1}
-%else
 
-%if %{with grsec_full}
+# remember that we have the same config file for grsec_minimal and
+# grsec_full, but the patches are different.
+
+%if %{with grsecurity}
+%if %{with grsec_minimal}
+%patch1000 -p1
+%else
+# grsec_full and/or pax
 %patch9999 -p1
 %{?with_vserver:%patch10000 -p1}
 %{?with_vserver:%patch10001 -p1}
 %{?with_vserver:%patch10002 -p1}
-%{?with_vserver:%patch10003 -p1}
-%else
-%if %{with grsec_minimal}
-%patch1000 -p1
-# remember that we have the same config file for grsec_minimal and
-# grsec_full, but the patches are different.
 %endif
 %endif
-
-%if %{with pax}
-# now we have an separate testing pax-only patch - in the future we
-# could have single grsecurity patch and will have to prepare separate
-# configs for grsec_minimal, grsec_full and pax to support such
-# configurations like pax & grsec_minimal.
-# So, in a future there could be no patch9998, but only config
-# would tell which options should be enabled.
-# The second option is to maintain separate pax-only patch.
-%patch9998 -p1
-#patch9997 -p1 - needs update
-%endif
-
-%endif
-
 #
 # end of grsecurity & pax stuff
 
 # apparmor
 %if %{with apparmor}
-%if %{with grsec_full} || %{with pax_full}
-%patch5001 -p1
-%patch5002 -p1
-%else
 %patch5000 -p1
-%patch5002 -p1
-%endif
 %endif
 
-# tomoyo
-%if %{with tomoyo}
-       tar xzf %{SOURCE6000}
-       %if %{with apparmor}
-%patch6000 -p1
-       %else
-%patch6001 -p1
-       %endif
-%endif
+# FIXME
+#%patch150 -p1
 
-%patch150 -p1
+%patch160 -p1
 
 %ifarch ppc ppc64
 #patch200 -p1
@@ -1017,7 +914,7 @@ PaXconfig() {
        # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
        # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
        # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
-       # PAX_HOOK_ACL_FLAGS. SELinux should also be able to make PaX settings via hooks
+       # PAX_HOOK_ACL_FLAGS.
 
        %if %{with grsec_full}
                # Hardening grsec options if with pax
@@ -1027,7 +924,6 @@ PaXconfig() {
 
                # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
        %else
-               # selinux or other hooks?
                CONFIG_PAX_HAVE_ACL_FLAGS=n
                CONFIG_PAX_HOOK_ACL_FLAGS=y
        %endif
@@ -1060,9 +956,12 @@ RescueConfig() {
                # CONFIG_GAMEPORT is not set
                # CONFIG_KVM is not set
                # CONFIG_PHONE is not set
+               # CONFIG_STRICT_DEVMEM is not set
+               # CONFIG_IMA is not set
                CONFIG_AUFS=y
                CONFIG_AUFS_FS=y
                CONFIG_AUFS_BR_RAMFS=y
+               CONFIG_AUFS_RDU=y
                CONFIG_BLK_DEV_LOOP=y
                CONFIG_ISO9660_FS=y
                CONFIG_NLS_UTF8=y
@@ -1094,6 +993,7 @@ BuildConfig() {
                CONFIG_SECURITY_APPARMOR=y
                CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
                CONFIG_SECURITY_APPARMOR_DISABLE=n
+               CONFIG_SECURITY_APPARMOR_NETWORK=y
 %endif
 
 %if %{without ipv6}
@@ -1105,6 +1005,7 @@ BuildConfig() {
                CONFIG_HIGHMEM4G=n
                CONFIG_HIGHMEM64G=y
                CONFIG_X86_PAE=y
+               CONFIG_NUMA=n
   %endif
 %endif
 
@@ -1134,7 +1035,7 @@ EOCONFIG
 %if %{with rescuecd}
        RescueConfig rescue.config
 %endif
-%if %{with pax_full} || %{with pax}
+%if %{with pax}
        PaXconfig pax.config
 %endif
 
@@ -1150,7 +1051,7 @@ EOCONFIG
                rescue.config \
 %endif
                \
-%if %{with pax_full}
+%if %{with pax}
                %{SOURCE45} \
                %{SOURCE49} \
                pax.config \
@@ -1163,10 +1064,6 @@ EOCONFIG
                %{SOURCE51} \
        %endif
   %endif
-  %if %{with pax}
-               %{SOURCE49} \
-               pax.config \
-  %endif
 %endif
                \
 %if %{with reiser4}
@@ -1185,9 +1082,6 @@ EOCONFIG
 %ifarch %{ix86} %{x8664} ia64 ppc ppc64
                %{SOURCE42} \
 %endif
-%endif
-%if %{with tomoyo}
-               config.ccs \
 %endif
                %{SOURCE40} %{?0:netfilter} \
                %{SOURCE41} %{?0:patches} \
@@ -1201,12 +1095,18 @@ BuildConfig > %{defconfig}
 ln -sf %{defconfig} .config
 cd -
 
-%{__make} TARGETOBJ=%{targetobj} oldconfig
+%{__make} \
+       TARGETOBJ=%{targetobj} \
+       %{?with_verbose:V=1} \
+       oldconfig
 
 %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config
 
 # build kernel
-%{__make} TARGETOBJ=%{targetobj} all
+%{__make} \
+       TARGETOBJ=%{targetobj} \
+       %{?with_verbose:V=1} \
+       all
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -1220,15 +1120,23 @@ rm -rf $RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
 
-%if %{with myown}
 # create directories which may be missing, to simplyfy %files
-install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/sound
-%endif
+install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm}
 
 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
 
+# no point embed content for %ghost files. empty them
+for a in \
+       dep{,.bin} \
+       alias{,.bin} \
+       symbols{,.bin} \
+       {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \
+; do
+       > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
+done
+
 # /boot
 install -d $RPM_BUILD_ROOT/boot
 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
@@ -1295,6 +1203,15 @@ cd $RPM_BUILD_ROOT%{_kernelsrcdir}
 %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
 cd -
 
+# move to %{_docdir} so we wouldn't depend on any kernel package for dirs
+install -d $RPM_BUILD_ROOT%{_docdir}
+mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}}
+
+rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
+rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
+rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
+rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -1327,9 +1244,13 @@ mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
 
+if [ -x /sbin/update-grub ]; then
+       /sbin/update-grub >/dev/null 2>&1
+fi
 if [ -x /sbin/new-kernel-pkg ]; then
        /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
-elif [ -x /sbin/rc-boot ]; then
+fi
+if [ -x /sbin/rc-boot ]; then
        /sbin/rc-boot 1>&2 || :
 fi
 
@@ -1339,9 +1260,6 @@ mv -f /boot/vmlinux{,.old} 2> /dev/null
 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
 %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
 
-%post libs
-%{_sbindir}/mkvmlinuz /boot/zImage-%{kernel_release} %{kernel_release}
-
 %post drm
 %depmod %{kernel_release}
 
@@ -1402,9 +1320,7 @@ fi
 
 %dir /lib/modules/%{kernel_release}
 %dir /lib/modules/%{kernel_release}/kernel
-%ifnarch sparc
 /lib/modules/%{kernel_release}/kernel/arch
-%endif
 /lib/modules/%{kernel_release}/kernel/crypto
 /lib/modules/%{kernel_release}/kernel/drivers
 %if %{have_drm}
@@ -1414,6 +1330,7 @@ fi
 /lib/modules/%{kernel_release}/kernel/kernel
 /lib/modules/%{kernel_release}/kernel/lib
 /lib/modules/%{kernel_release}/kernel/net
+/lib/modules/%{kernel_release}/kernel/mm
 %if %{have_sound}
 %dir /lib/modules/%{kernel_release}/kernel/sound
 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
@@ -1449,15 +1366,31 @@ fi
 %if %{with myown}
 /lib/modules/%{kernel_release}/kernel/sound
 %endif
-%ghost /lib/modules/%{kernel_release}/modules.*
+
+%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
+
+# provided by build
+/lib/modules/%{kernel_release}/modules.order
+
+# rest modules.* are ghost (regenerated by post depmod -a invocation)
+%ghost /lib/modules/%{kernel_release}/modules.alias
+%ghost /lib/modules/%{kernel_release}/modules.alias.bin
+%ghost /lib/modules/%{kernel_release}/modules.ccwmap
+%ghost /lib/modules/%{kernel_release}/modules.dep
+%ghost /lib/modules/%{kernel_release}/modules.dep.bin
+%ghost /lib/modules/%{kernel_release}/modules.ieee1394map
+%ghost /lib/modules/%{kernel_release}/modules.inputmap
+%ghost /lib/modules/%{kernel_release}/modules.isapnpmap
+%ghost /lib/modules/%{kernel_release}/modules.ofmap
+%ghost /lib/modules/%{kernel_release}/modules.pcimap
+%ghost /lib/modules/%{kernel_release}/modules.seriomap
+%ghost /lib/modules/%{kernel_release}/modules.symbols
+%ghost /lib/modules/%{kernel_release}/modules.symbols.bin
+%ghost /lib/modules/%{kernel_release}/modules.usbmap
+
 # symlinks pointing to kernelsrcdir
 %ghost /lib/modules/%{kernel_release}/build
 %ghost /lib/modules/%{kernel_release}/source
-%dir %{_sysconfdir}/modprobe.d/%{kernel_release}
-
-%files dirs
-%defattr(644,root,root,755)
-%dir %{_kernelsrcdir}
 
 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
 %files vmlinux
@@ -1494,23 +1427,6 @@ fi
 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
 %endif
 
-%ifarch ppc-broken
-%if "%{_arch}" == "ppc"
-%files libs
-%defattr(644,root,root,755)
-%dir /boot/libs-%{kernel_release}
-/boot/libs-%{kernel_release}/common
-/boot/libs-%{kernel_release}/kernel
-/boot/libs-%{kernel_release}/lib
-/boot/libs-%{kernel_release}/of1275
-/boot/libs-%{kernel_release}/openfirmware
-/boot/libs-%{kernel_release}/simple
-%dir /boot/libs-%{kernel_release}/utils
-%attr(755,root,root) /boot/libs-%{kernel_release}/utils/*
-/boot/libs-%{kernel_release}/ld.script
-%endif
-%endif
-
 %if %{have_sound}
 %files sound-alsa
 %defattr(644,root,root,755)
@@ -1535,8 +1451,9 @@ fi
 %endif
 %endif
 
-%files headers
+%files headers -f files.headers_exclude_kbuild
 %defattr(644,root,root,755)
+%dir %{_kernelsrcdir}
 %{_kernelsrcdir}/include
 %dir %{_kernelsrcdir}/arch
 %dir %{_kernelsrcdir}/arch/[!K]*
@@ -1547,39 +1464,54 @@ fi
 %{_kernelsrcdir}/config-dist
 %{_kernelsrcdir}/Module.symvers-dist
 
-%files module-build -f aux_files
+%files module-build -f files.mb_include_modulebuild_and_dirs
 %defattr(644,root,root,755)
 %ifarch ppc ppc64
 %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
 %endif
+%exclude %dir %{_kernelsrcdir}/arch/m68knommu
+%exclude %dir %{_kernelsrcdir}/arch/um
 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
 %{_kernelsrcdir}/drivers/lguest/lg.h
 %{_kernelsrcdir}/kernel/bounds.c
 %dir %{_kernelsrcdir}/scripts
-%dir %{_kernelsrcdir}/scripts/kconfig
 %{_kernelsrcdir}/scripts/Kbuild.include
 %{_kernelsrcdir}/scripts/Makefile*
 %{_kernelsrcdir}/scripts/basic
+%{_kernelsrcdir}/scripts/kconfig
+%{_kernelsrcdir}/scripts/mkcompile_h
 %{_kernelsrcdir}/scripts/mkmakefile
 %{_kernelsrcdir}/scripts/mod
+%{_kernelsrcdir}/scripts/module-common.lds
 %{_kernelsrcdir}/scripts/setlocalversion
 %{_kernelsrcdir}/scripts/*.c
 %{_kernelsrcdir}/scripts/*.sh
-%{_kernelsrcdir}/scripts/kconfig/*
-%{_kernelsrcdir}/scripts/mkcompile_h
 %dir %{_kernelsrcdir}/scripts/selinux
 %{_kernelsrcdir}/scripts/selinux/Makefile
 %dir %{_kernelsrcdir}/scripts/selinux/mdp
 %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
 %{_kernelsrcdir}/scripts/selinux/mdp/*.c
+%exclude %dir %{_kernelsrcdir}/security
+%exclude %dir %{_kernelsrcdir}/security/selinux
 
+%if %{with doc}
 %files doc
 %defattr(644,root,root,755)
-%{_kernelsrcdir}/Documentation
+%dir %{_docdir}/%{name}-%{version}
+
+%{_docdir}/%{name}-%{version}/[!jkz]*
+%{_docdir}/%{name}-%{version}/[jkz]*.txt
+%{_docdir}/%{name}-%{version}/kbuild
+%{_docdir}/%{name}-%{version}/kdump
+%{_docdir}/%{name}-%{version}/kvm
+%lang(ja) %{_docdir}/%{name}-%{version}/ja_JP
+%lang(ko) %{_docdir}/%{name}-%{version}/ko_KR
+%lang(zh_CN) %{_docdir}/%{name}-%{version}/zh_CN
+%endif
 
 %if %{with source}
-%files source -f aux_files_exc
+%files source -f files.source_exclude_modulebuild_and_dirs
 %defattr(644,root,root,755)
 %{_kernelsrcdir}/arch/*/[!Mik]*
 %{_kernelsrcdir}/arch/*/kernel/[!M]*
@@ -1587,6 +1519,7 @@ fi
 %{_kernelsrcdir}/arch/ia64/install.sh
 %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]*
 %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC
+%{_kernelsrcdir}/arch/m68k/install.sh
 %{_kernelsrcdir}/arch/parisc/install.sh
 %{_kernelsrcdir}/arch/x86/ia32/[!M]*
 %{_kernelsrcdir}/arch/ia64/kvm
@@ -1621,14 +1554,22 @@ fi
 %exclude %{_kernelsrcdir}/scripts/Makefile*
 %exclude %{_kernelsrcdir}/scripts/basic
 %exclude %{_kernelsrcdir}/scripts/kconfig
+%exclude %{_kernelsrcdir}/scripts/mkcompile_h
 %exclude %{_kernelsrcdir}/scripts/mkmakefile
 %exclude %{_kernelsrcdir}/scripts/mod
+%exclude %{_kernelsrcdir}/scripts/module-common.lds
 %exclude %{_kernelsrcdir}/scripts/setlocalversion
 %exclude %{_kernelsrcdir}/scripts/*.c
 %exclude %{_kernelsrcdir}/scripts/*.sh
+%exclude %dir %{_kernelsrcdir}/scripts/selinux
+%exclude %{_kernelsrcdir}/scripts/selinux/Makefile
+%exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp
+%exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
+%exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c
 %{_kernelsrcdir}/sound
 %{_kernelsrcdir}/security
 %exclude %{_kernelsrcdir}/security/selinux/include
+%{_kernelsrcdir}/tools
 %{_kernelsrcdir}/usr
 %{_kernelsrcdir}/COPYING
 %{_kernelsrcdir}/CREDITS
This page took 0.074953 seconds and 4 git commands to generate.