1 ###############################################################################
2 # This file is part of the IPCop Firewall. #
4 # IPCop is free software; you can redistribute it and/or modify #
5 # it under the terms of the GNU General Public License as published by #
6 # the Free Software Foundation; either version 2 of the License, or #
7 # (at your option) any later version. #
9 # IPCop is distributed in the hope that it will be useful, #
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
12 # GNU General Public License for more details. #
14 # You should have received a copy of the GNU General Public License #
15 # along with IPCop; if not, write to the Free Software #
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
18 # Makefiles are based on LFSMake, which is #
19 # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> #
21 ###############################################################################
23 ###############################################################################
25 ###############################################################################
32 THISAPP = linux-$(VER)
33 DL_FILE = $(THISAPP).tar.bz2
34 DL_FROM = $(URL_IPFIRE)
35 DIR_APP = $(DIR_SRC)/$(THISAPP)
39 # Normal build or SMP build.
42 TARGET = $(DIR_INFO)/linux-$(VER)-smp
44 TARGET = $(DIR_INFO)/linux-$(VER)
48 ###############################################################################
50 ###############################################################################
53 squashfs3.2-r2.tar.gz \
54 iptables-1.3.5.tar.bz2 \
55 patch-o-matic-ng-20061210.tar.bz2 \
56 netfilter-layer7-v2.9.tar.gz \
57 patch-2.6.16-nath323-1.3.bz2 \
60 $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
61 patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2
62 iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
63 netfilter-layer7-v2.9.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.9.tar.gz
64 patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
65 squashfs3.2-r2.tar.gz = $(URL_IPFIRE)/squashfs3.2-r2.tar.gz
66 mISDN-1_1_5.tar.gz = $(URL_IPFIRE)/mISDN-1_1_5.tar.gz
67 openswan-2.4.9.tar.gz = $(URL_IPFIRE)/openswan-2.4.9.tar.gz
69 $(DL_FILE)_MD5 = 5c6e965d9121ba0d3f3c747e519de402
70 patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393
71 iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5
72 netfilter-layer7-v2.9.tar.gz_MD5 = ebf9043a5352ebe6dbd721989ef83dee
73 patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
74 squashfs3.2-r2.tar.gz_MD5 = bf360b92eba9e6d5610196ce2e02fcd1
75 mISDN-1_1_5.tar.gz_MD5 = 93b1cff7817b82638a0475c2b7b7f1b6
76 openswan-2.4.9.tar.gz_MD5 = 845f12d80d443cfa1a52f2b53b987bee
80 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
82 download :$(patsubst %,$(DIR_DL)/%,$(objects))
84 md5 : $(subst %,%_MD5,$(objects))
86 ###############################################################################
87 # Downloading, checking, md5sum
88 ###############################################################################
90 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
93 $(patsubst %,$(DIR_DL)/%,$(objects)) :
96 $(subst %,%_MD5,$(objects)) :
99 ###############################################################################
100 # Installation Details
101 ###############################################################################
103 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
105 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
106 ln -s linux-$(VER) /usr/src/linux
108 # An UTF8 patch from LFS
109 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16.27-utf8_input-1.patch
112 cd $(DIR_SRC) && rm -rf openswan-*
113 cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-2.4.9.tar.gz
114 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.9.kernel-2.6-klips.patch
115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.9.kernel-2.6-natt.patch
117 cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc
120 cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1
123 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch
126 cd $(DIR_SRC) && rm -rf squashfs*
127 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.2-r2.tar.gz
128 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.2-r2/kernel-patches/linux-2.6.16/squashfs3.2-patch
130 # ip_conntrack permissions from 440 to 444
131 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
134 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/padlock-prereq-2.6.16.diff
135 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/epia_dma.patch
138 cd $(DIR_SRC) && rm -rf iptables-* patch-o-matic*
139 cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2
140 cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables
141 cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2
142 cd $(DIR_SRC)/patch-o-matic-ng* && \
143 ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ \
144 --iptables-path=$(ROOT)/usr/src/iptables/ \
145 sip-conntrack-nat rtsp-conntrack-nat \
149 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.9
150 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.9.tar.gz
151 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.9/for_older_kernels/kernel-2.6.13-2.6.16-layer7-2.2.patch
153 # Linux Intermediate Queueing Device
155 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff
159 cd $(DIR_SRC) && rm -rf mISDN-*
160 cd $(DIR_SRC) && tar xfz $(DIR_DL)/mISDN-1_1_5.tar.gz
161 cd $(DIR_SRC)/mISDN-1_1_5 && yes 'yes' | ./std2kern -k /usr/src/linux
163 cd $(DIR_APP)/drivers/isdn/hardware/mISDN && patch -Np0 < $(DIR_SRC)/src/patches/mISDN-avmfritz.patch
166 # Only do this once on the non-SMP pass
167 cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5
170 # Cleanup kernel source
171 cd $(DIR_APP) && make mrproper
174 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
176 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
179 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
180 cd $(DIR_APP) && make CC="$(KGCC)" clean
183 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile
184 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
185 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp
186 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp
187 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
188 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
189 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
191 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
192 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
193 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
194 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
195 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
196 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
197 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
198 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
199 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
203 # Only do this once on the non-SMP pass
204 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
207 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-*