]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - lfs/linux
Add Huawei Android usbid's to option driver.
[people/pmueller/ipfire-2.x.git] / lfs / linux
index b69e50e6a2c94158b75907d843f44fd7146d7757..5d27158f06662b5ce454d3a981f58b7f13a3a210 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -1,22 +1,20 @@
 ###############################################################################
-# This file is part of the IPCop Firewall.                                    #
 #                                                                             #
-# IPCop is free software; you can redistribute it and/or modify               #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation; either version 2 of the License, or           #
+# the Free Software Foundation, either version 3 of the License, or           #
 # (at your option) any later version.                                         #
 #                                                                             #
-# IPCop is distributed in the hope that it will be useful,                    #
+# This program is distributed in the hope that it will be useful,             #
 # but WITHOUT ANY WARRANTY; without even the implied warranty of              #
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
 # GNU General Public License for more details.                                #
 #                                                                             #
 # You should have received a copy of the GNU General Public License           #
-# along with IPCop; if not, write to the Free Software                        #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA    #
-#                                                                             #
-# Makefiles are based on LFSMake, which is                                    #
-# Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com>                        #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
 #                                                                             #
 ###############################################################################
 
 
 include Config
 
-VER        = 2.4.32
+PATCHLEVEL = .15
+VER        = 2.6.32.15
 
 THISAPP    = linux-$(VER)
-DL_FILE    = $(THISAPP).tar.gz
+DL_FILE    = $(THISAPP).tar.bz2
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 CFLAGS     =
 CXXFLAGS   =
 
-# Normal build or /tools build.
+PROG      = linux-xen
+PAK_VER    = 10
+DEPS      = ""
+
+# Normal build or XEN build.
 #
-ifeq "$(ROOT)" ""
-ifeq "$(LFS_PASS)" "ipfire"
-ifeq "$(SMP)" ""
-  TARGET = $(DIR_INFO)/$(THISAPP)-ipfire
-endif
-ifeq "$(SMP)" "1"
-  TARGET = $(DIR_INFO)/$(THISAPP)-ipfire-smp
-endif
-ifeq "$(SMP)" "installer"
-  TARGET = $(DIR_INFO)/$(THISAPP)-ipfire-installer
-endif
-else
-  TARGET = $(DIR_INFO)/$(THISAPP)
-endif
+
+ifeq "$(XEN)" "1"
+       VERSUFIX=ipfire-xen
 else
-  TARGET = $(DIR_INFO)/$(THISAPP)-tools
+       VERSUFIX=ipfire
 endif
 
+TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
 objects =$(DL_FILE) \
-       openswan-1.0.10rc2.tar.gz \
-       iptables-1.3.5.tar.bz2 \
-       patch-o-matic-ng-20060206.tar.bz2 \
-       kbc_option_2420.patch \
-       net4801.kernel.patch_2.4.31 \
-       netfilter-layer7-v2.1.tar.gz
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-openswan-1.0.10rc2.tar.gz              = $(URL_IPFIRE)/openswan-1.0.10rc2.tar.gz
-patch-o-matic-ng-20060206.tar.bz2      = $(URL_IPFIRE)/patch-o-matic-ng-20060206.tar.bz2
-iptables-1.3.5.tar.bz2                 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
-kbc_option_2420.patch                   = $(URL_IPFIRE)/kbc_option_2420.patch
-net4801.kernel.patch_2.4.31             = $(URL_IPFIRE)/net4801.kernel.patch_2.4.31
-netfilter-layer7-v2.1.tar.gz           = $(URL_IPFIRE)/netfilter-layer7-v2.1.tar.gz
-#bootsplash-3.0.7-2.4.31-vanilla.diff  = $(URL_IPFIRE)/bootsplash-3.0.7-2.4.31-vanilla.diff
-
-$(DL_FILE)_MD5                         = f01163f627f47030a50dab6976df2eb7
-openswan-1.0.10rc2.tar.gz_MD5          = 20d51ff963da78f826f4e0f0ebc4bcef
-patch-o-matic-ng-20060206.tar.bz2_MD5  = eca9893afb753e331caddfe63142b566
-iptables-1.3.5.tar.bz2_MD5             = 00fb916fa8040ca992a5ace56d905ea5
-kbc_option_2420.patch_MD5               = 6d37870344f7fcf97ace1fbf43323c60
-net4801.kernel.patch_2.4.31_MD5         = c7d64e3caedb2f2b10e1c11db7f73a04
-netfilter-layer7-v2.1.tar.gz_MD5       = 551626a158c2a2cbfd937d27ecc7fac1
-#bootsplash-3.0.7-2.4.31-vanilla.diff    = 767c263d1d28827d51abc83945e4b893
+       netfilter-layer7-v2.22.tar.gz \
+       patch-2.6.16-nath323-1.3.bz2 \
+       reiser4-for-2.6.32.patch.bz2 \
+       squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 \
+       xen-patches-2.6.32-2.tar.bz2
+
+$(DL_FILE)                             = $(URL_IPFIRE)/$(DL_FILE)
+netfilter-layer7-v2.22.tar.gz          = $(URL_IPFIRE)/netfilter-layer7-v2.22.tar.gz
+patch-2.6.16-nath323-1.3.bz2           = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
+reiser4-for-2.6.32.patch.bz2           = $(URL_IPFIRE)/reiser4-for-2.6.32.patch.bz2
+squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 = $(URL_IPFIRE)/squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2
+xen-patches-2.6.32-2.tar.bz2           = $(URL_IPFIRE)/xen-patches-2.6.32-2.tar.bz2
+
+$(DL_FILE)_MD5                         = 1cbbf16e93bbe03368172872690600c0
+netfilter-layer7-v2.22.tar.gz_MD5      = 98dff8a3d5a31885b73341633f69501f
+patch-2.6.16-nath323-1.3.bz2_MD5       = f926409ff703a307baf54b57ab75d138
+reiser4-for-2.6.32.patch.bz2_MD5       = 3246397973d9271eb8e6d7c97c5d2d91
+squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2_MD5 = d2a84311081023c7ffd28cdca67c45d4
+xen-patches-2.6.32-2.tar.bz2_MD5       = d1d78d2e9b9b62dd869a490f4415de04
 
 install : $(TARGET)
 
