Summary: The Linux kernel (the core of the Linux operating system) # normal/debug/debuginfo %define buildnormal 1 %define builddebug 0 %define builddebuginfo 0 # kernels we want to build %define buildup 1 %define buildsmp 1 %define buildenterprise 1 %define buildentnosplit 0 # versions %define kversion 2.6.8 %define krelease 022stab076 %define ksubrelease 1 %define rpmversion %{kversion} %define release %{krelease}.%{ksubrelease} %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE} # groups of related archs %define all_x86 i586 i686 # Override generic defaults with per-arch defaults # Second, per-architecture exclusions (ifarch) %ifarch %{all_x86} %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-%{krelease}-i?86*.config.ovz %define image_install_path boot %endif %ifarch x86_64 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-%{krelease}-x86_64*.config.ovz %define buildenterprise 0 %define buildentnosplit 0 %define image_install_path boot %endif %ifarch ia64 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-%{krelease}-ia64.config.ovz %define buildsmp 0 %define buildenterprise 0 %define buildentnosplit 0 %define builddebug 0 %define image_install_path boot/efi %endif %define _unpackaged_files_terminate_build 0 # # Three sets of minimum package version requirements in the form of Conflicts: # to versions below the minimum # # # First the general kernel 2.6 required versions as per # Documentation/Changes # %define kernel_dot_org_conflicts ppp <= 2.3.15, pcmcia-cs <= 3.1.20, isdn4k-utils <= 3.0, mount < 2.10r-5, nfs-utils < 1.0.3, e2fsprogs < 1.29, util-linux < 2.10, jfsutils < 1.0.14, reiserfsprogs < 3.6.3, xfsprogs < 2.1.0, procps < 2.0.9, oprofile < 0.5.3 # # Then a series of requirements that are distribution specific, either # because we add patches for something, or the older versions have # problems with the newer kernel or lack certain things that make # integration in the distro harder than needed. # %define package_conflicts cipe < 1.4.5, tux < 2.1.0, kudzu <= 0.92, initscripts < 7.23, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0 # # Several packages had bugs in them that became obvious when the NPTL # threading code got integrated. # %define nptl_conflicts SysVinit < 2.84-13, pam < 0.75-48, vixie-cron < 3.0.1-73, privoxy < 3.0.0-8, spamassassin < 2.44-4.8.x, cups < 1.1.17-13 # # Packages that need to be installed before the kernel is, because the %post # scripts use them. # %define kernel_prereq fileutils, module-init-tools, initscripts >= 5.83, mkinitrd >= 3.5.5 Name: ovzkernel Group: System Environment/Kernel License: GPLv2 Version: %{rpmversion} Release: %{release} ExclusiveArch: noarch %{all_x86} x86_64 ia64 ExclusiveOS: Linux Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} # We can't let RPM do the dependencies automatic because it'll then pick up # a correct but undesirable perl dependency from the module headers which # isn't required for the kernel proper to function AutoReqProv: no # # List the packages used during the kernel build # BuildPreReq: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar BuildPreReq: bzip2, findutils, gzip, m4, perl, make >= 3.78, gnupg BuildRequires: gcc >= 2.96-98, binutils >= 2.12 BuildConflicts: rhbuildsys(DiskFree) < 500Mb Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-%{kversion}.tar.bz2 Source20: kernel-%{kversion}-%{krelease}-i686.config.ovz Source21: kernel-%{kversion}-%{krelease}-i686-smp.config.ovz Source22: kernel-%{kversion}-%{krelease}-i686-enterprise.config.ovz Source23: kernel-%{kversion}-%{krelease}-x86_64.config.ovz Source24: kernel-%{kversion}-%{krelease}-x86_64-smp.config.ovz Source25: kernel-%{kversion}-%{krelease}-ia64.config.ovz Source26: kernel-%{kversion}-%{krelease}-i686-entnosplit.config.ovz # ---------------------------------------------------------------------------- # List of patches # ---------------------------------------------------------------------------- Patch0: diff-2.6.8-2.6.8.1 Patch1: linux-2.6.0-nonintconfig.patch Patch100: patch-%{krelease}-core #---1000------ IA64 -------------------------- Patch1000: diff-ia64-makefile-20051004 Patch1001: diff-ia64-init-sched-20051205 Patch1002: diff-ia64-init-sched-20060130 #---2000------ x86_64 ------------------------ #---5000------ driver patches ---------------- # required mainstream changes Patch5000: diff-ms-iomem-20051024 Patch5001: diff-ms-nthpage-20051020 Patch5002: diff-ms-bitwise-20051020 Patch5003: diff-ms-netdev-constants-20051020 Patch5004: diff-ms-msleep-int-20051020 Patch5005: diff-ms-mmiowb-20051024 Patch5006: diff-ms-disk-attribute-20051025 Patch5007: diff-rh-ssleep-20051026 Patch5008: diff-ms-ioctl32-compat-20051026 Patch5009: diff-ms-i386-aincret-20060317 Patch5010: diff-ms-x86_86-aincret-20060317 Patch5011: diff-ms-kstrdup-20060320 # updates Patch5100: linux-2.6.10-scsi-midlayer-updates.patch Patch5101: linux-2.6.8.1-libata-1.11.patch Patch5102: linux-2.6.8.1-megaraid-2.20.x.patch Patch5103: linux-2.6.8.1-aacraid-1.1.5.patch Patch5104: linux-2.6.8.1-e1000-6.1.16-k3.patch Patch5105: linux-2.6.8.1-e100-3.4.8.patch Patch5106: linux-2.6.8.1-r8169-2.2.patch Patch5107: linux-2.6.8.1-sk98lin-8.31.2.3.patch Patch5108: linux-2.6.8.1-tg3-3.43.rh.patch Patch5109: linux-2.6.8.1-aoe-14.patch Patch5110: linux-2.6.8.1-iscsi-sfnet-4.0.1.11.1.patch Patch5111: linux-2.6.8.1-emulex-8.0.16.17.patch Patch5112: linux-2.6.8.1-qla4xx-5.00.02.patch Patch5113: linux-2.6.9-ide-csb6-raid.patch Patch5114: linux-2.6.8.1-intel-ich7-esb2.patch Patch5116: linux-2.6.8.1-ips-7.12.02.patch Patch5117: linux-2.6.8.1-scsi-aic-hostraid.patch Patch5118: linux-2.6.8.1-cciss-2.8.6.patch Patch5120: linux-2.6.8.1-3w9xxx-2.26.04.007.patch Patch5121: diff-ide-amd74xx-update-20060206 Patch5122: linux-2.6.15-dcdbas-5.6.0-1.patch Patch5123: linux-2.6.8.1-drbd-0.7.17.patch #Patch5124: linux-2.6.8.1-fusion-3.02.18.patch Patch5125: linux-2.6.8.1-areca-1.20.0X.12.patch Patch5126: linux-2.6.8.1-qla2xxx-8.01.03.patch Patch5127: linux-2.6.8-dm-20051004.patch # fixes Patch5200: diff-aacraid-addon-20051021 Patch5201: diff-scsi-mpt-fusion-20050927 Patch5202: diff-sis900-20051014 Patch5203: diff-ms-sx8-20040912 Patch5204: diff-drv-nexsan-20051025 Patch5205: diff-aoe-fix-20051025 Patch5206: diff-pciids-update Patch5207: diff-aic7xxx-reset-20030904 Patch5208: diff-qla4xx-warnfix-20051025 Patch5209: diff-libata-conflicts-20051025 Patch5210: diff-drv-megaraid-entropy-20051025 Patch5211: diff-drv-fusion-entropy-20040831 Patch5212: diff-drv-dpt-entropy-20040525 #Patch5213: diff-aac-fix-20051024 # FIXME Patch5214: diff-qla-compile-fix-20051031 Patch5215: diff-ips-fix-20051114 Patch5216: diff-scsi-usb-forced-remove Patch5217: diff-ms-scsi-adddev-22051214 Patch5218: diff-i2o-update-20051214 Patch5219: diff-sis-sata-20060109 Patch5220: diff-psmouse-init-20060119 Patch5221: diff-usb-uhci-20060216 Patch5222: diff-usb-hid-20060216 Patch5223: diff-usb-kbddetach-20060216 Patch5224: diff-cciss-timeout-20060228 #Patch5225: diff-fusion-crashdump-20060303 #Patch5226: diff-mpt-fusion-nosleep Patch5230: diff-hid-update-20060403 Patch5231: diff-net-mii-update-20060402 # gcc4 fixes Patch5500: diff-ms-gcc4-aic7xxx-20051103 Patch5501: diff-ms-gcc4-qla4xxx-20051103 Patch5502: diff-ms-gcc4-scsi-ips-20051103 Patch5503: diff-ms-gcc4-8139too-20051103 Patch5505: diff-ms-gcc4-i2c-20051103 Patch5506: diff-ms-gcc4-usblp-20051111 # ---------------------------------------------------------------------------- BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root %description This package contains the OpenVZ kernel. This is the Linux kernel with added virtualization functionality. %package debug Summary: The Linux kernel compiled with debug parameters Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description debug Debug kernel %package smp Summary: The Linux kernel compiled for SMP machines. Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description smp This package includes a SMP version of the OpenVZ kernel. Install the ovzkernel-smp package if your machine uses two or more CPUs or CPUs with hyperthreading technology. %package smp-debug Summary: The Linux kernel compiled with debug parameters Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description smp-debug Debug kernel %package enterprise Summary: The Linux kernel compiled for SMP enterprise machines. Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description enterprise This package includes a SMP enterprise version of the OpenVZ kernel. Install the ovzkernel-enterprise package if your machine uses two or more CPUs (or CPUs with hyperthreading technology) and have more than 4GB RAM. %package enterprise-debug Summary: The Linux kernel compiled with debug parameters Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel = %{KVERREL} Provides: vzquotamod Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description enterprise-debug Debug kernel %package entnosplit Summary: The Linux kernel compiled for SMP hugemem machines without 4GB split. Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel Provides: vzquotamod Obsoletes: ovzkernel-entnosplit = %{KVERREL} Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description entnosplit This package includes a SMP hugemem version of the Virtuozzo kernel without 4GB split. %package entnosplit-debug Summary: The Linux kernel compiled with debug parameters Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: vzkernel Provides: vzquotamod Obsoletes: ovzkernel-entnosplit-debug = %{KVERREL} Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} AutoReqProv: no %description entnosplit-debug Debug kernel # ---------------------------------------------------------------------------- # prepare # ---------------------------------------------------------------------------- %prep %setup -q -n %{name}-%{version} -c cd linux-%{kversion} # ---------------------------------------------------------------------------- # applying patches # ---------------------------------------------------------------------------- %patch0 -p1 %patch1 -p1 %patch100 -p1 %patch1000 -p1 %ifarch ia64 %patch1001 -p1 %patch1002 -p1 %endif %patch5000 -p1 %patch5001 -p1 %patch5002 -p1 %patch5003 -p1 %patch5004 -p1 %patch5005 -p1 %patch5006 -p1 %patch5007 -p1 %patch5008 -p1 %patch5009 -p1 %patch5010 -p1 %patch5011 -p1 %patch5100 -p1 %patch5101 -p1 %patch5102 -p1 %patch5103 -p1 %patch5104 -p1 %patch5105 -p1 %patch5106 -p1 %patch5107 -p1 %patch5108 -p1 %patch5109 -p1 %patch5110 -p1 %patch5111 -p1 %patch5112 -p1 %patch5113 -p1 %patch5114 -p1 %patch5116 -p1 %patch5117 -p1 %patch5118 -p1 %patch5120 -p1 %patch5121 -p1 %patch5122 -p1 %patch5123 -p1 #%patch5124 -p1 %patch5125 -p1 %patch5126 -p1 %patch5127 -p1 %patch5200 -p1 %patch5201 -p1 %patch5202 -p1 %patch5203 -p1 %patch5204 -p1 %patch5205 -p1 %patch5206 -p1 %patch5207 -p1 %patch5208 -p1 %patch5209 -p1 %patch5210 -p1 %patch5211 -p1 %patch5212 -p1 #%patch5213 -p1 %patch5214 -p1 %patch5215 -p1 %patch5216 -p1 %patch5217 -p1 %patch5218 -p1 %patch5219 -p1 %patch5220 -p1 %patch5221 -p1 %patch5222 -p1 %patch5223 -p1 %patch5224 -p1 #%patch5225 -p1 #%patch5226 -p1 %patch5230 -p1 %patch5231 -p1 %patch5500 -p1 %patch5501 -p1 %patch5502 -p1 %patch5503 -p1 %patch5505 -p1 %patch5506 -p1 # ---------------------------------------------------------------------------- mkdir configs cp -fv %{all_arch_configs} . # now run oldconfig over all the config files for i in *.config* do mv $i .config make ARCH=`echo $i | cut -d"-" -f4 | cut -d"." -f1 | sed -e s/i.86/i386/ -e s/s390x/s390/ -e s/ppc64.series/ppc64/ -e s/ppc8.../ppc/ -e s/ppc32dy4/ppc/ ` nonint_oldconfig > /dev/null cp .config configs/$i done # get rid of unwanted files resulting from patch fuzz find . -name "*.orig" -exec rm -fv {} \; find . -name "*~" -exec rm -fv {} \; # ---------------------------------------------------------------------------- # build # ---------------------------------------------------------------------------- %build cd linux-%{kversion} MakeDebugInfoConfig() { sed -e "s/.*\(CONFIG_DEBUG_INFO\).*/\1=y/" .config > .config.xxx mv -f .config.xxx .config } MakeDebugConfig() { sed \ -e "s/.*\(CONFIG_DEBUG_KERNEL\>\).*/\1=y/" \ -e "s/.*\(CONFIG_DEBUG_STACKOVERFLOW\>\).*/\1=y/" \ -e "s/.*\(CONFIG_DEBUG_SLAB\>\).*/\1=y/" \ -e "s/.*\(CONFIG_MAGIC_SYSRQ\>\).*/\1=y/" \ -e "s/.*\(CONFIG_DEBUG_SPINLOCK\>\).*/\1=y/" \ -e "s/.*\(CONFIG_DEBUG_PAGEALLOC\>\).*/\1=y/" \ -e "s/.*\(CONFIG_DEBUG_SPINLOCK_SLEEP\>\).*/\1=y/" \ -e "s/.*\(CONFIG_FRAME_POINTER\>\).*/\1=y/" \ .config > .config.xxx mv -f .config.xxx .config } BuildKernel() { VER=$1 DBG=$2 [ -z "$VER" ] && SUFF="" || SUFF=-$VER if [ -z "$VER" ]; then VER=$DBG; else [ -n "$DBG" ] && VER=$VER-$DBG fi [ -z "$VER" ] && FULLSUFF="" || FULLSUFF=-$VER # Pick the right config file for the kernel we're building Config=kernel-%{kversion}-%{krelease}-%{_target_cpu}${SUFF}.config.ovz KernelVer=%{version}-%{release}${FULLSUFF} perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}${FULLSUFF}/" Makefile echo BUILDING A KERNEL FOR $VER %{_target_cpu}... # and now to start the build process make -s mrproper cp configs/$Config .config arch=`echo $Config | cut -d"-" -f4 | cut -d"." -f1 | sed -e s/i.86/i386/ \ -e s/s390x/s390/ -e s/ppc64.series/ppc64/ -e s/ppc8.../ppc/ -e s/ppc32dy4/ppc/ ` [ "$DBG" == "debug" ] && MakeDebugConfig %if %{builddebuginfo} MakeDebugInfoConfig %endif make ARCH=${arch} -s nonint_oldconfig > /dev/null make -s include/linux/version.h make ARCH=${arch} -s %{?_smp_mflags} bzImage make ARCH=${arch} -s %{?_smp_mflags} modules || exit 1 make ARCH=${arch} buildcheck # Start installing the results mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/boot mkdir -p $RPM_BUILD_ROOT/%{image_install_path} install -m 644 System.map $RPM_BUILD_ROOT/usr/lib/debug/boot/System.map-$KernelVer install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-$KernelVer cp arch/*/boot/bzImage $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer cp vmlinux $RPM_BUILD_ROOT/%{image_install_path}/vmlinux-$KernelVer mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer make -s INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer # And save the headers/makefiles etc for building modules against # # This all looks scary, but the end result is supposed to be: # * all arch relevant include/ files # * all Makefile/Kconfig files # * all script/ files rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/source mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build (cd $RPM_BUILD_ROOT/lib/modules/$KernelVer ; ln -s build source) # first copy everything cp --parents `find -type f -name Makefile -o -name "Kconfig*"` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp Module.symvers $RPM_BUILD_ROOT/lib/modules/$KernelVer/build # then drop all but the needed Makefiles/Kconfig files rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Documentation rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cp arch/%{_arch}/kernel/asm-offsets.s $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/kernel || : cp .config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build cp -a arch/%{_arch}/scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch} || : cp -a arch/%{_arch}/*lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/ || : rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*.o rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/*/*.o mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cd include cp -a acpi config linux math-emu media net pcmcia rxrpc scsi sound video asm asm-generic ub $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cp -a `readlink asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include # Make sure the Makefile and version.h have a matching timestamp so that # external modules can be built touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/Makefile $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/version.h touch -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/linux/autoconf.h cd .. # # save the vmlinux file for kernel debugging into the kernel-debuginfo rpm # mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer cp vmlinux $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer # mark modules executable so that strip-to-file can strip them find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f | xargs chmod u+x # cp -r $RPM_BUILD_ROOT/lib/modules/$KernelVer/kernel $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer # detect missing or incorrect license tags for i in `find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" ` ; do echo -n "$i " ; /sbin/modinfo -l $i >> modinfo ; done cat modinfo | grep -v "^GPL" | grep -v "^Dual BSD/GPL" | grep -v "^Dual MPL/GPL" | grep -v "^GPL and additional rights" | grep -v "^GPL v2" && exit 1 rm -f modinfo # remove files that will be auto generated by depmod at rpm -i time rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.* } XBuildKernel() { # build normal kernel %if %{buildnormal} BuildKernel $1 %endif %if %{builddebug} BuildKernel "$1" "debug" %endif } ### # DO it... ### # prepare directories rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/boot %if %{buildup} XBuildKernel %endif %if %{buildsmp} XBuildKernel smp %endif %if %{buildenterprise} XBuildKernel enterprise %endif %if %{buildentnosplit} XBuildKernel entnosplit %endif ### ### install ### %install cd linux-%{kversion} # architectures that don't get kernel-source (i586/i686/athlon) dont need # much of an install because the build phase already copied the needed files ### ### clean ### %clean rm -rf $RPM_BUILD_ROOT ### ### scripts ### # load the loop module for upgrades...in case the old modules get removed we have # loopback in the kernel so that mkinitrd will work. %pre /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre debug /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre smp /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre smp-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre enterprise /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre enterprise-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre entnosplit /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %pre entnosplit-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %post %ifarch ia64 [ -f /etc/redhat-release ] && mv /%{image_install_path}/vmlinu{z,x}-%{KVERREL} /%{image_install_path}/efi/redhat/ [ -f /etc/SuSE-release ] && mv /%{image_install_path}/vmlinu{z,x}-%{KVERREL} /boot/ %endif [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL} %post debug %ifarch ia64 [ -f /etc/redhat-release ] && mv /%{image_install_path}/vmlinu{z,x}-%{KVERREL}-debug /%{image_install_path}/efi/redhat/ [ -f /etc/SuSE-release ] && mv /%{image_install_path}/vmlinu{z,x}-%{KVERREL}-debug /boot/ %endif [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}-debug %post smp [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}-smp %post smp-debug [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}-smp-debug %post enterprise [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}-enterprise %post enterprise-debug [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}-enterprise-debug %post entnosplit [ -x /sbin/vzkernel-install ] && /sbin/vzkernel-install --install --mkinitrd --depmod %{KVERREL}-entnosplit exit 0 %post entnosplit-debug [ -x /sbin/vzkernel-install ] && /sbin/vzkernel-install --install --mkinitrd --depmod %{KVERREL}-entnosplit-debug exit 0 %preun %ifarch ia64 [ -f /etc/redhat-release ] && mv /%{image_install_path}/efi/redhat/vmlinu{z,x}-%{KVERREL} /%{image_install_path}/ [ -f /etc/SuSE-release ] && mv /boot/vmlinu{z,x}-%{KVERREL} /%{image_install_path}/ %endif /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL} %preun debug %ifarch ia64 [ -f /etc/redhat-release ] && mv /%{image_install_path}/efi/redhat/vmlinu{z,x}-%{KVERREL}-debug /%{image_install_path}/ [ -f /etc/SuSE-release ] && mv /boot/vmlinu{z,x}-%{KVERREL}-debug /%{image_install_path}/ %endif /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}-debug %preun smp /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}-smp %preun smp-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}-smp-debug %preun enterprise /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}-enterprise %preun enterprise-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/new-kernel-pkg ] && /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}-enterprise-debug %preun entnosplit /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/vzkernel-install ] && /sbin/vzkernel-install --remove --rminitrd --rmmoddep %{KVERREL}-entnosplit exit 0 %preun entnosplit-debug /sbin/modprobe loop 2> /dev/null > /dev/null || : [ -x /sbin/vzkernel-install ] && /sbin/vzkernel-install --remove --rminitrd --rmmoddep %{KVERREL}-entnosplit-debug exit 0 ### ### file lists ### %if %{buildup} && %{buildnormal} %files %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL} /%{image_install_path}/vmlinux-%{KVERREL} /boot/System.map-%{KVERREL} %dir /lib/modules/%{KVERREL} /lib/modules/%{KVERREL}/kernel %verify(not mtime) /lib/modules/%{KVERREL}/build %endif %if %{buildup} && %{builddebug} %files debug %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-debug /%{image_install_path}/vmlinux-%{KVERREL}-debug /boot/System.map-%{KVERREL}-debug %dir /lib/modules/%{KVERREL}-debug /lib/modules/%{KVERREL}-debug/kernel %verify(not mtime) /lib/modules/%{KVERREL}-debug/build %endif ### ------------------ SMP ----------------------- %if %{buildsmp} && %{buildnormal} %files smp %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-smp /%{image_install_path}/vmlinux-%{KVERREL}-smp /boot/System.map-%{KVERREL}-smp %dir /lib/modules/%{KVERREL}-smp /lib/modules/%{KVERREL}-smp/kernel %verify(not mtime) /lib/modules/%{KVERREL}-smp/build %endif %if %{buildsmp} && %{builddebug} %files smp-debug %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-smp-debug /%{image_install_path}/vmlinux-%{KVERREL}-smp-debug /boot/System.map-%{KVERREL}-smp-debug %dir /lib/modules/%{KVERREL}-smp-debug /lib/modules/%{KVERREL}-smp-debug/kernel %verify(not mtime) /lib/modules/%{KVERREL}-smp-debug/build %endif ### --------------- ENTERPRISE--------------------- %if %{buildenterprise} && %{buildnormal} %files enterprise %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-enterprise /%{image_install_path}/vmlinux-%{KVERREL}-enterprise /boot/System.map-%{KVERREL}-enterprise %dir /lib/modules/%{KVERREL}-enterprise /lib/modules/%{KVERREL}-enterprise/kernel %verify(not mtime) /lib/modules/%{KVERREL}-enterprise/build %endif %if %{buildenterprise} && %{builddebug} %files enterprise-debug %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-enterprise-debug /%{image_install_path}/vmlinux-%{KVERREL}-enterprise-debug /boot/System.map-%{KVERREL}-enterprise-debug %dir /lib/modules/%{KVERREL}-enterprise-debug /lib/modules/%{KVERREL}-enterprise-debug/kernel %verify(not mtime) /lib/modules/%{KVERREL}-enterprise-debug/build %endif ### --------------- ENTNOSPLIT --------------------- %if %{buildentnosplit} && %{buildnormal} %files entnosplit %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-entnosplit /%{image_install_path}/vmlinux-%{KVERREL}-entnosplit /boot/System.map-%{KVERREL}-entnosplit %dir /lib/modules/%{KVERREL}-entnosplit /lib/modules/%{KVERREL}-entnosplit/kernel %verify(not mtime) /lib/modules/%{KVERREL}-entnosplit/build %endif %if %{buildentnosplit} && %{builddebug} %files entnosplit-debug %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}-entnosplit-debug /%{image_install_path}/vmlinux-%{KVERREL}-entnosplit-debug /boot/System.map-%{KVERREL}-entnosplit-debug %dir /lib/modules/%{KVERREL}-entnosplit-debug /lib/modules/%{KVERREL}-entnosplit-debug/kernel %verify(not mtime) /lib/modules/%{KVERREL}-entnosplit-debug/build %endif