]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - lfs/linux
Sambactrl und samba.cgi von Maniacikarus
[ipfire-2.x.git] / lfs / linux
... / ...
CommitLineData
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
27include Config
28
29VER = 2.6.16
30PATCHLEVEL = 2.6.16.29
31
32THISAPP = linux-$(VER)
33DL_FILE = $(THISAPP).tar.gz
34DL_FROM = $(URL_IPFIRE)
35DIR_APP = $(DIR_SRC)/$(THISAPP)
36CFLAGS =
37CXXFLAGS =
38
39# Normal build or SMP build.
40#
41ifeq "$(SMP)" "1"
42 TARGET = $(DIR_INFO)/linux-$(PATCHLEVEL)-ipfire-smp
43else
44 TARGET = $(DIR_INFO)/linux-$(PATCHLEVEL)-ipfire
45endif
46
47###############################################################################
48# Top-level Rules
49###############################################################################
50objects =$(DL_FILE) \
51 mISDN-CVS-2007-01-26.tar.bz2 \
52 squashfs3.0.tar.gz \
53 openswan-2.4.7.kernel-2.6-natt.patch.gz \
54 openswan-2.4.7.kernel-2.6-klips.patch.gz \
55 iptables-1.3.5.tar.bz2 \
56 patch-o-matic-ng-20061210.tar.bz2 \
57 kbc_option_2420.patch \
58 net4801.kernel.patch_2.4.31 \
59 netfilter-layer7-v2.6.tar.gz \
60 patch-2.6.16-nath323-1.3.bz2 \
61 patch-$(PATCHLEVEL).gz
62
63$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
64patch-$(PATCHLEVEL).gz = $(DL_FROM)/patch-$(PATCHLEVEL).gz
65openswan-2.4.7.kernel-2.6-natt.patch.gz = $(URL_IPFIRE)/openswan-2.4.7.kernel-2.6-natt.patch.gz
66openswan-2.4.7.kernel-2.6-klips.patch.gz = $(URL_IPFIRE)/openswan-2.4.7.kernel-2.6-klips.patch.gz
67patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2
68iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
69kbc_option_2420.patch = $(URL_IPFIRE)/kbc_option_2420.patch
70net4801.kernel.patch_2.4.31 = $(URL_IPFIRE)/net4801.kernel.patch_2.4.31
71netfilter-layer7-v2.6.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.6.tar.gz
72patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
73squashfs3.0.tar.gz = $(URL_IPFIRE)/squashfs3.0.tar.gz
74mISDN-CVS-2007-01-26.tar.bz2 = $(URL_IPFIRE)/mISDN-CVS-2007-01-26.tar.bz2
75
76$(DL_FILE)_MD5 = 50695965725367f39007023feac5e256
77patch-$(PATCHLEVEL).gz_MD5 = 1355ebc25ea57df398d20e1c1726ec9b
78openswan-2.4.7.kernel-2.6-natt.patch.gz_MD5 = 980d8bbdb29a761b7f5aa852f373df62
79openswan-2.4.7.kernel-2.6-klips.patch.gz_MD5 = 5df0ffa2453488a407a23fc4ea4af879
80patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393
81iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5
82kbc_option_2420.patch_MD5 = 6d37870344f7fcf97ace1fbf43323c60
83net4801.kernel.patch_2.4.31_MD5 = c7d64e3caedb2f2b10e1c11db7f73a04
84netfilter-layer7-v2.6.tar.gz_MD5 = 58135cd1aafaf4ae2fa478159206f064
85patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
86squashfs3.0.tar.gz_MD5 = 9fd05d0bfbb712f5fb95edafea5bc733
87mISDN-CVS-2007-01-26.tar.bz2_MD5 = 844c70dc851faffcae7549fd738c7b49
88
89install : $(TARGET)
90
91check : $(patsubst %,$(DIR_CHK)/%,$(objects))
92
93download :$(patsubst %,$(DIR_DL)/%,$(objects))
94
95md5 : $(subst %,%_MD5,$(objects))
96
97###############################################################################
98# Downloading, checking, md5sum
99###############################################################################
100
101$(patsubst %,$(DIR_CHK)/%,$(objects)) :
102 @$(CHECK)
103
104$(patsubst %,$(DIR_DL)/%,$(objects)) :
105 @$(LOAD)
106
107$(subst %,%_MD5,$(objects)) :
108 @$(MD5)
109
110###############################################################################
111# Installation Details
112###############################################################################
113
114$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
115 @$(PREBUILD)
116 @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
117 ln -s linux-$(VER) /usr/src/linux
118
119 # Update kernel to latest patchlevel
120 cd $(DIR_APP) && zcat $(DIR_DL)/patch-$(PATCHLEVEL).gz | patch -p1
121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16.27-utf8_input-1.patch
122 # Remove patch level in EXTRAVERSION.
123 # We want to avoid the need to supply a full kernel
124 # (installed in a different place) if only one part could be updated
125 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =/' Makefile
126 cd $(DIR_APP) && sed -i -e 's/-Werror//' drivers/scsi/aic7xxx/Makefile
127 cd $(DIR_APP) && sed -i -e 's/gettext//' scripts/kconfig/lkc.h
128
129 # Openswan 2
130 cd $(DIR_SRC) && rm -rf openswan-*
131 cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-2.4.7.tar.gz
132 cd $(DIR_APP) && gzip -dc $(DIR_DL)/openswan-2.4.7.kernel-2.6-natt.patch.gz | patch -Np1
133 cd $(DIR_APP) && gzip -dc $(DIR_DL)/openswan-2.4.7.kernel-2.6-klips.patch.gz | patch -Np1
134 cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc
135
136 # H323 conntrack
137 cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1
138
139 # SquashFS
140 cd $(DIR_SRC) && rm -rf squashfs*
141 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.0.tar.gz
142 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.0/linux-2.6.15/squashfs3.0-patch
143
144 # Patch-o-matic
145 cd $(DIR_SRC) && rm -rf iptables-*
146 cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2
147 cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables
148 cd $(DIR_SRC) && rm -rf patch-o-matic*
149 cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2
150 cd $(DIR_SRC)/patch-o-matic-ng* && \
151 ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ --iptables-path=$(ROOT)/usr/src/iptables/ \
152 TARPIT sip-conntrack-nat rtsp-conntrack-nat \
153 mms-conntrack-nat
154
155 # Layer7-patch
156 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.6
157 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.6.tar.gz
158 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.6/for_older_kernels/kernel-2.6.13-2.6.16-layer7-2.2.patch
159
160 # Linux Intermediate Queueing Device
161 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff
162
163 # ip_conntrack permissions from 440 to 444
164 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
165
166 # mISDN
167 cd $(DIR_SRC) && rm -rf mISDN-CVS-2007-01-26
168 cd $(DIR_SRC) && tar xfj $(DIR_DL)/mISDN-CVS-2007-01-26.tar.bz2
169 cd $(DIR_SRC)/mISDN-CVS-2007-01-26 && yes 'yes' | ./std2kern -k /usr/src/linux
170
171ifeq "$(SMP)" ""
172 # Only do this once on the non-SMP pass
173 cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5
174endif
175
176 # Bootsplash
177 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bootsplash-3.1.6-2.6.15.diff
178
179 # Cleanup kernel source
180 cd $(DIR_APP) && make mrproper
181
182ifeq "$(SMP)" ""
183 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
184endif
185ifeq "$(SMP)" "1"
186 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
187endif
188
189 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
190 cd $(DIR_APP) && make CC="$(KGCC)" clean
191 if [ "$(SMP)" = "" ]; then \
192 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage; \
193 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER); \
194 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER); \
195 cd $(DIR_APP) && cp -v .config /boot/config-$(VER); \
196 ln -sf vmlinuz-$(VER) /boot/vmlinuz; \
197 ln -sf System.map-$(VER) /boot/System.map; \
198 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules; \
199 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install; \
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 elif [ "$(SMP)" = "1" ]; then \
203 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =/EXTRAVERSION\ =\ -smp/' Makefile; \
204 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage; \
205 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-smp; \
206 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-smp; \
207 cd $(DIR_APP) && cp -v .config /boot/config-$(VER); \
208 ln -sf vmlinuz-$(VER)-smp /boot/vmlinuz-smp; \
209 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules; \
210 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install; \
211 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) module; \
212 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) minstall; \
213 fi
214
215 # remove symlinked pcmcia directory
216ifeq "$(SMP)" ""
217 rm -rf /lib/modules/$(VER)/pcmcia
218endif
219ifeq "$(SMP)" "1"
220 rm -rf /lib/modules/$(VER)-smp/pcmcia
221endif
222 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-CVS-2007-01-26 $(DIR_SRC)/netfilter-layer7-v2.6
223 @$(POSTBUILD)