@@ -92,6 +81,8 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
 
 md5 : $(subst %,%_MD5,$(objects))
 
+dist:
+       @$(PAK)
 ###############################################################################
 # Downloading, checking, md5sum
 ###############################################################################
@@ -111,177 +102,110 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_SRC) && ln -sf linux-$(VER) linux
-       cd $(DIR_APP) && sed -i -e 's/-Werror//' drivers/scsi/aic7xxx/Makefile
-
-       # Openswan
-       cd $(DIR_SRC) && rm -rf openswan-*
-       cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-1.0.10.tar.gz
-       cd $(DIR_SRC)/openswan-1.0.10 && patch -Np1 < $(DIR_SRC)/src/patches/openswan-1.0.1-plutoctl.patch
-       cd $(DIR_SRC)/openswan-1.0.10 && patch -Np1 < $(DIR_SRC)/src/patches/openswan-1.0.6-numif.patch
-       cd $(DIR_SRC)/openswan-1.0.10 && sed -i 's+^KERNELSRC.*$$+KERNELSRC=$(ROOT)/usr/src/linux-$(VER)+' Makefile.inc
-       cd $(DIR_SRC)/openswan-1.0.10 && sed -i -e 's/local\/sbin/local\/sbin:\/tools\/bin/' utils/patcher
-       cd $(DIR_SRC)/openswan-1.0.10 && make insert
-
-       # Patch-o-matic
-       cd $(DIR_SRC) && rm -rf iptables-*
-       cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2 
-       cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables
-       cd $(DIR_SRC) && rm -rf patch-o-matic*
-       cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20060206.tar.bz2
-
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ pending
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ base
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ h323-conntrack-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ cuseeme-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ mms-conntrack-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ pptp-conntrack-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ rtsp-conntrack
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ quake3-conntrack-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ sip-conntrack-nat
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ip_queue_vwmark
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ipp2p
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ipsec-01-output-hooks
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ipsec-02-input-hooks
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ipsec-03-policy-lookup
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ ipsec-04-policy-checks
-       cd $(DIR_SRC)/patch-o-matic* && yes 'y' | ./runme --kernel-path=$(ROOT)/usr/src/linux/ --iptables-path=$(ROOT)/usr/src/iptables/ TARPIT
-
-       #imq-patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.4.28-imq2.diff
-       
-       #layer7-patch
-       cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.1.tar.gz
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.1/kernel-2.4-layer7-2.1.patch
-
-       # ip_conntrack permissions from 440 to 444
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
-
-ifeq "$(SMP)" ""
-       # Only do this once on the non-SMP pass
-       cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5
+       @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/linux-*-suse_xen_patches $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+
+       ln -s linux-$(VER) /usr/src/linux
+
+ifeq "$(XEN)" "1"
+       # Apply gentoo Xen patches
+       mkdir -p $(DIR_SRC)/xen-patches
+       cd $(DIR_SRC)/xen-patches && tar jxf $(DIR_DL)/xen-patches-2.6.32-2.tar.bz2
+
+       for x in `ls -1 $(DIR_SRC)/xen-patches/*.patch1`; do \
+               echo "*********** [Patch: $$x]"; \
+               cd $(DIR_APP) && pwd && patch -Np1 < $$x || exit 1; \
+       done
+       rm -rf $(DIR_SRC)/xen-patches
+
+       # Linux Intermediate Queueing Device
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-imq-test2.patch
+else
+       # Linux Intermediate Queueing Device
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-imq-test2.patch
 endif
 
