# - with_grsec_minimal
# - with_grsec_full
#
+# 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 configuration files:
# - run build
#
# 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
%{?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.30
-%define postver .2
-%define rel 0.1
+%define basever 2.6.32
+%define postver .63
+%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)
License: GPL v2
Group: Base/Kernel
Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
-# Source0-md5: 7a80058a6382e5108cdb5554d1609615
+# Source0-md5: 260551284ac224c3a43c4adac7df4879
%if "%{postver}" != "%{nil}"
-Source1: http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
-# Source1-md5: 3b566e7d970941846bcbe35cecf04e21
+Patch1: http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v%{basever}/patch-%{version}.xz
+# Patch1-md5: bcde8b57108d4989765a616b4b8ff301
%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
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
# 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
Patch55: kernel-atm-vbr.patch
Patch56: kernel-atmdd.patch
-# http://www.ntop.org/PF_RING.html 20090721
-# svn co https://svn.ntop.org/svn/ntop/trunk/PF_RING/ and use mkpatch.sh
-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/current-tuxonice-for-2.6.30.patch-20090620-v1.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
# 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.30.1-vs2.3.0.36.14-pre4.diff
+# based on http://vserver.13thfloor.at/Experimental/patch-2.6.32.63-vs2.3.0.36.30.diff
Patch100: kernel-vserver-2.3.patch
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
# aufs1, http://aufs.sourceforge.net/
+# aufs1 is NOT maintained since Jan 2009.
Patch145: kernel-aufs.patch
Patch146: kernel-aufs-support.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
# (only warnings, so just remove parts of this patch if conflics)
Patch2500: kernel-warnings.patch
-# git://kernel.ubuntu.com/jj/apparmor-karmic-tree.git
-# git diff 0c9f19b4dd23620fb32116922b0d93e8aca6c911..HEAD
+# git://kernel.ubuntu.com/ubuntu/ubuntu-karmic.git
+# see ubuntu/apparmor dir
Patch5000: kernel-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
-# 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.6-200907122214.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
%ifarch ppc
BuildRequires: uboot-mkimage
%endif
-AutoReqProv: no
+##BuildRequires: gcc < 6:4.6
BuildRequires: /sbin/depmod
BuildRequires: gcc >= 5:3.2
+BuildRequires: tar >= 1:1.22
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
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
%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
%define topdir %{_builddir}/%{name}-%{version}
%define srcdir %{topdir}/linux-%{basever}
%define objdir %{topdir}/%{targetobj}
-%define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
+%define targetobj %{_target_base_arch}-gcc-%(%{__cc} -dumpversion)
%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
%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}\
%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
Requires(postun): %{name} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: kernel-smp-drm
-Autoreqprov: no
+AutoReqProv: no
%description drm
DRM kernel modules.
Obsoletes: kernel-smp-pcmcia
Conflicts: pcmcia-cs < 3.1.21
Conflicts: pcmciautils < 004
-Autoreqprov: no
+AutoReqProv: no
%description pcmcia
PCMCIA modules.
%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
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.
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.
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
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
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
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
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
+%patch1 -p1
%endif
# tuxonice:
%patch70 -p1
%endif
-# XXX: 2.6.29 - need update
+# tahoe9xx: 2.6.29 - need update
#%patch2 -p1
%if %{with fbcondecor}
%patch55 -p1
%patch56 -p1
-%patch58 -p1
-
# kernel-rndis_host-wm5.patch
%patch59 -p1
# forcedeth
%patch130 -p1
-# unionfs (disabled for rescuecd - problems with aufs2)
+# unionfs (problems with aufs2, needed for aufs1 patch)
%if %{without rescuecd}
%patch140 -p1
%endif
%if %{with rescuecd}
+# aufs2
%patch148 -p1
%else
-# 2.6.29 FIXME - needs port to creds
-#%patch145 -p1
-#%patch146 -p1
+# aufs1
+#patch145 -p1
+#patch146 -p1
%endif
%patch2500 -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
%patch5000 -p1
%endif
-%patch150 -p1
+# FIXME
+#%patch150 -p1
+
+%patch160 -p1
%ifarch ppc ppc64
#patch200 -p1
# 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
# 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
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
CONFIG_HIGHMEM4G=n
CONFIG_HIGHMEM64G=y
CONFIG_X86_PAE=y
+ CONFIG_NUMA=n
%endif
%endif
%if %{with rescuecd}
RescueConfig rescue.config
%endif
-%if %{with pax_full} || %{with pax}
+%if %{with pax}
PaXconfig pax.config
%endif
rescue.config \
%endif
\
-%if %{with pax_full}
+%if %{with pax}
%{SOURCE45} \
%{SOURCE49} \
pax.config \
%{SOURCE51} \
%endif
%endif
- %if %{with pax}
- %{SOURCE49} \
- pax.config \
- %endif
%endif
\
%if %{with reiser4}
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
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} \
+ devname \
+ softdep \
+ 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}
%ifarch %{ix86} %{x8664}
cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
%endif
%ifarch ppc ppc64
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
+install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
%endif
%ifarch ia64
%{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
%{__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
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
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}
%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}
/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*
%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.devname
+%ghost /lib/modules/%{kernel_release}/modules.softdep
+%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
/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)
%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]*
%{_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]*
%{_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
%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