Merge branch 'master' into openswan
[people/teissler/ipfire-2.x.git] / lfs / linux
CommitLineData
df5e82b3 1###############################################################################
df5e82b3 2# #
70df8302
MT
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
5# #
6# This program is free software: you can redistribute it and/or modify #
df5e82b3 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
df5e82b3
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
df5e82b3
MT
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
df5e82b3 18# #
df5e82b3
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
202f35e2 27PATCHLEVEL = .17
a23731d1 28VER = 2.6.23.17
df5e82b3
MT
29
30THISAPP = linux-$(VER)
376e42ce 31DL_FILE = $(THISAPP).tar.bz2
a2cb3a33 32DL_FROM = $(URL_IPFIRE)
df5e82b3
MT
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34CFLAGS =
35CXXFLAGS =
36
3a1019f6 37# Normal build or SMP build.
df5e82b3 38#
3a1019f6 39ifeq "$(SMP)" "1"
376e42ce 40 TARGET = $(DIR_INFO)/linux-$(VER)-smp
3a1019f6 41else
376e42ce 42 TARGET = $(DIR_INFO)/linux-$(VER)
df5e82b3 43endif
6230f0da 44
df5e82b3
MT
45
46###############################################################################
47# Top-level Rules
48###############################################################################
49objects =$(DL_FILE) \
64cf4991 50 mISDN-1_1_8.tar.gz \
9c534116
AF
51 squashfs3.4.tar.gz \
52 netfilter-layer7-v2.20.tar.gz \
a23731d1 53 patch-2.6.16-nath323-1.3.bz2
38f05351 54
64cf4991 55$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
9c534116 56netfilter-layer7-v2.20.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.20.tar.gz
4ce37908 57patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
9c534116 58squashfs3.4.tar.gz = $(URL_IPFIRE)/squashfs3.4.tar.gz
64cf4991 59mISDN-1_1_8.tar.gz = $(URL_IPFIRE)/mISDN-1_1_8.tar.gz
4ce37908 60
a23731d1 61$(DL_FILE)_MD5 = a0300a393ac91ce9c64bf31522b45e2e
9c534116 62netfilter-layer7-v2.20.tar.gz_MD5 = 525a821c973b730c8feaf9eedb57d1e4
3185932e 63patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
9c534116 64squashfs3.4.tar.gz_MD5 = 2a4d2995ad5aa6840c95a95ffa6b1da6
64cf4991 65mISDN-1_1_8.tar.gz_MD5 = 29c55ffe0b35668a41eaed3b1c3ddfe2
df5e82b3
MT
66
67install : $(TARGET)
68
69check : $(patsubst %,$(DIR_CHK)/%,$(objects))
70
71download :$(patsubst %,$(DIR_DL)/%,$(objects))
72
73md5 : $(subst %,%_MD5,$(objects))
74
75###############################################################################
76# Downloading, checking, md5sum
77###############################################################################
78
79$(patsubst %,$(DIR_CHK)/%,$(objects)) :
80 @$(CHECK)
81
82$(patsubst %,$(DIR_DL)/%,$(objects)) :
83 @$(LOAD)
84
85$(subst %,%_MD5,$(objects)) :
86 @$(MD5)
87
88###############################################################################
89# Installation Details
90###############################################################################
91
92$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
93 @$(PREBUILD)
458f04f2 94 @rm -rf $(DIR_APP) $(DIR_SRC)/linux* $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
8eec2184 95 ln -s linux-$(VER) /usr/src/linux
3a1019f6 96
a23731d1
AF
97 # Security fix for CIFS & Netfilter SNMP
98 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.20.21-additional_check_on_BER_decoding.patch
99
100 # Add devolo MicroLink ADSL Fun USB ID's to ueagle-atm
101 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.23-ueagle-atm-devolo_usb_id.patch
102
0c2b766c
AF
103 # Fix crash on Twinhead H12Y notebooks
104 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-h12y-mmio-quirks.patch
105
45ff5fa6 106 # Openswan
202f35e2 107 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.x.kernel-2.6.23-natt.patch
ac1cfefa 108
44254afd 109 # Reiser4
a23731d1
AF
110 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.23.patch
111
3185932e
MT
112 # SquashFS
113 cd $(DIR_SRC) && rm -rf squashfs*
9c534116 114 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.4.tar.gz
a23731d1 115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.4/kernel-patches/linux-2.6.23/squashfs3.4-patch
89069053 116
56b548f1 117 # ip_conntrack permissions from 440 to 444
64cf4991 118# cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
3185932e 119
4f1b7a27
AF
120 # ipp2p 0.8.2-pomng
121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.23.17-ipp2p-0.8.2-pomng.patch
122
3a1019f6 123 # Layer7-patch
9c534116
AF
124 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.20
125 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.20.tar.gz
a23731d1 126 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.20/for_older_kernels/kernel-2.6.22-2.6.24-layer7-2.18.patch
df5e82b3 127
6f300951 128 # Linux Intermediate Queueing Device
3185932e 129ifeq "$(XEN)" ""
a23731d1 130 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.23-imq.diff
3185932e 131endif
769a61c5 132
1ee8bf5d 133 # mISDN
376e42ce 134 cd $(DIR_SRC) && rm -rf mISDN-*
64cf4991
AF
135 cd $(DIR_SRC) && tar xfz $(DIR_DL)/mISDN-1_1_8.tar.gz
136 cd $(DIR_SRC)/mISDN-1_1_8 && yes 'yes' | ./std2kern -k /usr/src/linux
7146d4a5
MT
137
138 cd $(DIR_APP)/drivers/isdn/hardware/mISDN && patch -Np0 < $(DIR_SRC)/src/patches/mISDN-avmfritz.patch
3185932e 139
df5e82b3
MT
140 # Cleanup kernel source
141 cd $(DIR_APP) && make mrproper
3a1019f6 142
3a1019f6 143ifeq "$(SMP)" "1"
df5e82b3 144 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
6230f0da
MT
145else
146 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
df5e82b3 147endif
df5e82b3
MT
148
149 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 150 cd $(DIR_APP) && make CC="$(KGCC)" clean
3a1019f6 151
3a1019f6 152ifeq "$(SMP)" "1"
376e42ce 153 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile
872e5216
MT
154 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
155 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp
376e42ce 156 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp
c4166091 157 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
376e42ce
MT
158 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
159 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
376e42ce
MT
160else
161 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
872e5216
MT
162 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
163 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
376e42ce
MT
164 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
165 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
89069053 166 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
63817c2a 167 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
376e42ce
MT
168 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
169 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
df5e82b3 170endif
376e42ce 171
ee78a5ef
MT
172ifeq "$(SMP)" ""
173 # Only do this once on the non-SMP pass
81e974f3 174 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
ee78a5ef
MT
175endif
176
3185932e 177 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 178 @$(POSTBUILD)