############################################################################### # # # 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 3 of the License, or # # (at your option) any later version. # # # # 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 this program. If not, see . # # # ############################################################################### ############################################################################### # Definitions ############################################################################### include Config PATCHLEVEL = .9 VER = 2.6.32.9 THISAPP = linux-$(VER) DL_FILE = $(THISAPP).tar.bz2 DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) CFLAGS = CXXFLAGS = PROG = linux-xen PAK_VER = 8 DEPS = "" # Normal build or XEN build. # ifeq "$(XEN)" "1" VERSUFIX=ipfire-xen else VERSUFIX=ipfire endif TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX) ############################################################################### # Top-level Rules ############################################################################### objects =$(DL_FILE) \ 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 \ linux-$(VER)-suse_xen_patches-1.tar.bz2 $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE) netfilter-layer7-v2.22.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.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 linux-$(VER)-suse_xen_patches-1.tar.bz2 = $(URL_IPFIRE)/linux-$(VER)-suse_xen_patches-1.tar.bz2 $(DL_FILE)_MD5 = 0771a9c70503c92f40d815ef76eb62fe 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 linux-$(VER)-suse_xen_patches-1.tar.bz2_MD5 = c79c4dfd069fdedbc39df478de678575 install : $(TARGET) check : $(patsubst %,$(DIR_CHK)/%,$(objects)) download :$(patsubst %,$(DIR_DL)/%,$(objects)) md5 : $(subst %,%_MD5,$(objects)) dist: @$(PAK) ############################################################################### # Downloading, checking, md5sum ############################################################################### $(patsubst %,$(DIR_CHK)/%,$(objects)) : @$(CHECK) $(patsubst %,$(DIR_DL)/%,$(objects)) : @$(LOAD) $(subst %,%_MD5,$(objects)) : @$(MD5) ############################################################################### # Installation Details ############################################################################### $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @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 Xen patches (provided by SuSE) cd $(DIR_SRC) && tar jxf $(DIR_DL)/linux-$(VER)-suse_xen_patches-1.tar.bz2 cp -f $(DIR_SRC)/src/patches/suse_xen_series.conf $(DIR_SRC)/linux-$(VER)-suse_xen_patches/series.conf cd $(DIR_SRC)/linux-$(VER)-suse_xen_patches && \ for x in $$( ./guards $$( ./arch-symbols) < ./series.conf); do \ echo "*********** [Patch: $$x]"; \ patch -d $(DIR_APP) -p1 < $$x || break; \ done rm -rf $(DIR_SRC)/linux-*-suse_xen_patches # Fix strange patchset errors cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-patch-fixes.patch # 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 # Add patch to fix ath5k "no txbuf available" cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-ath5k_fix_setup_for_CAB_queue.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 # 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 # 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 # 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 # Squashfs LZMA support cd $(DIR_APP) && bzcat $(DIR_DL)/squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 | patch -Np1 # Cleanup kernel source 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)" clean cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile 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 $(MAKETUNING) CC="$(KGCC)" bzImage cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX) endif 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 # 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 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-* @$(POSTBUILD)