Summary: The Linux kernel (the core of the Linux operating system) # What parts do we want to build? We must build at least one kernel. # These are the kernels that are built IF the architecture allows it. %define buildup 1 %define buildsmp 0 %define builddoc 0 # Versions of various parts # # Polite request for people who spin their own kernel rpms: # please modify the "release" field in a way that identifies # that the kernel isn't the stock distribution kernel, for example by # adding some text to the end of the version number. # %define sublevel 17 %define kversion 2.6.%{sublevel} %define rpmversion 2.6.%{sublevel} %define release %(R="$Revision: 1.2142 $"; RR="${R##: }"; echo ${RR%%?})_FC4 %define signmodules 0 %define make_target bzImage %define kernel_image x86 %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE} # groups of related archs %define all_x86 i586 i686 # Override generic defaults with per-arch defaults %ifarch noarch %define builddoc 1 %define buildup 0 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-*.config %endif # Second, per-architecture exclusions (ifarch) %ifarch %{all_x86} %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-i?86*.config %define image_install_path boot %define signmodules 1 %endif %ifarch i686 %define buildsmp 1 %endif %ifarch x86_64 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-x86_64*.config %define image_install_path boot %define signmodules 1 %define buildsmp 1 %endif %ifarch ppc64 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ppc64*.config %define image_install_path boot %define signmodules 1 %define make_target vmlinux %define kernel_image vmlinux %endif %ifarch ppc64iseries %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ppc64*.config %define image_install_path boot %define signmodules 1 %define make_target vmlinux %define kernel_image vmlinux %endif %ifarch s390 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-s390*.config %define image_install_path boot %define make_target image %define kernel_image arch/s390/boot/image %endif %ifarch s390x %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-s390x.config %define image_install_path boot %define make_target image %define kernel_image arch/s390/boot/image %endif %ifarch sparc %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-sparc.config %define make_target image %define kernel_image image %endif %ifarch sparc64 %define buildsmp 1 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-sparc64*.config %define make_target image %define kernel_image image %endif %ifarch ppc %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ppc*.config %define image_install_path boot %define make_target vmlinux %define kernel_image vmlinux %define buildsmp 1 %endif %ifarch ia64 %define all_arch_configs $RPM_SOURCE_DIR/kernel-%{kversion}-ia64.config %define image_install_path boot/efi/EFI/redhat %define signmodules 1 %define make_target compressed %define kernel_image vmlinux.gz %endif # # 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, kudzu <= 0.92, initscripts < 7.23, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0 selinux-policy-targeted < 1.23.16-1 # # 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 >= 4.2.15-1 Name: kernel Group: System Environment/Kernel License: GPLv2 Version: %{rpmversion} Release: %{release} ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ExclusiveOS: Linux Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release} 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, diffutils BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config BuildConflicts: rhbuildsys(DiskFree) < 500Mb Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-%{kversion}.tar.bz2 Source10: COPYING.modules Source11: genkey Source20: kernel-%{kversion}-i586.config Source22: kernel-%{kversion}-i686.config Source23: kernel-%{kversion}-i686-smp.config Source25: kernel-%{kversion}-x86_64.config Source26: kernel-%{kversion}-x86_64-smp.config Source27: kernel-%{kversion}-ppc.config Source28: kernel-%{kversion}-ppc-smp.config Source29: kernel-%{kversion}-ppc64.config Source30: kernel-%{kversion}-ppc64iseries.config Source32: kernel-%{kversion}-s390.config Source33: kernel-%{kversion}-s390x.config Source34: kernel-%{kversion}-ia64.config #Source66: kernel-%{kversion}-sparc.config #Source67: kernel-%{kversion}-sparc64.config #Source68: kernel-%{kversion}-sparc64-smp.config # # Patches 0 through 100 are meant for core subsystem upgrades # Patch1: patch-2.6.17.4.bz2 # Patches 100 through 500 are meant for architecture patches # 200 - 299 x86(-64) Patch200: linux-2.6-x86-tune-generic.patch Patch201: linux-2.6-x86-vga-vidfail.patch Patch202: linux-2.6-intel-cache-build.patch Patch203: linux-2.6-x86_64-silence-up-apic-errors.patch Patch204: linux-2.6-edid-check.patch Patch205: linux-2.6-x86_64-smp-on-uphw-cpucount.patch Patch206: linux-2.6-x86-hp-reboot.patch Patch207: linux-2.6-x86-cpu_index-false.patch Patch208: linux-2.6-x86_64-noisy-syscalls.patch Patch210: linux-2.6-x86-alternatives-smp-only.patch # 300 - 399 ppc(64) Patch302: linux-2.6-offb-find-fb.patch Patch305: linux-2.6-cell-mambo-drivers.patch Patch306: linux-2.6-hvc-console.patch Patch314: linux-2.6-ppc-rtas-check.patch Patch317: linux-2.6-ppc-iseries-input-layer.patch # 400 - 499 ia64 # 500 - 599 s390(x) # 600 - 699 sparc(64) # # Patches 800 through 899 are reserved for bugfixes to the core system # and patches related to how RPMs are build # Patch800: linux-2.6-build-nonintconfig.patch Patch801: linux-2.6-build-userspace-headers-warning.patch # Exec-shield. Patch810: linux-2.6-execshield.patch Patch813: linux-2.6-warn-c-p-a.patch # Module signing infrastructure. Patch900: linux-2.6-modsign-core.patch Patch901: linux-2.6-modsign-crypto.patch Patch902: linux-2.6-modsign-ksign.patch Patch903: linux-2.6-modsign-mpilib.patch Patch904: linux-2.6-modsign-script.patch Patch905: linux-2.6-modsign-include.patch # Tux http accelerator. Patch910: linux-2.6-tux.patch # # Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems # Patch1011: linux-2.6-debug-slab-backtrace.patch Patch1012: linux-2.6-debug-list_head.patch Patch1013: linux-2.6-debug-taint-vm.patch Patch1015: linux-2.6-debug-singlebiterror.patch Patch1016: linux-2.6-debug-spinlock-taint.patch Patch1017: linux-2.6-debug-spinlock-panic.patch Patch1018: linux-2.6-debug-Wundef.patch Patch1019: linux-2.6-debug-disable-builtins.patch Patch1020: linux-2.6-debug-sleep-in-irq-warning.patch Patch1025: linux-2.6-debug-sysfs-crash-debugging.patch Patch1027: linux-2.6-debug-slab-leak-detector.patch Patch1028: linux-2.6-debug-oops-pause.patch Patch1029: linux-2.6-debug-account-kmalloc.patch Patch1030: linux-2.6-debug-latency-tracing.patch Patch1031: linux-2.6-debug-periodic-slab-check.patch Patch1032: linux-2.6-debug-boot-delay.patch Patch1033: linux-2.6-debug-must_check.patch # Restrict /dev/mem usage. Patch1050: linux-2.6-devmem.patch # Provide read only /dev/crash driver. Patch1060: linux-2.6-crash-driver.patch Patch1070: linux-2.6-sleepon.patch # SCSI bits. Patch1102: linux-2.6-scsi-advansys-pcitable.patch Patch1103: linux-2.6-iscsi-update-to-2-6-18-upstream.patch # NFS bits. Patch1200: linux-2.6-NFSD-non-null-getxattr.patch Patch1201: linux-2.6-NFSD-ctlbits.patch Patch1203: linux-2.6-NFSD-badness.patch # NIC driver updates Patch1301: linux-2.6-net-sundance-ip100A.patch Patch1304: linux-2.6-net-ipw2200-monitor.patch # Squashfs Patch1400: linux-2.6-squashfs.patch # Misc bits. Patch1600: linux-2.6-module_version.patch Patch1610: linux-2.6-input-kill-stupid-messages.patch Patch1620: linux-2.6-serial-tickle-nmi.patch Patch1630: linux-2.6-radeon-backlight.patch Patch1640: linux-2.6-ide-tune-locking.patch Patch1660: linux-2.6-valid-ether-addr.patch Patch1670: linux-2.6-softcursor-persistent-alloc.patch Patch1680: linux-2.6-usb-unusual-devices.patch Patch1690: linux-2.6-autofs-invalidate.patch Patch1700: linux-2.6-w1-hush-debug.patch Patch1710: linux-2.6-sched-up-migration-cost.patch Patch1720: linux-2.6-proc-self-maps-fix.patch Patch1730: linux-2.6-ac97_unregister_controls_ad18xx.patch Patch1740: linux-2.6-softlockup-disable.patch Patch1750: linux-2.6-serial-resume.patch Patch1760: linux-2.6-suspend-slab-warnings.patch Patch1770: linux-2.6-optimise-spinlock-debug.patch Patch1780: linux-2.6-powernow-k7-smp.patch Patch1790: linux-2.6-console-suspend.patch # SELinux/audit patches. Patch1800: linux-2.6-selinux-hush.patch Patch1801: linux-2.6-selinux-mprotect-checks.patch # Warn about usage of various obsolete functionality that may go away. Patch1900: linux-2.6-obsolete-oss-warning.patch # no external module should use these symbols. Patch1910: linux-2.6-unexport-symbols.patch # VM bits. Patch2001: linux-2.6-vm-silence-atomic-alloc-failures.patch Patch2002: linux-2.6-vm-clear-unreclaimable.patch # Tweak some defaults. Patch2100: linux-2.6-defaults-max-symlinks.patch Patch2101: linux-2.6-defaults-fat-utf8.patch Patch2102: linux-2.6-defaults-firmware-loader-timeout.patch Patch2103: linux-2.6-defaults-phys-start.patch Patch2104: linux-2.6-defaults-unicode-vt.patch Patch2105: linux-2.6-defaults-disable-split-ptlock.patch # SATA Bits Patch2200: linux-2.6-sata-promise-pata-ports.patch Patch2201: linux-2.6-sata-silence-dumb-msg.patch Patch2202: linux-2.6-sata-ahci-suspend.patch # ACPI bits Patch2300: linux-2.6-acpi_os_acquire_object-gfp_kernel-called-with-irqs.patch Patch2301: linux-2.6-acpi-ecdt-uid-hack.patch Patch2302: linux-2.6-cpufreq-acpi-sticky.patch # # 10000 to 20000 is for stuff that has to come last due to the # amount of drivers they touch. But only these should go here. # Not patches you're too lazy for to put in the proper place. # Patch10000: linux-2.6-compile-fixes.patch # Little obvious 1-2 liners that fix silly bugs. # Do not add anything non-trivial here. Patch10001: linux-2.6-random-patches.patch # END OF PATCH DEFINITIONS BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root %description The kernel package contains the Linux kernel (vmlinuz), the core of any Linux operating system. The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc. %package devel Summary: Development package for building kernel modules to match the kernel. Group: System Environment/Kernel AutoReqProv: no Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release} Prereq: /usr/bin/find %description devel This package provides kernel headers and makefiles sufficient to build modules against the kernel package. %package doc Summary: Various documentation bits found in the kernel source. Group: Documentation %description doc This package contains documentation files from the kernel source. Various bits of information about the Linux kernel and the device drivers shipped with it are documented in these files. You'll want to install this package if you need a reference to the options that can be passed to Linux kernel modules at load time. %package smp Summary: The Linux kernel compiled for SMP machines. Group: System Environment/Kernel Provides: kernel = %{version} Provides: kernel-drm = 4.3.0 Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}smp Prereq: %{kernel_prereq} Conflicts: %{kernel_dot_org_conflicts} Conflicts: %{package_conflicts} Conflicts: %{nptl_conflicts} # upto and including kernel 2.4.9 rpms, the 4Gb+ kernel was called kernel-enterprise # now that the smp kernel offers this capability, obsolete the old kernel Obsoletes: kernel-enterprise < 2.4.10 # 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 %description smp This package includes a SMP version of the Linux kernel. It is required only on machines with two or more CPUs as well as machines with hyperthreading technology. Install the kernel-smp package if your machine uses two or more CPUs. %package smp-devel Summary: Development package for building kernel modules to match the SMP kernel. Group: System Environment/Kernel Provides: kernel-smp-devel-%{_target_cpu} = %{rpmversion}-%{release} Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}smp Provides: kernel-devel = %{rpmversion}-%{release}smp AutoReqProv: no Prereq: /usr/bin/find %description smp-devel This package provides kernel headers and makefiles sufficient to build modules against the SMP kernel package. %prep # First we unpack the kernel tarball. # If this isn't the first make prep, we use links to the existing clean tarball # which speeds things up quite a bit. if [ ! -d kernel-%{kversion}/vanilla ]; then # Ok, first time we do a make prep. rm -f pax_global_header %setup -q -n %{name}-%{version} -c mv linux-%{kversion} vanilla else # We already have a vanilla dir. cd kernel-%{kversion} if [ -d linux-%{kversion}.%{_target_cpu} ]; then # Just in case we ctrl-c'd a prep already rm -rf deleteme # Move away the stale away, and delete in background. mv linux-%{kversion}.%{_target_cpu} deleteme rm -rf deleteme & fi fi cp -rl vanilla linux-%{kversion}.%{_target_cpu} cd linux-%{kversion}.%{_target_cpu} # Update to latest upstream. %patch1 -p1 # # Patches 10 through 100 are meant for core subsystem upgrades # # # Patches to back out # # # Architecture patches # # # x86(-64) # # Compile 686 kernels tuned for Pentium4. %patch200 -p1 # add vidfail capability; # without this patch specifying a framebuffer on the kernel prompt would # make the boot stop if there's no supported framebuffer device; this is bad # for the installer cd that wants to automatically fall back to textmode # in that case %patch201 -p1 # exitfunc called from initfunc. %patch202 -p1 # Suppress APIC errors on UP x86-64. %patch203 -p1 # Reboot thru bios on HP laptops. %patch204 -p1 # Workaround BIOSes that don't list CPU0 %patch205 -p1 # Reboot through BIOS on HP systems,. %patch206 -p1 # cpu_index >= NR_CPUS becomming always false. %patch207 -p1 # Hush noisy unimplemented 32bit syscalls %patch208 -p1 # Only print info about SMP alternatives on SMP kernels. %patch210 -p1 # # ppc64 # # Find OF framebuffer more reliably %patch302 -p1 # Support the IBM Mambo simulator; core as well as disk and network drivers. %patch305 -p1 # Make HVC console generic; support simulator console device using it. #%patch306 -p1 # Check properly for successful RTAS instantiation %patch314 -p1 # No input layer on iseries %patch317 -p1 # # Patches 500 through 1000 are reserved for bugfixes to the core system # and patches related to how RPMs are build # # This patch adds a "make nonint_oldconfig" which is non-interactive and # also gives a list of missing options at the end. Useful for automated # builds (as used in the buildsystem). %patch800 -p1 # Warn if someone tries to build userspace using kernel headers %patch801 -p1 # Exec shield %patch810 -p1 #%patch813 -p1 # # GPG signed kernel modules # %patch900 -p1 %patch901 -p1 %patch902 -p1 %patch903 -p1 %patch904 -p1 %patch905 -p1 # Tux %patch910 -p1 # # Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems # # Various low-impact patches to aid debugging. %patch1011 -p1 %patch1012 -p1 %patch1013 -p1 %patch1015 -p1 %patch1016 -p1 %patch1017 -p1 %patch1018 -p1 %patch1019 -p1 %patch1020 -p1 %patch1025 -p1 # Slab leak detector. #%patch1027 -p1 # Pause on oops. #%patch1028 -p1 #%patch1029 -p1 #%patch1030 -p1 #%patch1031 -p1 %patch1032 -p1 %patch1033 -p1 # # Make /dev/mem a need-to-know function # %patch1050 -p1 # # /dev/crash driver for the crashdump analysis tool # %patch1060 -p1 # # Most^WAll users of sleep_on are broken; fix a bunch # %patch1070 -p1 # # SCSI Bits. # # Add a pci table to advansys driver. %patch1102 -p1 # iSCSI driver update that can be dropped when kernel is rebased # against a kernel that has the SCSI updates for 2.6.18 %patch1103 -p1 # # Various upstream NFS/NFSD fixes. # #%patch1200 -p1 # kNFSD: fixed '-p port' arg to rpc.nfsd and enables the defining proto versions and transports %patch1201 -p1 # Fix badness. %patch1203 -p1 # NIC driver fixes. # New PCI ID for sundance driver. %patch1301 -p1 # add IPW2200_MONITOR config option %patch1304 -p1 # Squashfs %patch1400 -p1 # # Various SELinux fixes from 2.6.10rc # # Misc fixes # Add missing MODULE_VERSION tags to some modules. %patch1600 -p1 # The input layer spews crap no-one cares about. %patch1610 -p1 # Tickle the NMI whilst doing serial writes. %patch1620 -p1 # Radeon on thinkpad backlight power-management goodness. %patch1630 -p1 # Fix IDE locking bug. %patch1640 -p1 # %patch1660 -p1 # Use persistent allocation in softcursor %patch1670 -p1 # Add some USB devices to the unusual quirk list. %patch1680 -p1 # autofs4 - need to invalidate children on tree mount expire %patch1690 -p1 # Silence debug messages in w1 %patch1700 -p1 # Only print migration info on SMP %patch1710 -p1 # setuid /proc/self/maps fix. %patch1720 -p1 # OLPC ac97 fix. %patch1730 -p1 # Add a safety net to softlockup so that it doesn't prevent installs. %patch1740 -p1 # serial/tty resume fixing. %patch1750 -p1 # Fix up kmalloc whilst atomic warning during resume. %patch1760 -p1 # Speed up spinlock debug. %patch1770 -p1 # Fix up powernow-k7 to work on SMP kernels. %patch1780 -p1 # Console fixes for suspend/resume %patch1790 -p1 # Silence some selinux messages. %patch1800 -p1 # Fix the SELinux mprotect checks on executable mappings %patch1801 -p1 # Warn about obsolete functionality usage. %patch1900 -p1 # Remove kernel-internal functionality that nothing external should use. %patch1910 -p1 # # VM related fixes. # # Silence GFP_ATOMIC failures. %patch2001 -p1 # VM oom killer tweaks. %patch2002 -p1 # Changes to upstream defaults. # Bump up the number of recursive symlinks. %patch2100 -p1 # Use UTF-8 by default on VFAT. %patch2101 -p1 # Increase timeout on firmware loader. %patch2102 -p1 # Change PHYSICAL_START %patch2103 -p1 # Use unicode VT's by default. %patch2104 -p1 # Disable split pagetable lock %patch2105 -p1 # Enable PATA ports on Promise SATA. %patch2200 -p1 # Silence silly SATA printk. %patch2201 -p1 # Fix AHCI Suspend. %patch2202 -p1 # ACPI patches # Silence more ACPI debug spew from suspend. %patch2300 -p1 # acpi-ecdt-uid-hack %patch2301 -p1 # Make acpi-cpufreq sticky. %patch2302 -p1 # # Patches 5000 to 6000 are reserved for new drivers that are about to # be merged upstream # # # final stuff # # # misc small stuff to make things compile or otherwise improve performance # #%patch10000 -p1 # Small 1-2 liners fixing silly bugs that get pushed upstream quickly. %patch10001 -p1 # END OF PATCH APPLICATIONS cp %{SOURCE10} Documentation/ mkdir configs cp -f %{all_arch_configs} . # now run oldconfig over all the config files for i in *.config do mv $i .config Arch=`head -1 .config | cut -b 3-` make ARCH=$Arch nonint_oldconfig > /dev/null echo "# $Arch" > configs/$i cat .config >> configs/$i done # make sure the kernel has the sublevel we know it has. This looks weird # but for -pre and -rc versions we need it since we only want to use # the higher version when the final kernel is released. perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -prep/" Makefile # get rid of unwanted files resulting from patch fuzz cd .. find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null ### ### build ### %build # # Create gpg keys for signing the modules # gpg --homedir . --batch --gen-key %{SOURCE11} gpg --homedir . --export --keyring ./kernel.pub Red > extract.pub make linux-%{kversion}.%{_target_cpu}/scripts/bin2c linux-%{kversion}.%{_target_cpu}/scripts/bin2c ksign_def_public_key __initdata < extract.pub > linux-%{kversion}.%{_target_cpu}/crypto/signature/key.h BuildKernel() { MakeTarget=$1 KernelImage=$2 Flavour=$3 # Pick the right config file for the kernel we're building if [ -n "$Flavour" ] ; then Config=kernel-%{kversion}-%{_target_cpu}-$Flavour.config DevelDir=/usr/src/kernels/%{KVERREL}-$Flavour-%{_target_cpu} DevelLink=/usr/src/kernels/%{KVERREL}$Flavour-%{_target_cpu} else Config=kernel-%{kversion}-%{_target_cpu}.config DevelDir=/usr/src/kernels/%{KVERREL}-%{_target_cpu} DevelLink= fi KernelVer=%{version}-%{release}$Flavour echo BUILDING A KERNEL FOR $Flavour %{_target_cpu}... # make sure EXTRAVERSION says what we want it to say perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}$Flavour/" Makefile # and now to start the build process make -s mrproper cp configs/$Config .config Arch=`head -1 .config | cut -b 3-` echo USING ARCH=$Arch if [ "$KernelImage" == "x86" ]; then KernelImage=arch/$Arch/boot/bzImage fi make -s ARCH=$Arch nonint_oldconfig > /dev/null make -s ARCH=$Arch %{?_smp_mflags} $MakeTarget make -s ARCH=$Arch %{?_smp_mflags} modules || exit 1 # Start installing the results %if "%{_enable_debug_packages}" == "1" mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/boot %endif mkdir -p $RPM_BUILD_ROOT/%{image_install_path} install -m 644 .config $RPM_BUILD_ROOT/boot/config-$KernelVer install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-$KernelVer cp $KernelImage $RPM_BUILD_ROOT/%{image_install_path}/vmlinuz-$KernelVer if [ -f arch/$Arch/boot/zImage.stub ]; then cp arch/$Arch/boot/zImage.stub $RPM_BUILD_ROOT/%{image_install_path}/zImage.stub-$KernelVer || : fi mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer make -s ARCH=$Arch 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) # dirs for additional modules per module-init-tools, kbuild/modules.txt mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/extra mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/updates # 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 .kernelrelease $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/ cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build if [ -d arch/%{_arch}/scripts ]; then cp -a arch/%{_arch}/scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch} || : fi if [ -f arch/%{_arch}/*lds ]; then cp -a arch/%{_arch}/*lds $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/%{_arch}/ || : fi 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 keys linux math-emu media mtd net pcmcia rdma rxrpc scsi sound video asm asm-generic $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include cp -a `readlink asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include if [ "$Arch" = "x86_64" ]; then cp -a asm-i386 $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include fi # While arch/powerpc/include/asm is still a symlink to the old # include/asm-ppc{64,} directory, include that in kernel-devel too. if [ "$Arch" = "powerpc" -a -r ../arch/powerpc/include/asm ]; then cp -a `readlink ../arch/powerpc/include/asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/$Arch/include pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/arch/$Arch/include ln -sf ../../../include/asm-ppc* asm popd fi # 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 # %if "%{_enable_debug_packages}" == "1" mkdir -p $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer cp vmlinux $RPM_BUILD_ROOT/usr/lib/debug/lib/modules/$KernelVer %endif find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f >modnames # gpg sign the modules %if %{signmodules} gcc -o scripts/modsign/mod-extract scripts/modsign/mod-extract.c -Wall KEYFLAGS="--no-default-keyring --homedir .." KEYFLAGS="$KEYFLAGS --secret-keyring ../kernel.sec" KEYFLAGS="$KEYFLAGS --keyring ../kernel.pub" export KEYFLAGS for i in `cat modnames` do sh ./scripts/modsign/modsign.sh $i Red mv -f $i.signed $i done unset KEYFLAGS %endif # mark modules executable so that strip-to-file can strip them cat modnames | xargs chmod u+x # detect missing or incorrect license tags for i in `cat modnames` 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 rm -f modnames # remove files that will be auto generated by depmod at rpm -i time rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.* # Move the devel headers out of the root file system mkdir -p $RPM_BUILD_ROOT/usr/src/kernels mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build [ -z "$DevelLink" ] || ln -sf `basename $DevelDir` $RPM_BUILD_ROOT/$DevelLink } ### # DO it... ### # prepare directories rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/boot cd linux-%{kversion}.%{_target_cpu} %if %{buildup} BuildKernel %make_target %kernel_image %endif %if %{buildsmp} BuildKernel %make_target %kernel_image smp %endif ### ### install ### %install cd linux-%{kversion}.%{_target_cpu} %if %{builddoc} mkdir -p $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion}/Documentation # sometimes non-world-readable files sneak into the kernel source tree chmod -R a+r * # copy the source over tar cf - Documentation | tar xf - -C $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion} %endif ### ### 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 smp /sbin/modprobe loop 2> /dev/null > /dev/null || : exit 0 %post if [ `uname -i` == "x86_64" ]; then if [ -f /etc/sysconfig/kernel ]; then /bin/sed -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel fi fi [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release} /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install %{KVERREL} %post devel [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] ; then pushd /usr/src/kernels/%{KVERREL}-%{_target_cpu} > /dev/null /usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ; done popd > /dev/null fi %post smp [ ! -x /usr/sbin/module_upgrade ] || /usr/sbin/module_upgrade %{rpmversion}-%{release}smp /sbin/new-kernel-pkg --package kernel-smp --mkinitrd --depmod --install %{KVERREL}smp %post smp-devel [ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] ; then pushd /usr/src/kernels/%{KVERREL}-smp-%{_target_cpu} > /dev/null /usr/bin/find . -type f | while read f; do hardlink -c /usr/src/kernels/*FC*/$f $f ; done popd > /dev/null fi %preun /sbin/modprobe loop 2> /dev/null > /dev/null || : /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL} %preun smp /sbin/modprobe loop 2> /dev/null > /dev/null || : /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}smp ### ### file lists ### %if %{buildup} %files %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL} /boot/System.map-%{KVERREL} /boot/config-%{KVERREL} %dir /lib/modules/%{KVERREL} /lib/modules/%{KVERREL}/kernel /lib/modules/%{KVERREL}/build /lib/modules/%{KVERREL}/source /lib/modules/%{KVERREL}/extra /lib/modules/%{KVERREL}/updates %files devel %defattr(-,root,root) %verify(not mtime) /usr/src/kernels/%{KVERREL}-%{_target_cpu} %endif %if %{buildsmp} %files smp %defattr(-,root,root) /%{image_install_path}/vmlinuz-%{KVERREL}smp /boot/System.map-%{KVERREL}smp /boot/config-%{KVERREL}smp %dir /lib/modules/%{KVERREL}smp /lib/modules/%{KVERREL}smp/kernel /lib/modules/%{KVERREL}smp/build /lib/modules/%{KVERREL}smp/source /lib/modules/%{KVERREL}smp/extra /lib/modules/%{KVERREL}smp/updates %files smp-devel %defattr(-,root,root) %verify(not mtime) /usr/src/kernels/%{KVERREL}-smp-%{_target_cpu} /usr/src/kernels/%{KVERREL}smp-%{_target_cpu} %endif # only some architecture builds need kernel-doc %if %{builddoc} %files doc %defattr(-,root,root) %{_datadir}/doc/kernel-doc-%{kversion}/Documentation/* %dir %{_datadir}/doc/kernel-doc-%{kversion}/Documentation %dir %{_datadir}/doc/kernel-doc-%{kversion} %endif %changelog * Tue Jul 11 2006 Dave Jones [2.6.17-1.2142_FC4] - 2.6.17.4 - Disable split pagetable lock. * Wed Jul 5 2006 Dave Jones - Get rid of stack backtrace on panic, which in most cases actually caused a loss of info instead of a gain. * Fri Jun 30 2006 Dave Jones [2.6.17-1.2141_FC4] - 2.6.17.3 * Fri Jun 30 2006 Dave Jones [2.6.17-1.2140_FC4] - 2.6.17.2 - Fix up the alsa list_add bug. * Mon Jun 26 2006 Dave Jones - Fix up various stupidities incurred by the last big rebase. - Reenable SMP x86-64 builds. - Reenable SMBFS. - Enable PCI fake hotplug driver. - Enable gameport/joystick on i586 builds. (#196581) * Sat Jun 24 2006 Dave Jones - Enable profiling for 586 kernels. * Fri Jun 23 2006 Dave Jones [2.6.17-1.2139_FC4] - Rebuild with slab debug off. * Tue Jun 20 2006 Dave Jones [2.6.17-1.2138_FC4] - 2.6.17.1 * Mon Jun 5 2006 Dave Jones [2.6.16-1.2115_FC4] - 2.6.16.20 * Tue May 30 2006 Dave Jones [2.6.16-1.2114_FC4] - 2.6.16.19 * Mon May 29 2006 Dave Jones [2.6.16-1.2113_FC4] - Improved list_head debugging. * Tue May 23 2006 Dave Jones [2.6.16-1.2112_FC4] - 2.6.16.18 * Sat May 20 2006 Dave Jones [2.6.16-1.2111_FC4] - 2.6.16.17 * Wed May 10 2006 Dave Jones [2.6.16-1.2110_FC4] - 2.6.16.16 * Tue May 9 2006 Dave Jones [2.6.16-1.2109_FC4] - 2.6.16.15 - make 16C950 UARTs work (again). (#126403) - Fix exec-shield default, which should fix a few programs that stopped running. * Thu May 4 2006 Dave Jones [2.6.16-1.2108_FC4] - 2.6.16.14 * Tue May 2 2006 Dave Jones [2.6.16-1.2107_FC4] - 2.6.16.13 * Mon May 1 2006 Dave Jones - 2.6.16.12 * Tue Apr 25 2006 Dave Jones - Fix up SCSI errors with mymusix usb mp3 player (#186187) * Mon Apr 24 2006 Dave Jones - 2.6.16.11 * Wed Apr 19 2006 Dave Jones - Enable PCI MSI support. * Tue Apr 18 2006 Dave Jones [2.6.16-1.2096_FC4] - 2.6.16.9 * Tue Apr 18 2006 Dave Jones [2.6.16-1.2093_FC4] - 2.6.16.7 * Mon Apr 17 2006 Dave Jones [2.6.16-1.2092_FC4] - 2.6.16.6 * Sun Apr 16 2006 Dave Jones - 2.6.16.5 * Fri Apr 7 2006 Dave Jones - 2.6.16.2 * Tue Apr 4 2006 Dave Jones - Reenable non-standard serial ports. (#187466) - Reenable snd-es18xx for x86-32 (#187733) * Thu Mar 30 2006 Dave Jones - ship the .kernelrelease file in -devel too. - Disable EDAC debug. * Tue Mar 26 2006 Dave Jones [2.6.16-1.2069_FC4] - 2.6.16.1 * Mon Mar 25 2006 Dave Jones - Include patches posted for review for inclusion in 2.6.16.1 - Updated new audit msg types. - Reenable HDLC driver (#186257) - Make acpi-cpufreq 'sticky' - Fix broken x86-64 32bit vDSO (#186924) * Tue Mar 21 2006 Dave Jones - Improve spinlock scalability on big machines. * Mon Mar 20 2006 Dave Jones - Sync with FC5's 2.6.16 kernel. - Update Tux & Exec-shield to latest.