%define sublevel 21 %define release 1grsec %define version 2.4.%{sublevel} %define KVERREL %{version}-%{release} Summary: The Linux kernel (the core of the Linux operating system). Name: kernel Version: %{version} Release: %{release} License: GPL Group: System/Kernel and hardware ExclusiveArch: %{ix86} ExclusiveOS: Linux URL: http://www.kernel.org/ Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-%{version}.tar.gz Source10: kernel-%{version}-i686-%{release}.config Patch10: http://grsecurity.net/grsecurity-1.9.11-2.4.21.patch Packager: Nicolas Lidzborski BuildRoot: %{_tmppath}/%{name}-%{version}-build Provides: kernel = %{version} Autoreqprov: no Prereq: initscripts Requires: modutils %description The kernel package contains the Linux kernel (vmlinuz), the core of your Linux operating system. The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc. This specific kernel contains grsecurity which is a collection of modifications to the Linux kernel targeted to increase security of your system. %prep %setup -q -n linux-%{version} # Patch party begins now # Grsecurity %patch10 -p1 # make sure the kernel has the sublevel we know it has... perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile # get rid of unwanted files find . -name '*~' -o -name '*.orig'|xargs rm -f # install the config files for all the archs install -m 644 %SOURCE10 .config make ARCH=i386 oldconfig install -m 644 .config arch/i386/defconfig ### ### build ### %build # Common target directories %define _bootdir /boot %define _modulesdir /lib/modules # Directories definition needed for building %define target_boot %{buildroot}%{_bootdir} %define target_modules %{buildroot}%{_modulesdir} DependKernel() { echo "Make dep for kernel ${version}" make -s mrproper # it is safest that trusting in defconfig cp arch/%{_arch}/defconfig .config # make sure ETXRAVERSION says what we want it to say perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}/" Makefile make oldconfig make dep } BuildKernel() { KernelVer=$1 echo "Building kernel $KernelVer" %ifarch %{ix86} make bzImage %endif make modules } CreateKernel() { KernelVer=%{KVERREL} DependKernel BuildKernel $KernelVer } ### # DO it... ### # Make new ARCH config files if we don't have them. CreateKernel ### ### install ### %install rm -rf %{buildroot} ## Start installing stuff KernelVer=%{KVERREL} install -d %{target_boot} install -m 644 System.map %{target_boot}/System.map-$KernelVer install -m 644 .config %{target_boot}/config-$KernelVer %ifarch %{ix86} cp -f arch/i386/boot/bzImage %{target_boot}/vmlinuz-$KernelVer %endif # modules install -d %{target_modules}/$KernelVer make INSTALL_MOD_PATH=%{buildroot} KERNELRELEASE=$KernelVer modules_install ### ### clean ### %clean rm -rf %{buildroot} ### ### scripts ### # do this for upgrades...in case the old modules get removed we have # loopback in the kernel so that mkinitrd will work. %preun /sbin/modprobe loop 2> /dev/null > /dev/null || : #rm -f /lib/modules/%{KVERREL}/modules.* if [ -x /sbin/new-kernel-pkg ] ; then /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL} fi %post cd %{_bootdir} ln -sf System.map-%{KVERREL} System.map #ln -sf module-info-%{KVERREL} module-info [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth if [ -x /sbin/new-kernel-pkg ] ; then /sbin/new-kernel-pkg --mkinitrd --install %{KVERREL} fi %postun cd %{_bootdir} if [ -f initrd-%{KVERREL}.img ];then rm -f initrd-%{KVERREL}.img fi ### ### file lists ### %files %defattr(-,root,root) %{_bootdir}/config-%{KVERREL} %{_bootdir}/vmlinuz-%{KVERREL} %{_bootdir}/System.map-%{KVERREL} %{_modulesdir} %changelog * Thu Aug 14 2003 Nicolas Lidzborski 2.4.21-1grsec - Upgraded to 2.4.21 kernel * Thu Apr 24 2003 Nicolas Lidzborski 2.4.20-9grsec - Fix broken learning mode for links * Wed Apr 23 2003 Nicolas Lidzborski 2.4.20-8grsec - Kernel 2.4.20 - Grsecurity version 1.9.9g - EXT3 patches