-       # Olitec isdn gazel patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/linux-2.4.23-olitec-isdn.patch
+       # Not report deprecated syscall 1.23 (for kudzu)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
 
-       # Fix /proc/stat output
-       cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/linux-2.4.26-proc-stat.patch
+       # Reiser4 (don't check if fail (some patches are already in xen patchset)
+       -cd $(DIR_APP) && bzcat $(DIR_DL)/reiser4-for-2.6.32.patch.bz2 | patch -Np1
 
-       # Fix libata-core.c
-       # cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/linux-2.4.26-scsi.patch
+       # ipp2p 0.8.2-pomng
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-ipp2p-0.8.2-pomng.patch
 
-       # frandom patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.4.27-frandom-2.patch
+       # Layer7-patch
+       cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.22
+       cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.22.tar.gz
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch
 
-       # Propolice
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.4.27-ssp-1.patch
+       # Squashfs LZMA support
+       cd $(DIR_APP) && bzcat $(DIR_DL)/squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 | patch -Np1
 
-       # Support ppp-2.4.3 multilink behavior (terminate when no channel is connected)
-       # need updated libpcap older than 0.8.3
-       # cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ppp_generic-ppp-2.4.3_multilink.patch
+       # Add some more LED triggers
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.11-netdev-1.patch
 
-       # R8169 clone D-link GSE-528T
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.4.29_r8169clone.patch
+       # Huawei (Vodafone) K3765 & K4505 Usbids
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.11-option_add_vodafone_usbids.patch
 
-       # bootsplash
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bootsplash-3.0.7-2.4.31-vanilla.diff
+       # Huawei Android Phones (Vodafone V845, T-Mobile Pulse/mini ...)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.15-option_add_huawei_android.patch
 
        # Cleanup kernel source
-       cd $(DIR_APP) && make mrproper
-ifeq "$(ROOT)" ""
-ifeq "$(LFS_PASS)" "ipfire"
-ifeq "$(SMP)" ""
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
-endif
-ifeq "$(SMP)" "1"
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
-endif
-ifeq "$(SMP)" "installer"
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).installer $(DIR_APP)/.config
-       cd $(DIR_APP) && sed -i -e 's/-O2/-Os/g' Makefile
-endif
 
+       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
        cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
-       cd $(DIR_APP) && make CC="$(KGCC)" dep
        cd $(DIR_APP) && make CC="$(KGCC)" clean
