]>
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 |
6230f0da | 46 | |
df5e82b3 MT |
47 | |
48 | ############################################################################### | |
49 | # Top-level Rules | |
50 | ############################################################################### | |
51 | objects =$(DL_FILE) \ | |
8bba2965 | 52 | mISDN-1_1_3.tar.gz \ |
89069053 | 53 | squashfs3.2-r2.tar.gz \ |
5fd30232 | 54 | iptables-1.3.5.tar.bz2 \ |
3a1019f6 | 55 | patch-o-matic-ng-20061210.tar.bz2 \ |
89069053 | 56 | netfilter-layer7-v2.9.tar.gz \ |
224bbb4e | 57 | patch-2.6.16-nath323-1.3.bz2 \ |
b4f8d26c | 58 | openswan-2.4.8.tar.gz |
df5e82b3 | 59 | |
6230f0da MT |
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 | |
8bba2965 | 66 | mISDN-1_1_3.tar.gz = $(URL_IPFIRE)/mISDN-1_1_3.tar.gz |
4b871415 | 67 | openswan-2.4.9.tar.gz = $(URL_IPFIRE)/openswan-2.4.9.tar.gz |
6230f0da MT |
68 | |
69 | $(DL_FILE)_MD5 = cc2106c6188675187d636aa518b04958 | |
70 | linux-2.6.16.33.tar.bz2_MD5 = 22f56e3a5e7524b2bbde2696152b5ad7 | |
89069053 | 71 | patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393 |
6230f0da MT |
72 | iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5 |
73 | netfilter-layer7-v2.9.tar.gz_MD5 = ebf9043a5352ebe6dbd721989ef83dee | |
74 | patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138 | |
75 | squashfs3.2-r2.tar.gz_MD5 = bf360b92eba9e6d5610196ce2e02fcd1 | |
8bba2965 | 76 | mISDN-1_1_3.tar.gz_MD5 = d29bcf48f16fc8a9b9f3552d111b308d |
4b871415 | 77 | openswan-2.4.9.tar.gz_MD5 = 845f12d80d443cfa1a52f2b53b987bee |
df5e82b3 MT |
78 | |
79 | install : $(TARGET) | |
80 | ||
81 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
82 | ||
83 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
84 | ||
85 | md5 : $(subst %,%_MD5,$(objects)) | |
86 | ||
87 | ############################################################################### | |
88 | # Downloading, checking, md5sum | |
89 | ############################################################################### | |
90 | ||
91 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
92 | @$(CHECK) | |
93 | ||
94 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
95 | @$(LOAD) | |
96 | ||
97 | $(subst %,%_MD5,$(objects)) : | |
98 | @$(MD5) | |
99 | ||
100 | ############################################################################### | |
101 | # Installation Details | |
102 | ############################################################################### | |
103 | ||
104 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
105 | @$(PREBUILD) | |
6230f0da | 106 | @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) |
8eec2184 | 107 | ln -s linux-$(VER) /usr/src/linux |
3a1019f6 | 108 | |
224bbb4e MT |
109 | # An UTF8 patch from LFS |
110 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16.27-utf8_input-1.patch | |
111 | ||
3a1019f6 MT |
112 | # Openswan 2 |
113 | cd $(DIR_SRC) && rm -rf openswan-* | |
4b871415 MT |
114 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-2.4.9.tar.gz |
115 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.9.kernel-2.6-klips.patch | |
116 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.9.kernel-2.6-natt.patch | |
224bbb4e | 117 | |
3a1019f6 | 118 | cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc |
ac1cfefa | 119 | |
5e2e4494 MT |
120 | # H323 conntrack |
121 | cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1 | |
122 | ||
44254afd MT |
123 | # Reiser4 |
124 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch | |
125 | ||
89069053 MT |
126 | # SquashFS |
127 | cd $(DIR_SRC) && rm -rf squashfs* | |
128 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.2-r2.tar.gz | |
129 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.2-r2/kernel-patches/linux-2.6.16/squashfs3.2-patch | |
130 | ||
56b548f1 MT |
131 | # ip_conntrack permissions from 440 to 444 |
132 | cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch | |
2b0b3689 MT |
133 | |
134 | # Some VIA patches | |
135 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/padlock-prereq-2.6.16.diff | |
136 | cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/epia_dma.patch | |
56b548f1 | 137 | |
df5e82b3 | 138 | # Patch-o-matic |
89069053 | 139 | cd $(DIR_SRC) && rm -rf iptables-* patch-o-matic* |
5fd30232 MT |
140 | cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2 |
141 | cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables | |
3a1019f6 | 142 | cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2 |
3a1019f6 | 143 | cd $(DIR_SRC)/patch-o-matic-ng* && \ |
376e42ce MT |
144 | ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ \ |
145 | --iptables-path=$(ROOT)/usr/src/iptables/ \ | |
89069053 | 146 | sip-conntrack-nat rtsp-conntrack-nat \ |
1ee8bf5d | 147 | mms-conntrack-nat |
552b817b | 148 | |
3a1019f6 | 149 | # Layer7-patch |
376e42ce MT |
150 | cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.9 |
151 | cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.9.tar.gz | |
152 | 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 | 153 | |
6f300951 | 154 | # Linux Intermediate Queueing Device |
2b0b3689 MT |
155 | ifeq "$(XEN)" "" |
156 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff | |
157 | endif | |
769a61c5 | 158 | |
1ee8bf5d | 159 | # mISDN |
376e42ce | 160 | cd $(DIR_SRC) && rm -rf mISDN-* |
8bba2965 MT |
161 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/mISDN-1_1_3.tar.gz |
162 | cd $(DIR_SRC)/mISDN-1_1_3 && yes 'yes' | ./std2kern -k /usr/src/linux | |
1ee8bf5d | 163 | |
3a1019f6 | 164 | ifeq "$(SMP)" "" |
df5e82b3 | 165 | # Only do this once on the non-SMP pass |
5fd30232 | 166 | cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5 |
df5e82b3 MT |
167 | endif |
168 | ||
df5e82b3 MT |
169 | # Cleanup kernel source |
170 | cd $(DIR_APP) && make mrproper | |
3a1019f6 | 171 | |
3a1019f6 | 172 | ifeq "$(SMP)" "1" |
df5e82b3 | 173 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config |
6230f0da MT |
174 | else |
175 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config | |
df5e82b3 | 176 | endif |
df5e82b3 MT |
177 | |
178 | cd $(DIR_APP) && make CC="$(KGCC)" oldconfig | |
df5e82b3 | 179 | cd $(DIR_APP) && make CC="$(KGCC)" clean |
3a1019f6 | 180 | |
3a1019f6 | 181 | ifeq "$(SMP)" "1" |
376e42ce | 182 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile |
872e5216 MT |
183 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage |
184 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp | |
376e42ce | 185 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp |
c4166091 | 186 | ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp |
376e42ce MT |
187 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules |
188 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
376e42ce MT |
189 | else |
190 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile | |
872e5216 MT |
191 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage |
192 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire | |
376e42ce MT |
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 | |
df5e82b3 | 199 | endif |
376e42ce MT |
200 | |
201 | # remove symlinked pcmcia directory | |
202 | -rm -rf /lib/modules/$(VER)-ipfire{,-smp}/pcmcia | |
203 | ||
ee78a5ef MT |
204 | ifeq "$(SMP)" "" |
205 | # Only do this once on the non-SMP pass | |
81e974f3 | 206 | cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/ |
ee78a5ef MT |
207 | endif |
208 | ||
376e42ce | 209 | @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-* |
df5e82b3 | 210 | @$(POSTBUILD) |