]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/linux
Build core15 with dnsmasq 2.45
[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
AF
27PATCHLEVEL = .17
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 \
4ce37908 51 squashfs3.3.tgz \
a6e9d42e 52 netfilter-layer7-v2.18.tar.gz \
38f05351
AF
53 patch-2.6.16-nath323-1.3.bz2
54
64cf4991 55$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
a6e9d42e 56netfilter-layer7-v2.18.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.18.tar.gz
4ce37908
MT
57patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
58squashfs3.3.tgz = $(URL_IPFIRE)/squashfs3.3.tgz
64cf4991 59mISDN-1_1_8.tar.gz = $(URL_IPFIRE)/mISDN-1_1_8.tar.gz
4ce37908 60
202f35e2 61$(DL_FILE)_MD5 = a0300a393ac91ce9c64bf31522b45e2e
a6e9d42e 62netfilter-layer7-v2.18.tar.gz_MD5 = 8d2e2c00f5c20e8c0852998035aeffd2
3185932e 63patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
4ce37908 64squashfs3.3.tgz_MD5 = 95c40fca0d886893631b5de14a0af25b
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)
3185932e 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
aaf38362 97 # Security fix for CIFS & Netfilter SNMP
f110a344 98 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.20.21-additional_check_on_BER_decoding.patch
aaf38362 99
202f35e2
AF
100 # Openswan nat-t
101 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.x.kernel-2.6.23-natt.patch
ac1cfefa 102
44254afd 103 # Reiser4
202f35e2 104 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.23.patch
3185932e
MT
105
106 # SquashFS
107 cd $(DIR_SRC) && rm -rf squashfs*
4ce37908 108 cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.3.tgz
202f35e2 109 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.3/kernel-patches/linux-2.6.23/squashfs3.3-patch
89069053 110
56b548f1 111 # ip_conntrack permissions from 440 to 444
64cf4991 112# cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch
3185932e 113
3a1019f6 114 # Layer7-patch
a6e9d42e
AF
115 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.18
116 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.18.tar.gz
64cf4991 117 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.18/for_older_kernels/kernel-2.6.22-2.6.24-layer7-2.18.patch
df5e82b3 118
6f300951 119 # Linux Intermediate Queueing Device
3185932e 120ifeq "$(XEN)" ""
202f35e2 121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.23-imq.diff
3185932e 122endif
769a61c5 123
1ee8bf5d 124 # mISDN
376e42ce 125 cd $(DIR_SRC) && rm -rf mISDN-*
64cf4991
AF
126 cd $(DIR_SRC) && tar xfz $(DIR_DL)/mISDN-1_1_8.tar.gz
127 cd $(DIR_SRC)/mISDN-1_1_8 && yes 'yes' | ./std2kern -k /usr/src/linux
7146d4a5
MT
128
129 cd $(DIR_APP)/drivers/isdn/hardware/mISDN && patch -Np0 < $(DIR_SRC)/src/patches/mISDN-avmfritz.patch
3185932e 130
df5e82b3
MT
131 # Cleanup kernel source
132 cd $(DIR_APP) && make mrproper
3a1019f6 133
3a1019f6 134ifeq "$(SMP)" "1"
df5e82b3 135 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config
6230f0da
MT
136else
137 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config
df5e82b3 138endif
df5e82b3
MT
139
140 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 141 cd $(DIR_APP) && make CC="$(KGCC)" clean
3a1019f6 142
3a1019f6 143ifeq "$(SMP)" "1"
376e42ce 144 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' Makefile
872e5216
MT
145 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
146 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire-smp
376e42ce 147 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp
c4166091 148 ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp
376e42ce
MT
149 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
150 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
376e42ce
MT
151else
152 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile
872e5216
MT
153 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
154 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire
376e42ce
MT
155 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire
156 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire
89069053 157 ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire
63817c2a 158 ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire
376e42ce
MT
159 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
160 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
df5e82b3 161endif
376e42ce 162
ee78a5ef
MT
163ifeq "$(SMP)" ""
164 # Only do this once on the non-SMP pass
81e974f3 165 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
ee78a5ef
MT
166endif
167
3185932e 168 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 169 @$(POSTBUILD)
64cf4991 170