# - 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
-# - update or remove tahoe9xx patch2
+# - 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'
#
# 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)
%endif
%define basever 2.6.32
-%define postver %{nil}
-%define rel 0.1
+%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)
Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
# Source0-md5: 260551284ac224c3a43c4adac7df4879
%if "%{postver}" != "%{nil}"
-Source1: http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
-# Source1-md5: 89802830db41e517cdf0954145f73337
+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
# netfilter related stuff mostly based on patch-o-matic-ng
# snapshot 20070806 with some fixes. Some modules
-# were ported to nf_conntrack.
+# 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.29.1-imq-test2.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
# 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.32-vs2.3.0.36.26.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
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
# based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
Patch7000: kernel-inittmpfs.patch
-# based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.31.6-200911151724.patch" kernel-grsec_full.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
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}/.*|.*/vmlinux.*)'
+%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}
%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
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:
%patch55 -p1
%patch56 -p1
-# FIXME
-#%patch58 -p1
-
# kernel-rndis_host-wm5.patch
%patch59 -p1
%{?with_vserver:%patch10000 -p1}
%{?with_vserver:%patch10001 -p1}
%{?with_vserver:%patch10002 -p1}
-%{?with_vserver:%patch10003 -p1}
%endif
%endif
#
# FIXME
#%patch150 -p1
+%patch160 -p1
+
%ifarch ppc ppc64
#patch200 -p1
%endif
# 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.
+ # PAX_HOOK_ACL_FLAGS.
%if %{with grsec_full}
# Hardening grsec options if with pax
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
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}
%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}
%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)
%exclude %dir %{_kernelsrcdir}/security
%exclude %dir %{_kernelsrcdir}/security/selinux
+%if %{with doc}
%files doc
%defattr(644,root,root,755)
%dir %{_docdir}/%{name}-%{version}
%{_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 files.source_exclude_modulebuild_and_dirs