#!/bin/sh RPM_SOURCE_DIR="/usr/src/redhat/SOURCES" RPM_BUILD_DIR="/usr/src/redhat/BUILD" RPM_OPT_FLAGS="-O2 -g -pipe -m32 -march=i686 -mtune=pentium4" RPM_ARCH="i386" RPM_OS="linux" export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_DOC_DIR="/usr/share/doc" export RPM_DOC_DIR RPM_PACKAGE_NAME="kernel" RPM_PACKAGE_VERSION="2.6.10" RPM_PACKAGE_RELEASE="1.766_FC3.root" export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE RPM_BUILD_ROOT="/var/tmp/kernel-2.6.10-1.766_FC3.root-root" export RPM_BUILD_ROOT set -x umask 022 cd /usr/src/redhat/BUILD LANG=C export LANG unset DISPLAY cd /usr/src/redhat/BUILD rm -rf kernel-2.6.10 /bin/mkdir -p kernel-2.6.10 cd kernel-2.6.10 /usr/bin/bzip2 -dc /usr/src/redhat/SOURCES/linux-2.6.10.tar.bz2 | tar -xf - STATUS=$? if [ $STATUS -ne 0 ]; then exit $STATUS fi [ `/usr/bin/id -u` = '0' ] && /bin/chown -Rhf root . [ `/usr/bin/id -u` = '0' ] && /bin/chgrp -Rhf root . /bin/chmod -Rf a+rX,u+w,g-w,o-w . cd linux-2.6.10 # # Patches 0 through 100 are meant for core subsystem upgrades # #%patch1 -p1 echo "Patch #2 (patch-2.6.10-ac12.bz2):" /usr/bin/bzip2 -d < /usr/src/redhat/SOURCES/patch-2.6.10-ac12.bz2 | patch -p1 -s STATUS=$? if [ $STATUS -ne 0 ]; then exit $STATUS fi # # Patches to back out # # # Architecture patches # # # x86(-64) # # x86_64: Reenable MGA DRI echo "Patch #208 (linux-2.6.9-x86_64-mga-dri.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-x86_64-mga-dri.patch # Fix x87 fnsave Tag Word emulation when using FXSR (SSE) echo "Patch #209 (linux-2.6.10-x86-fxsr-tagword-emulation.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-x86-fxsr-tagword-emulation.patch # Flexible mmap patch for x86-64 echo "Patch #210 (linux-2.6.9-x86_64-flexmmap.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-x86_64-flexmmap.patch # Fix wrong TASK_SIZE on x86_64 for 32bit processes echo "Patch #211 (linux-2.6.9-x86_64-task_size-32bit.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-x86_64-task_size-32bit.patch # # ppc64 # # Patch for Kconfig and Makefile build issues echo "Patch #300 (linux-2.6.2-ppc64-build.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.2-ppc64-build.patch echo "Patch #301 (linux-2.6.8-ppc64-netboot.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.8-ppc64-netboot.patch # Fix IBM VSCSI problems echo "Patch #306 (linux-2.6.9-ppc64-vscsi.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ppc64-vscsi.patch # IBM VSCSI driver race fix echo "Patch #317 (linux-2.6.9-ppc64-ibmvscsi-race-fix.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ppc64-ibmvscsi-race-fix.patch # Convert to using ibm,read-slot-reset-state2 RTAS call echo "Patch #320 (linux-2.6.9-ppc64-eeh-reset-state2.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ppc64-eeh-reset-state2.patch # # ia64 # # Basic build fixes echo "Patch #330 (linux-2.6.3-ia64-build.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.3-ia64-build.patch # # s390 # # Basic build fixes echo "Patch #350 (linux-2.6.1-s390-compile.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.1-s390-compile.patch # Auto raidstart for S390 echo "Patch #351 (linux-2.6.9-s390-autoraid.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-s390-autoraid.patch # Recover after aborted nameserver request. echo "Patch #353 (linux-2.6.9-s390-zfcp_port-fix.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-s390-zfcp_port-fix.patch # Support broadcast on z800/z900 HiperSockets echo "Patch #360 (linux-2.6.9-s390-qeth_hipersocket-fix.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-s390-qeth_hipersocket-fix.patch # # sparc/sparc64 # echo "Patch #400 (linux-2.6.3-sparc-addbzimage.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.3-sparc-addbzimage.patch # # 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). echo "Patch #500 (linux-2.4.0-nonintconfig.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.4.0-nonintconfig.patch # # The execshield patch series, broken into smaller pieces # # 1) Exec shield core echo "Patch #511 (linux-2.6.0-exec-shield.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.0-exec-shield.patch # 2) Option to printk fatal signals, useful for debugging echo "Patch #512 (linux-2.6.8-print-fatal-signals.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.8-print-fatal-signals.patch # 3) The Execshield VA rearrangements echo "Patch #513 (linux-2.6.8-execshield-vaspace.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.8-execshield-vaspace.patch # # Patch that adds a __must_check attribute for functions for which checking # the return value is mantadory (eg copy_from_user) # echo "Patch #530 (linux-2.6.0-must_check.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.0-must_check.patch # # GPG signed kernel modules # echo "Patch #600 (linux-2.6.7-modsign-core.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-core.patch echo "Patch #601 (linux-2.6.7-modsign-crypto.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-crypto.patch echo "Patch #602 (linux-2.6.7-modsign-ksign.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-ksign.patch echo "Patch #603 (linux-2.6.7-modsign-mpilib.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-mpilib.patch echo "Patch #604 (linux-2.6.7-modsign-script.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-script.patch echo "Patch #605 (linux-2.6.7-modsign-include.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-modsign-include.patch echo "Patch #606 (linux-2.6.9-sha1.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-sha1.patch # Tux echo "Patch #700 (linux-2.6.10-tux.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-tux.patch # # Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems # # 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 echo "Patch #1000 (linux-2.4.0-test11-vidfail.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.4.0-test11-vidfail.patch # Periodically scan slab caches for corruption. echo "Patch #1010 (linux-2.6.10-periodic-slab-debug.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-periodic-slab-debug.patch # # Fix the extreme stack usage in some kernel functions # echo "Patch #1020 (linux-2.6.4-stackusage.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.4-stackusage.patch # EXT3 bits. # improves ext3's error logging when we encounter an on-disk corruption. echo "Patch #1032 (linux-2.6.9-ext3-cleanup-abort.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ext3-cleanup-abort.patch # improves ext3's ability to deal with corruption on-disk echo "Patch #1034 (linux-2.6.9-ext3-handle-bitmapdel.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ext3-handle-bitmapdel.patch # Handle double-delete of indirect blocks echo "Patch #1035 (linux-2.6.9-ext3-handle-double-revoke.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ext3-handle-double-revoke.patch # Fix xattr/mbcache race echo "Patch #1036 (linux-2.6.9-ext2-mbcache.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ext2-mbcache.patch echo "Patch #1037 (linux-2.6.9-ext3-mbcache.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ext3-mbcache.patch # # Make /dev/mem a need-to-know function # echo "Patch #1050 (linux-2.6.7-devmem.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.7-devmem.patch echo "Patch #1051 (linux-2.6.0-devmem.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.0-devmem.patch # # /dev/crash driver for the crashdump analysis tool # echo "Patch #1060 (linux-2.6.3-crash-driver.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.3-crash-driver.patch # netconsole/netdump echo "Patch #1061 (linux-2.6.10-crashdump-common.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-crashdump-common.patch echo "Patch #1062 (linux-2.6.10-netdump.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-netdump.patch echo "Patch #1063 (linux-2.6.8-netconsole.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.8-netconsole.patch echo "Patch #1064 (linux-2.6.10-diskdump.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-diskdump.patch # # Most^WAll users of sleep_on are broken; fix a bunch # echo "Patch #1070 (linux-2.6.0-sleepon.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.0-sleepon.patch # # SCSI Bits. # # Enable both new and old megaraid drivers. echo "Patch #1136 (linux-2.6.9-scsi-megaraid-legacy.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-scsi-megaraid-legacy.patch # Block / MD layer fixes. # CCISS ID updates echo "Patch #1146 (linux-2.6.9-block-cciss-id-updates.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-block-cciss-id-updates.patch # # Various upstream NFS/NFSD fixes. # echo "Patch #1201 (linux-2.6.9-NFSD-non-null-getxattr.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-NFSD-non-null-getxattr.patch echo "Patch #1205 (linux-2.6.9-NFS-cthon-rename.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-NFS-cthon-rename.patch echo "Patch #1207 (linux-2.6.8-lockd-racewarn2.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.8-lockd-racewarn2.patch echo "Patch #1209 (linux-2.6.9-lockd-block-nosleep.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-lockd-block-nosleep.patch echo "Patch #1210 (linux-2.6.9-lockd-reclaims.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-lockd-reclaims.patch echo "Patch #1211 (linux-2.6.10-lockd-fixup_nlm_auth.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-lockd-fixup_nlm_auth.patch # NIC driver fixes. # Workaround for the E1000 erratum 23 echo "Patch #1358 (linux-2.6.9-net-e1000-erratum23.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-net-e1000-erratum23.patch # Workaround E1000 post-maturely writing back to TX descriptors echo "Patch #1359 (linux-2.6.9-net-e1000-post-mature-writeback.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-net-e1000-post-mature-writeback.patch # E1000 64k-alignment fix echo "Patch #1361 (linux-2.6.9-net-e1000-64k-align-check-dma.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-net-e1000-64k-align-check-dma.patch # NULL out ptrs in airo after kfree'ing them. echo "Patch #1362 (linux-2.6.9-net-airo-nullptr.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-net-airo-nullptr.patch # Use both schemes of USB initialisation. echo "Patch #1400 (linux-2.6.10-usb-use_both_schemes.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-usb-use_both_schemes.patch # # Various SELinux fixes from 2.6.10rc # echo "Patch #1605 (linux-2.6.9-selinux-avc-rcu.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-selinux-avc-rcu.patch # SELinux xattr for tmpfs (from 2.6.9-mm) echo "Patch #1609 (linux-2.6.9-selinux-avc_update_node-spinlock-oops.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-selinux-avc_update_node-spinlock-oops.patch # Misc fixes # Add missing MODULE_VERSION tags to some modules. echo "Patch #1760 (linux-2.6.9-module_version.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-module_version.patch # Make spinlock debugging panic instead of continue. echo "Patch #1910 (linux-2.6.9-spinlock-debug-panic.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-spinlock-debug-panic.patch # Add another ipod to the unusual usb devices echo "Patch #1960 (linux-2.6.9-usb-ipod-unusual.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-usb-ipod-unusual.patch # drop patch that caused lots of invalid param problems in the module loader. echo "Patch #1970 (linux-2.6.10-revert-module-invalidparam.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-revert-module-invalidparam.patch # # VM related fixes. # # VM pageout throttling. echo "Patch #2002 (linux-2.6.9-vm-pageout-throttling.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-vm-pageout-throttling.patch # Extra debugging on OOM Kill. echo "Patch #2003 (linux-2.6.9-vm-oomkiller-debugging.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-vm-oomkiller-debugging.patch # Print tainted info on various mm related functions. echo "Patch #2004 (linux-2.6.10-vm-taint.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.10-vm-taint.patch # # Local hack (off for any shipped kernels) to printk all files opened # the first 180 seconds after boot for debugging userspace startup # speeds # # %patch2999 -p1 # # External drivers that are about to get accepted upstream # # Intel wireless echo "Patch #3020 (linux-2.6.9-ipw2100.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ipw2100.patch echo "Patch #3021 (linux-2.6.9-ipw2200.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ipw2200.patch echo "Patch #3022 (linux-2.6.9-ieee80211.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.9-ieee80211.patch # # 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 # echo "Patch #10000 (linux-2.6.0-compile.patch):" patch -p1 -s < /usr/src/redhat/SOURCES/linux-2.6.0-compile.patch # Void Main echo "Patch #30000 (linux-2.6.10-mppe-mppc-1.2.patch.gz):" /usr/bin/gzip -d < /usr/src/redhat/SOURCES/linux-2.6.10-mppe-mppc-1.2.patch.gz | patch -p1 -s STATUS=$? if [ $STATUS -ne 0 ]; then exit $STATUS fi # END OF PATCH APPLICATIONS cp /usr/src/redhat/SOURCES/COPYING.modules Documentation/ mkdir configs cp -fv $RPM_SOURCE_DIR/kernel-2.6.10-i?86*.config . # now run oldconfig over all the config files for i in *.config do mv $i .config make ARCH=`echo $i | cut -d"-" -f3 | cut -d"." -f1 | sed -e s/i.86/i386/ -e s/s390x/s390/ -e s/ppc64.series/ppc64/ ` nonint_oldconfig > /dev/null cp .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 = 10/" Makefile perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -prep/" Makefile # get rid of unwanted files resulting from patch fuzz find . -name "*.orig" -exec rm -fv {} \; find . -name "*~" -exec rm -fv {} \; ### ### build ### exit 0