Applied packages to make.sh.
[people/pmueller/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
6f876896
AF
27PATCHLEVEL = .21
28VER = 2.6.27.21
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# Top-level Rules
47###############################################################################
48objects =$(DL_FILE) \
9c534116 49 squashfs3.4.tar.gz \
d1fd2b03 50 netfilter-layer7-v2.21.tar.gz \
f418a984 51 patch-2.6.16-nath323-1.3.bz2 \
a3b414d3 52 reiser4-for-2.6.27.19.patch.bz2
38f05351 53
64cf4991 54$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
d1fd2b03 55netfilter-layer7-v2.21.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.tar.gz
4ce37908 56patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
9c534116 57squashfs3.4.tar.gz = $(URL_IPFIRE)/squashfs3.4.tar.gz
a3b414d3 58reiser4-for-2.6.27.19.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.27.19.patch.bz2
4ce37908 59
6f876896 60$(DL_FILE)_MD5 = 2912af7938fae1a3f2a9a6bcf8c0009f
d1fd2b03 61netfilter-layer7-v2.21.tar.gz_MD5 = 838422e7d9a06b42e682e9064e5210b5
3185932e 62patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
9c534116 63squashfs3.4.tar.gz_MD5 = 2a4d2995ad5aa6840c95a95ffa6b1da6
a3b414d3 64reiser4-for-2.6.27.19.patch.bz2_MD5 = 22988387f64f299489b90b484b2642cc
df5e82b3
MT
65
66install : $(TARGET)
67
68check : $(patsubst %,$(DIR_CHK)/%,$(objects))
69
70download :$(patsubst %,$(DIR_DL)/%,$(objects))
71
72md5 : $(subst %,%_MD5,$(objects))
73
f418a984
AF
74dist:
75 @$(PAK)
df5e82b3
MT
76###############################################################################
77# Downloading, checking, md5sum
78###############################################################################
79
80$(patsubst %,$(DIR_CHK)/%,$(objects)) :
81 @$(CHECK)
82
83$(patsubst %,$(DIR_DL)/%,$(objects)) :
84 @$(LOAD)
85
86$(subst %,%_MD5,$(objects)) :
87 @$(MD5)
88
89###############################################################################
90# Installation Details
91###############################################################################
92
93$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
94 @$(PREBUILD)
f418a984 95 @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
8eec2184 96 ln -s linux-$(VER) /usr/src/linux
3a1019f6 97
f418a984
AF
98 # Not report deprecated syscall 1.23 (for kudzu)
99 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
100
45ff5fa6 101 # Openswan
e4766bc5 102 #cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.x.kernel-2.6.23-natt.patch
ac1cfefa 103
44254afd 104 # Reiser4
a3b414d3 105 cd $(DIR_APP) && bzip2 -d -c $(DIR_DL)/reiser4-for-2.6.27.19.patch.bz2 | patch -Np1
f418a984 106
3185932e
MT
107 # SquashFS
108 cd $(DIR_SRC) && rm -rf squashfs*
9c534116 109 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.4.tar.gz
a3b414d3
AF
110 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.4/kernel-patches/linux-2.6.27-rc4/squashfs3.4-patch
111
112 # ip_conntrack permissions from 440 to 444
113# cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
89069053 114
4f1b7a27 115 # ipp2p 0.8.2-pomng
a3b414d3 116 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
4f1b7a27 117
3a1019f6 118 # Layer7-patch
d1fd2b03
AF
119 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
120 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.21/kernel-2.6.25-2.6.28-layer7-2.21.patch
df5e82b3 122
6f300951 123 # Linux Intermediate Queueing Device
3185932e 124ifeq "$(XEN)" ""
a3b414d3 125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27-imq.patch
3185932e 126endif
769a61c5 127
df5e82b3
MT
128 # Cleanup kernel source
129 cd $(DIR_APP) && make mrproper
3a1019f6 130
3a1019f6 131ifeq "$(SMP)" "1"
df5e82b3 132 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
6230f0da
MT
133else
134 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
df5e82b3 135endif
df5e82b3
MT
136
137 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 138 cd $(DIR_APP) && make CC="$(KGCC)" clean
3a1019f6 139
3a1019f6 140ifeq "$(SMP)" "1"
376e42ce 141 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile
872e5216
MT
142 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
143 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp
376e42ce 144 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp
c4166091 145 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
376e42ce
MT
146 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
147 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 148 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
376e42ce
MT
149else
150 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
872e5216
MT
151 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
152 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
376e42ce
MT
153 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
154 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
89069053 155 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
63817c2a 156 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
376e42ce
MT
157 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
158 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 159 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
df5e82b3 160endif
376e42ce 161
ee78a5ef
MT
162ifeq "$(SMP)" ""
163 # Only do this once on the non-SMP pass
81e974f3 164 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
ee78a5ef
MT
165endif
166
f418a984
AF
167 # Rename ide-cd module to match with old kernel
168 mv /lib/modules/$(VER)-ipfire/kernel/drivers/ide/ide-cd_mod.ko \
169 /lib/modules/$(VER)-ipfire/kernel/drivers/ide/ide-cd.ko
170
d644d86f
AF
171 # Remove mISDN modules
172 @rm -rf /lib/modules/$(VER)-ipfire/kernel/drivers/isdn/mISDN
173 @rm -rf /lib/modules/$(VER)-ipfire/kernel/drivers/isdn/hardware/mISDN
174
175 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 176 @$(POSTBUILD)
adf8eb98 177