SquashFS hinzugefuegt damit wir auf OpenVZ-Maschinen bauen koennen.
[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
f59e1e88 29VER = 2.6.16
552b817b 30PATCHLEVEL = 2.6.16.29
df5e82b3
MT
31
32THISAPP = linux-$(VER)
33DL_FILE = $(THISAPP).tar.gz
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
MT
41ifeq "$(SMP)" "1"
42 TARGET = $(DIR_INFO)/linux-$(PATCHLEVEL)-ipfire-smp
43else
44 TARGET = $(DIR_INFO)/linux-$(PATCHLEVEL)-ipfire
df5e82b3 45endif
df5e82b3
MT
46
47###############################################################################
48# Top-level Rules
49###############################################################################
50objects =$(DL_FILE) \
3a1019f6
MT
51 openswan-2.4.7.kernel-2.6-natt.patch.gz \
52 openswan-2.4.7.kernel-2.6-klips.patch.gz \
df5e82b3 53 iptables-1.3.5.tar.bz2 \
3a1019f6 54 patch-o-matic-ng-20061210.tar.bz2 \
df5e82b3
MT
55 kbc_option_2420.patch \
56 net4801.kernel.patch_2.4.31 \
c3e36980 57 netfilter-layer7-v2.6.tar.gz \
5e2e4494 58 patch-2.6.16-nath323-1.3.bz2 \
f59e1e88 59 patch-$(PATCHLEVEL).gz
df5e82b3 60
f59e1e88 61$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
d16d0d22 62patch-$(PATCHLEVEL).gz = $(DL_FROM)/patch-$(PATCHLEVEL).gz
3a1019f6
MT
63openswan-2.4.7.kernel-2.6-natt.patch.gz = $(URL_IPFIRE)/openswan-2.4.7.kernel-2.6-natt.patch.gz
64openswan-2.4.7.kernel-2.6-klips.patch.gz = $(URL_IPFIRE)/openswan-2.4.7.kernel-2.6-klips.patch.gz
65patch-o-matic-ng-20061210.tar.bz2 = $(URL_IPFIRE)/patch-o-matic-ng-20061210.tar.bz2
f59e1e88
MT
66iptables-1.3.5.tar.bz2 = $(URL_IPFIRE)/iptables-1.3.5.tar.bz2
67kbc_option_2420.patch = $(URL_IPFIRE)/kbc_option_2420.patch
68net4801.kernel.patch_2.4.31 = $(URL_IPFIRE)/net4801.kernel.patch_2.4.31
c3e36980 69netfilter-layer7-v2.6.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.6.tar.gz
5e2e4494 70patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
df5e82b3 71
f59e1e88 72$(DL_FILE)_MD5 = 50695965725367f39007023feac5e256
552b817b 73patch-$(PATCHLEVEL).gz_MD5 = 1355ebc25ea57df398d20e1c1726ec9b
3a1019f6
MT
74openswan-2.4.7.kernel-2.6-natt.patch.gz_MD5 = 980d8bbdb29a761b7f5aa852f373df62
75openswan-2.4.7.kernel-2.6-klips.patch.gz_MD5 = 5df0ffa2453488a407a23fc4ea4af879
76patch-o-matic-ng-20061210.tar.bz2_MD5 = 76edac76301b45f89e467b41c8cf4393
f59e1e88
MT
77iptables-1.3.5.tar.bz2_MD5 = 00fb916fa8040ca992a5ace56d905ea5
78kbc_option_2420.patch_MD5 = 6d37870344f7fcf97ace1fbf43323c60
79net4801.kernel.patch_2.4.31_MD5 = c7d64e3caedb2f2b10e1c11db7f73a04
c3e36980 80netfilter-layer7-v2.6.tar.gz_MD5 = 58135cd1aafaf4ae2fa478159206f064
5e2e4494 81patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
df5e82b3
MT
82
83install : $(TARGET)
84
85check : $(patsubst %,$(DIR_CHK)/%,$(objects))
86
87download :$(patsubst %,$(DIR_DL)/%,$(objects))
88
89md5 : $(subst %,%_MD5,$(objects))
90
91###############################################################################
92# Downloading, checking, md5sum
93###############################################################################
94
95$(patsubst %,$(DIR_CHK)/%,$(objects)) :
96 @$(CHECK)
97
98$(patsubst %,$(DIR_DL)/%,$(objects)) :
99 @$(LOAD)
100
101$(subst %,%_MD5,$(objects)) :
102 @$(MD5)
103
104###############################################################################
105# Installation Details
106###############################################################################
107
108$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
109 @$(PREBUILD)
110 @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
8eec2184 111 ln -s linux-$(VER) /usr/src/linux
3a1019f6
MT
112
113 # Update kernel to latest patchlevel
f59e1e88
MT
114 cd $(DIR_APP) && zcat $(DIR_DL)/patch-$(PATCHLEVEL).gz | patch -p1
115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.16.27-utf8_input-1.patch
90c973a6
MT
116 # Remove patch level in EXTRAVERSION.
117 # We want to avoid the need to supply a full kernel
118 # (installed in a different place) if only one part could be updated
119 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =/' Makefile
df5e82b3 120 cd $(DIR_APP) && sed -i -e 's/-Werror//' drivers/scsi/aic7xxx/Makefile
3a1019f6 121 cd $(DIR_APP) && sed -i -e 's/gettext//' scripts/kconfig/lkc.h
df5e82b3 122
3a1019f6
MT
123 # Openswan 2
124 cd $(DIR_SRC) && rm -rf openswan-*
125 cd $(DIR_SRC) && tar xfz $(DIR_DL)/openswan-2.4.7.tar.gz
126 cd $(DIR_APP) && gzip -dc $(DIR_DL)/openswan-2.4.7.kernel-2.6-natt.patch.gz | patch -Np1
127 cd $(DIR_APP) && gzip -dc $(DIR_DL)/openswan-2.4.7.kernel-2.6-klips.patch.gz | patch -Np1
128 cd $(DIR_SRC)/openswan-* && sed -i -e 's/INC_USRLOCAL=\/usr\/local/INC_USRLOCAL=\/usr/' Makefile.inc
ac1cfefa 129
5e2e4494
MT
130 # H323 conntrack
131 cd $(DIR_APP) && bunzip2 -cd $(DIR_DL)/patch-2.6.16-nath323-1.3.bz2 | patch -Np1
132
26ec9513
MT
133 # SquashFS
134 cd $(DIR_SRC) && rm -rf squashfs*
135 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.0.tar.gz
136 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.0/linux-2.6.15/squashfs3.0-patch
137
df5e82b3
MT
138 # Patch-o-matic
139 cd $(DIR_SRC) && rm -rf iptables-*
f59e1e88 140 cd $(DIR_SRC) && tar xfj $(DIR_DL)/iptables-1.3.5.tar.bz2
df5e82b3
MT
141 cd $(DIR_SRC) && ln -sf iptables-1.3.5 iptables
142 cd $(DIR_SRC) && rm -rf patch-o-matic*
3a1019f6 143 cd $(DIR_SRC) && tar xfj $(DIR_DL)/patch-o-matic-ng-20061210.tar.bz2
3a1019f6
MT
144 cd $(DIR_SRC)/patch-o-matic-ng* && \
145 ./runme --batch --kernel-path=$(ROOT)/usr/src/$(THISAPP)/ --iptables-path=$(ROOT)/usr/src/iptables/ \
5e2e4494 146 TARPIT sip-conntrack-nat rtsp-conntrack-nat \
552b817b
MT
147 mms-conntrack-nat #quake3-conntrack-nat
148
3a1019f6 149 # Layer7-patch
f59e1e88
MT
150 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.6.tar.gz
151 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
df5e82b3 152
769a61c5 153 # ip_conntrack permissions from 440 to 444
552b817b 154 cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
769a61c5 155
3a1019f6 156ifeq "$(SMP)" ""
df5e82b3 157 # Only do this once on the non-SMP pass
ac1cfefa 158 cd $(DIR_SRC) && tar czf $(DIR_DL)/iptables-fixed.tar.gz iptables-1.3.5
df5e82b3
MT
159endif
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
167ifeq "$(SMP)" ""
df5e82b3
MT
168 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
169endif
3a1019f6 170ifeq "$(SMP)" "1"
df5e82b3
MT
171 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
172endif
df5e82b3
MT
173
174 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 175 cd $(DIR_APP) && make CC="$(KGCC)" clean
8eec2184 176 if [ "$(SMP)" = "" ]; then \
f59e1e88 177 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage; \
c3e36980
MT
178 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER); \
179 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER); \
180 cd $(DIR_APP) && cp -v .config /boot/config-$(VER); \
df5e82b3
MT
181 ln -sf vmlinuz-$(VER) /boot/vmlinuz; \
182 ln -sf System.map-$(VER) /boot/System.map; \
6b8cff41
MT
183 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules; \
184 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install; \
3a1019f6
MT
185 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) module; \
186 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) minstall; \
8eec2184 187 elif [ "$(SMP)" = "1" ]; then \
ac1cfefa 188 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =/EXTRAVERSION\ =\ -smp/' Makefile; \
f59e1e88 189 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage; \
c3e36980
MT
190 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-smp; \
191 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-smp; \
192 cd $(DIR_APP) && cp -v .config /boot/config-$(VER); \
ac1cfefa 193 ln -sf vmlinuz-$(VER)-smp /boot/vmlinuz-smp; \
6b8cff41
MT
194 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules; \
195 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install; \
3a1019f6
MT
196 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) module; \
197 cd $(DIR_SRC)/openswan-* && make KERNELSRC=/usr/src/$(THISAPP) CC=$(CC) minstall; \
df5e82b3 198 fi
3a1019f6 199
df5e82b3 200 # remove symlinked pcmcia directory
3a1019f6 201ifeq "$(SMP)" ""
df5e82b3 202 rm -rf /lib/modules/$(VER)/pcmcia
df5e82b3 203endif
3a1019f6 204ifeq "$(SMP)" "1"
df5e82b3 205 rm -rf /lib/modules/$(VER)-smp/pcmcia
df5e82b3 206endif
26ec9513 207 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs*
df5e82b3 208 @$(POSTBUILD)