Pakfire laedt die Listen jetzt besser und hat eine veraenderte Oberflaeche bekommen.
[people/pmueller/ipfire-2.x.git] / lfs / linux
CommitLineData
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
27include Config
28
53535df3
MT
29PATCHLEVEL = .53
30VER = 2.6.16.53
df5e82b3
MT
31
32THISAPP = linux-$(VER)
376e42ce 33DL_FILE = $(THISAPP).tar.bz2
a2cb3a33 34DL_FROM = $(URL_IPFIRE)
df5e82b3
MT
35DIR_APP = $(DIR_SRC)/$(THISAPP)
36CFLAGS =
37CXXFLAGS =
38
3a1019f6 39# Normal build or SMP build.
df5e82b3 40#
3a1019f6 41ifeq "$(SMP)" "1"
376e42ce 42 TARGET = $(DIR_INFO)/linux-$(VER)-smp
3a1019f6 43else
376e42ce 44 TARGET = $(DIR_INFO)/linux-$(VER)
df5e82b3 45endif
6230f0da 46
df5e82b3
MT
47
48###############################################################################
49# Top-level Rules
50###############################################################################
51objects =$(DL_FILE) \
ccdb878e 52 mISDN-1_1_5.tar.gz \
3185932e
MT
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 \
58 openswan-2.4.9.tar.gz
df5e82b3 59
6230f0da 60$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
3185932e
MT
61patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2
62iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
63netfilter-layer7-v2.9.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.9.tar.gz
64patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
65squashfs3.2-r2.tar.gz = $(URL_IPFIRE)/squashfs3.2-r2.tar.gz
1b273e8f 66mISDN-1_1_5.tar.gz = $(URL_IPFIRE)/mISDN-1_1_5.tar.gz
3185932e
MT
67openswan-2.4.9.tar.gz = $(URL_IPFIRE)/openswan-2.4.9.tar.gz
68
53535df3 69$(DL_FILE)_MD5 = 5c6e965d9121ba0d3f3c747e519de402
3185932e
MT
70patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393
71iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5
72netfilter-layer7-v2.9.tar.gz_MD5 = ebf9043a5352ebe6dbd721989ef83dee
73patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
74squashfs3.2-r2.tar.gz_MD5 = bf360b92eba9e6d5610196ce2e02fcd1
1b273e8f 75mISDN-1_1_5.tar.gz_MD5 = 93b1cff7817b82638a0475c2b7b7f1b6
3185932e 76openswan-2.4.9.tar.gz_MD5 = 845f12d80d443cfa1a52f2b53b987bee
df5e82b3
MT
77
78install : $(TARGET)
79
80check : $(patsubst %,$(DIR_CHK)/%,$(objects))
81
82download :$(patsubst %,$(DIR_DL)/%,$(objects))
83
84md5 : $(subst %,%_MD5,$(objects))
85
86###############################################################################
87# Downloading, checking, md5sum
88###############################################################################
89
90$(patsubst %,$(DIR_CHK)/%,$(objects)) :
91 @$(CHECK)
92
93$(patsubst %,$(DIR_DL)/%,$(objects)) :
94 @$(LOAD)
95
96$(subst %,%_MD5,$(objects)) :
97 @$(MD5)
98
99###############################################################################
100# Installation Details
101###############################################################################
102
103$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
104 @$(PREBUILD)
3185932e 105 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
8eec2184 106 ln -s linux-$(VER) /usr/src/linux
3a1019f6 107
3185932e
MT
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
110
3a1019f6
MT
111 # Openswan 2
112 cd $(DIR_SRC) && rm -rf openswan-*
3185932e
MT
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
224bbb4e 116
3a1019f6 117 cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc
ac1cfefa 118
3185932e
MT
119 # H323 conntrack
120 cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1
121
44254afd 122 # Reiser4
3185932e
MT
123 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.16-5.patch
124
125 # SquashFS
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
89069053 129
56b548f1 130 # ip_conntrack permissions from 440 to 444
3185932e
MT
131 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
132
133 # Some VIA patches
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
136
137 # Patch-o-matic
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 \
146 mms-conntrack-nat
552b817b 147
3a1019f6 148 # Layer7-patch
3185932e
MT
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
df5e82b3 152
6f300951 153 # Linux Intermediate Queueing Device
3185932e
MT
154ifeq "$(XEN)" ""
155 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16-imq2.diff
156endif
769a61c5 157
1ee8bf5d 158 # mISDN
376e42ce 159 cd $(DIR_SRC) && rm -rf mISDN-*
1b273e8f
MT
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
7146d4a5
MT
162
163 cd $(DIR_APP)/drivers/isdn/hardware/mISDN && patch -Np0 < $(DIR_SRC)/src/patches/mISDN-avmfritz.patch
3185932e
MT
164
165ifeq "$(SMP)" ""
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
168endif
df5e82b3 169
df5e82b3
MT
170 # Cleanup kernel source
171 cd $(DIR_APP) && make mrproper
3a1019f6 172
3a1019f6 173ifeq "$(SMP)" "1"
df5e82b3 174 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
6230f0da
MT
175else
176 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
df5e82b3 177endif
df5e82b3
MT
178
179 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 180 cd $(DIR_APP) && make CC="$(KGCC)" clean
3a1019f6 181
3a1019f6 182ifeq "$(SMP)" "1"
376e42ce 183 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile
872e5216
MT
184 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
185 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp
376e42ce 186 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp
c4166091 187 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
376e42ce
MT
188 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
189 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
376e42ce
MT
190else
191 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
872e5216
MT
192 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
193 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
376e42ce
MT
194 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
195 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
89069053 196 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
63817c2a 197 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
376e42ce
MT
198 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
199 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
df5e82b3 200endif
376e42ce 201
ee78a5ef
MT
202ifeq "$(SMP)" ""
203 # Only do this once on the non-SMP pass
81e974f3 204 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
ee78a5ef
MT
205endif
206
3185932e 207 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 208 @$(POSTBUILD)