-       if [ "$(MACHINE)" = "i386" -a "$(SMP)" = "" ]; then \
-               cd $(DIR_APP) && make -j 3 CC="$(KGCC)" bzImage; \
-               cd $(DIR_APP) && cp arch/$(MACHINE)/boot/bzImage /boot/vmlinuz-$(VER); \
-               cd $(DIR_APP) && cp System.map /boot/System.map-$(VER); \
-               ln -sf vmlinuz-$(VER) /boot/vmlinuz; \
-               ln -sf System.map-$(VER) /boot/System.map; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules_install; \
-       elif [ "$(MACHINE)" = "i386" -a "$(SMP)" = "1" ]; then \
-               cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =/EXTRAVERSION\ =\ -smp/' Makefile; \
-               cd $(DIR_APP) && make -j 3 CC="$(KGCC)" bzImage; \
-               cd $(DIR_APP) && cp arch/$(MACHINE)/boot/bzImage /boot/vmlinuz-$(VER)-smp; \
-               cd $(DIR_APP) && cp System.map /boot/System.map-$(VER)-smp; \
-               ln -sf vmlinuz-$(VER)-smp /boot/vmlinuz-smp; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules_install; \
-       elif [ "$(MACHINE)" = "i386" -a "$(SMP)" = "installer" ]; then \
-               cd $(DIR_APP) && make -j 3 CC="$(KGCC)" bzImage; \
-               cd $(DIR_APP) && cp arch/$(MACHINE)/boot/bzImage /boot/vmlinuz-installer; \
-       elif [ "$(MACHINE)" = "alpha" ]; then \
-               cd $(DIR_APP) && make -j 3 CC="$(KGCC)" vmlinux; \
-               cd $(DIR_APP) && gzip -9c vmlinux > /boot/vmlinuz-$(VER); \
-               cd $(DIR_APP) && cp System.map /boot/System.map-$(VER); \
-               ln -sf vmlinuz-$(VER) /boot/vmlinuz; \
-               ln -sf System.map-$(VER) /boot/System.map; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules; \
-               cd $(DIR_APP) && make CC="$(KGCC)" modules_install; \
-       fi
-       # remove symlinked pcmcia directory
-ifeq "$(SMP)" ""
-       rm -rf /lib/modules/$(VER)/pcmcia
-       find /lib/modules/$(VER)/ -name '*.o' -a -type f | xargs gzip -f9
-
-       # Move these SCSI drivers into same directory for probescsi.sh
-       mv -f  /lib/modules/$(VER)/kernel/drivers/scsi/aic7xxx/*     /lib/modules/$(VER)/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)/kernel/drivers/scsi/aic7xxx
-       mv -f  /lib/modules/$(VER)/kernel/drivers/scsi/aacraid/*     /lib/modules/$(VER)/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)/kernel/drivers/scsi/aacraid
-       mv -f  /lib/modules/$(VER)/kernel/drivers/scsi/sym53c8xx_2/* /lib/modules/$(VER)/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)/kernel/drivers/scsi/sym53c8xx_2
-endif
-ifeq "$(SMP)" "1"
-       rm -rf /lib/modules/$(VER)-smp/pcmcia
-       find /lib/modules/$(VER)-smp/ -name '*.o' -a -type f | xargs gzip -f9
-
-       # Move these SCSI drivers into same directory for probescsi.sh
-       mv -f  /lib/modules/$(VER)-smp/kernel/drivers/scsi/aic7xxx/*     /lib/modules/$(VER)-smp/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)-smp/kernel/drivers/scsi/aic7xxx
-       mv -f  /lib/modules/$(VER)-smp/kernel/drivers/scsi/aacraid/*     /lib/modules/$(VER)-smp/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)-smp/kernel/drivers/scsi/aacraid
-       mv -f  /lib/modules/$(VER)-smp/kernel/drivers/scsi/sym53c8xx_2/* /lib/modules/$(VER)-smp/kernel/drivers/scsi
-       rm -rf /lib/modules/$(VER)-smp/kernel/drivers/scsi/sym53c8xx_2
-endif
+       cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
 
-ifeq "$(SMP)" ""
-       # Only do this once on the non-SMP pass
-       cd $(DIR_APP) && make mandocs
-       -mkdir -p /usr/share/man/man9/
-       cd $(DIR_APP) && cp -af Documentation/man/* /usr/share/man/man9/
-endif
+ifeq "$(XEN)" "1"
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz
+       cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
 else
-       cd $(DIR_APP) && make include/linux/version.h
-       cd $(DIR_APP) && make symlinks
-       cd $(DIR_APP) && cp -HRf include/asm /usr/include
-       cd $(DIR_APP) && cp -Rf include/asm-generic /usr/include
-       cd $(DIR_APP) && cp -Rf include/linux /usr/include
-       touch /usr/include/linux/autoconf.h
+       cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
+       cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
 endif
-else
-       cd $(DIR_APP) && make include/linux/version.h
-       cd $(DIR_APP) && make symlinks
-       -mkdir -p /tools/include/asm
-       cd $(DIR_APP) && cp -f include/asm/* /tools/include/asm
-       cd $(DIR_APP) && cp -Rf include/asm-generic /tools/include
-       cd $(DIR_APP) && cp -Rf include/linux /tools/include
-       cd $(DIR_APP) && touch /tools/include/linux/autoconf.h
+       cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
+       cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
+       ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
+       ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
+       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
+       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
+       cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
+
+ifeq "$(XEN)" ""
+       # Only do this once on the non-XEN pass
+       cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
 endif
-       @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables*
+
+       # Rename ide-cd module to match with old kernel
+       mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \
+          /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko
+       mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-gd_mod.ko \
+          /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-disk.ko
+
+       # Remove mISDN modules
+       rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
+       rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
+
+ifneq "$(XEN)" "1"
+       # Blacklist matroxfb_base
+       echo "blacklist matroxfb_base" >> /etc/modprobe.d/framebuffer
+       # Blacklist old framebuffer modules
+       for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video -name *fb.ko); do \
+               echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
+       done
+       # Blacklist new drm framebuffer modules
+       for f in $$(ls -1 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm/*/*.ko); do \
+               echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
+       done
+       sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer
+
+       # Blacklist isdn modules
+       for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn -name *.ko); do \
+               echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/isdn ; \
+       done
+       sed -i -e "s|.ko||g" /etc/modprobe.d/isdn
+endif
+
+       @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
        @$(POSTBUILD)