]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/linux
1efdc28048a41cd82b6d407e7854fdcdb2dc5d8d
[people/pmueller/ipfire-2.x.git] / lfs / linux
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 # #
21 ###############################################################################
22
23 ###############################################################################
24 # Definitions
25 ###############################################################################
26
27 include Config
28
29 PATCHLEVEL = .50
30 VER = 2.6.16.50
31
32 THISAPP = linux-$(VER)
33 DL_FILE = $(THISAPP).tar.bz2
34 DL_FROM = $(URL_IPFIRE)
35 DIR_APP = $(DIR_SRC)/$(THISAPP)
36 CFLAGS =
37 CXXFLAGS =
38
39 # Normal build or SMP build.
40 #
41 ifeq "$(SMP)" "1"
42 TARGET = $(DIR_INFO)/linux-$(VER)-smp
43 else
44 TARGET = $(DIR_INFO)/linux-$(VER)
45 endif
46
47 ###############################################################################
48 # Top-level Rules
49 ###############################################################################
50 objects =$(DL_FILE) \
51 mISDN-CVS-2007-01-26.tar.bz2 \
52 squashfs3.2-r2.tar.gz \
53 iptables-1.3.5.tar.bz2 \
54 patch-o-matic-ng-20061210.tar.bz2 \
55 netfilter-layer7-v2.9.tar.gz \
56 patch-2.6.16-nath323-1.3.bz2 \
57 openswan-2.5.13.tar.gz
58
59 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
60 patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2
61 iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
62 netfilter-layer7-v2.9.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.9.tar.gz
63 patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
64 squashfs3.2-r2.tar.gz = $(URL_IPFIRE)/squashfs3.2-r2.tar.gz
65 mISDN-CVS-2007-01-26.tar.bz2 = $(URL_IPFIRE)/mISDN-CVS-2007-01-26.tar.bz2
66 openswan-2.5.13.tar.gz = $(URL_IPFIRE)/openswan-2.5.13.tar.gz
67
68 $(DL_FILE)_MD5 = cc2106c6188675187d636aa518b04958
69 patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393
70 iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5
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
75 openswan-2.5.13.tar.gz_MD5 = b83a42ea00ee24ed34413bc122cada51
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)
104 @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
105 ln -s linux-$(VER) /usr/src/linux
106
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
110 # Openswan 2
111 cd $(DIR_SRC) && rm -rf openswan-*
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
116 cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc
117
118 # H323 conntrack
119 cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1
120
121 # Reiser4
122 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch
123
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
129 # Patch-o-matic
130 cd $(DIR_SRC) && rm -rf iptables-* patch-o-matic*
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
133 cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2
134 cd $(DIR_SRC)/patch-o-matic-ng* && \
135 ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ \
136 --iptables-path=$(ROOT)/usr/src/iptables/ \
137 sip-conntrack-nat rtsp-conntrack-nat \
138 mms-conntrack-nat
139
140 # Layer7-patch
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
144
145 # Linux Intermediate Queueing Device
146 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff
147
148 # ip_conntrack permissions from 440 to 444
149 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
150
151 # mISDN
152 cd $(DIR_SRC) && rm -rf mISDN-*
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
156 ifeq "$(SMP)" ""
157 # Only do this once on the non-SMP pass
158 cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5
159 endif
160
161 # Bootsplash
162 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bootsplash-3.1.6-2.6.15.diff
163
164 # Cleanup kernel source
165 cd $(DIR_APP) && make mrproper
166
167 ifeq "$(SMP)" ""
168 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
169 endif
170 ifeq "$(SMP)" "1"
171 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
172 endif
173
174 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
175 cd $(DIR_APP) && make CC="$(KGCC)" clean
176
177 ifeq "$(SMP)" "1"
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
183 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
184 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
185 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
186 mkdir -p /usr/src/openswan-2.5.13/modobj26/null
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
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
195 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
196 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
197 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
198 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
199 mkdir -p /usr/src/openswan-2.5.13/modobj26/null
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
202 endif
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-*
208 @$(POSTBUILD)