]>
Commit | Line | Data |
---|---|---|
df5e82b3 MT |
1 | ############################################################################### |
2 | # This file is part of the IPCop Firewall. # | |
3 | # # | |
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. # | |
8 | # # | |
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. # | |
13 | # # | |
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 # | |
17 | # # | |
18 | # Makefiles are based on LFSMake, which is # | |
19 | # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> # | |
20 | # # | |
df5e82b3 MT |
21 | ############################################################################### |
22 | ||
23 | ############################################################################### | |
24 | # Definitions | |
25 | ############################################################################### | |
26 | ||
27 | include Config | |
28 | ||
2d210ae2 MT |
29 | PATCHLEVEL = .50 |
30 | VER = 2.6.16.50 | |
df5e82b3 MT |
31 | |
32 | THISAPP = linux-$(VER) | |
376e42ce | 33 | DL_FILE = $(THISAPP).tar.bz2 |
a2cb3a33 | 34 | DL_FROM = $(URL_IPFIRE) |
df5e82b3 MT |
35 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
36 | CFLAGS = | |
37 | CXXFLAGS = | |
38 | ||
3a1019f6 | 39 | # Normal build or SMP build. |
df5e82b3 | 40 | # |
3a1019f6 | 41 | ifeq "$(SMP)" "1" |
376e42ce | 42 | TARGET = $(DIR_INFO)/linux-$(VER)-smp |
3a1019f6 | 43 | else |
376e42ce | 44 | TARGET = $(DIR_INFO)/linux-$(VER) |
df5e82b3 | 45 | endif |
df5e82b3 MT |
46 | |
47 | ############################################################################### | |
48 | # Top-level Rules | |
49 | ############################################################################### | |
50 | objects =$(DL_FILE) \ | |
1ee8bf5d | 51 | mISDN-CVS-2007-01-26.tar.bz2 \ |
89069053 | 52 | squashfs3.2-r2.tar.gz \ |
5fd30232 | 53 | iptables-1.3.5.tar.bz2 \ |
3a1019f6 | 54 | patch-o-matic-ng-20061210.tar.bz2 \ |
89069053 | 55 | netfilter-layer7-v2.9.tar.gz \ |
224bbb4e MT |
56 | patch-2.6.16-nath323-1.3.bz2 \ |
57 | openswan-2.5.13.tar.gz | |
df5e82b3 | 58 | |
f59e1e88 | 59 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) |
3a1019f6 | 60 | patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2 |
5fd30232 | 61 | iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2 |
89069053 | 62 | netfilter-layer7-v2.9.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.9.tar.gz |
5e2e4494 | 63 | patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2 |
89069053 | 64 | squashfs3.2-r2.tar.gz = $(URL_IPFIRE)/squashfs3.2-r2.tar.gz |
1ee8bf5d | 65 | mISDN-CVS-2007-01-26.tar.bz2 = $(URL_IPFIRE)/mISDN-CVS-2007-01-26.tar.bz2 |
224bbb4e | 66 | openswan-2.5.13.tar.gz = $(URL_IPFIRE)/openswan-2.5.13.tar.gz |
df5e82b3 | 67 | |
2d210ae2 | 68 | $(DL_FILE)_MD5 = cc2106c6188675187d636aa518b04958 |
89069053 | 69 | patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393 |
5fd30232 | 70 | iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5 |
89069053 MT |
71 | netfilter-layer7-v2.9.tar.gz_MD5 = ebf9043a5352ebe6dbd721989ef83dee |
72 | patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138 | |
73 | squashfs3.2-r2.tar.gz_MD5 = bf360b92eba9e6d5610196ce2e02fcd1 | |
74 | mISDN-CVS-2007-01-26.tar.bz2_MD5 = 844c70dc851faffcae7549fd738c7b49 | |
224bbb4e | 75 | openswan-2.5.13.tar.gz_MD5 = b83a42ea00ee24ed34413bc122cada51 |
df5e82b3 MT |
76 | |
77 | install : $(TARGET) | |
78 | ||
79 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
80 | ||
81 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
82 | ||
83 | md5 : $(subst %,%_MD5,$(objects)) | |
84 | ||
85 | ############################################################################### | |
86 | # Downloading, checking, md5sum | |
87 | ############################################################################### | |
88 | ||
89 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
90 | @$(CHECK) | |
91 | ||
92 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
93 | @$(LOAD) | |
94 | ||
95 | $(subst %,%_MD5,$(objects)) : | |
96 | @$(MD5) | |
97 | ||
98 | ############################################################################### | |
99 | # Installation Details | |
100 | ############################################################################### | |
101 | ||
102 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
103 | @$(PREBUILD) | |
376e42ce | 104 | @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) |
8eec2184 | 105 | ln -s linux-$(VER) /usr/src/linux |
3a1019f6 | 106 | |
224bbb4e MT |
107 | # An UTF8 patch from LFS |
108 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16.27-utf8_input-1.patch | |
109 | ||
3a1019f6 MT |
110 | # Openswan 2 |
111 | cd $(DIR_SRC) && rm -rf openswan-* | |
224bbb4e MT |
112 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-2.5.13.tar.gz |
113 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.5.13.kernel-2.6-klips.patch | |
114 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.5.13.kernel-2.6-natt.patch | |
115 | ||
3a1019f6 | 116 | cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc |
ac1cfefa | 117 | |
5e2e4494 MT |
118 | # H323 conntrack |
119 | cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1 | |
120 | ||
44254afd MT |
121 | # Reiser4 |
122 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch | |
123 | ||
89069053 MT |
124 | # SquashFS |
125 | cd $(DIR_SRC) && rm -rf squashfs* | |
126 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.2-r2.tar.gz | |
127 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.2-r2/kernel-patches/linux-2.6.16/squashfs3.2-patch | |
128 | ||
df5e82b3 | 129 | # Patch-o-matic |
89069053 | 130 | cd $(DIR_SRC) && rm -rf iptables-* patch-o-matic* |
5fd30232 MT |
131 | cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2 |
132 | cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables | |
3a1019f6 | 133 | cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2 |
3a1019f6 | 134 | cd $(DIR_SRC)/patch-o-matic-ng* && \ |
376e42ce MT |
135 | ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ \ |
136 | --iptables-path=$(ROOT)/usr/src/iptables/ \ | |
89069053 | 137 | sip-conntrack-nat rtsp-conntrack-nat \ |
1ee8bf5d | 138 | mms-conntrack-nat |
552b817b | 139 | |
3a1019f6 | 140 | # Layer7-patch |
376e42ce MT |
141 | cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.9 |
142 | cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.9.tar.gz | |
143 | 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 | |
df5e82b3 | 144 | |
6f300951 MT |
145 | # Linux Intermediate Queueing Device |
146 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff | |
147 | ||
769a61c5 | 148 | # ip_conntrack permissions from 440 to 444 |
552b817b | 149 | cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch |
769a61c5 | 150 | |
1ee8bf5d | 151 | # mISDN |
376e42ce | 152 | cd $(DIR_SRC) && rm -rf mISDN-* |
1ee8bf5d MT |
153 | cd $(DIR_SRC) && tar xfj $(DIR_DL)/mISDN-CVS-2007-01-26.tar.bz2 |
154 | cd $(DIR_SRC)/mISDN-CVS-2007-01-26 && yes 'yes' | ./std2kern -k /usr/src/linux | |
155 | ||
3a1019f6 | 156 | ifeq "$(SMP)" "" |
df5e82b3 | 157 | # Only do this once on the non-SMP pass |
5fd30232 | 158 | cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5 |
df5e82b3 MT |
159 | endif |
160 | ||
3a1019f6 | 161 | # Bootsplash |
c3e36980 | 162 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bootsplash-3.1.6-2.6.15.diff |
65a5a838 | 163 | |
df5e82b3 MT |
164 | # Cleanup kernel source |
165 | cd $(DIR_APP) && make mrproper | |
3a1019f6 MT |
166 | |
167 | ifeq "$(SMP)" "" | |
df5e82b3 MT |
168 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config |
169 | endif | |
3a1019f6 | 170 | ifeq "$(SMP)" "1" |
df5e82b3 MT |
171 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config |
172 | endif | |
df5e82b3 MT |
173 | |
174 | cd $(DIR_APP) && make CC="$(KGCC)" oldconfig | |
df5e82b3 | 175 | cd $(DIR_APP) && make CC="$(KGCC)" clean |
3a1019f6 | 176 | |
3a1019f6 | 177 | ifeq "$(SMP)" "1" |
376e42ce MT |
178 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile |
179 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage | |
180 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp | |
181 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp | |
182 | cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire | |
c4166091 | 183 | ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp |
376e42ce MT |
184 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules |
185 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
224bbb4e | 186 | mkdir -p /usr/src/openswan-2.5.13/modobj26/null |
76ed51e8 MT |
187 | cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) module |
188 | cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) minstall | |
376e42ce MT |
189 | else |
190 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile | |
191 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage | |
192 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire | |
193 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire | |
194 | cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire | |
89069053 | 195 | ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire |
63817c2a | 196 | ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire |
376e42ce MT |
197 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules |
198 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
224bbb4e | 199 | mkdir -p /usr/src/openswan-2.5.13/modobj26/null |
76ed51e8 MT |
200 | cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) module |
201 | cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) minstall | |
df5e82b3 | 202 | endif |
376e42ce MT |
203 | |
204 | # remove symlinked pcmcia directory | |
205 | -rm -rf /lib/modules/$(VER)-ipfire{,-smp}/pcmcia | |
206 | ||
207 | @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-* | |
df5e82b3 | 208 | @$(POSTBUILD) |