]>
Commit | Line | Data |
---|---|---|
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 | ||
25 | include Config | |
26 | ||
4ce37908 MT |
27 | PATCHLEVEL = .21 |
28 | VER = 2.6.20.21 | |
df5e82b3 MT |
29 | |
30 | THISAPP = linux-$(VER) | |
376e42ce | 31 | DL_FILE = $(THISAPP).tar.bz2 |
a2cb3a33 | 32 | DL_FROM = $(URL_IPFIRE) |
df5e82b3 MT |
33 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
34 | CFLAGS = | |
35 | CXXFLAGS = | |
36 | ||
3a1019f6 | 37 | # Normal build or SMP build. |
df5e82b3 | 38 | # |
3a1019f6 | 39 | ifeq "$(SMP)" "1" |
376e42ce | 40 | TARGET = $(DIR_INFO)/linux-$(VER)-smp |
3a1019f6 | 41 | else |
376e42ce | 42 | TARGET = $(DIR_INFO)/linux-$(VER) |
df5e82b3 | 43 | endif |
6230f0da | 44 | |
df5e82b3 MT |
45 | |
46 | ############################################################################### | |
47 | # Top-level Rules | |
48 | ############################################################################### | |
49 | objects =$(DL_FILE) \ | |
ccdb878e | 50 | mISDN-1_1_5.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 | ||
6230f0da | 55 | $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE) |
a6e9d42e | 56 | netfilter-layer7-v2.18.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.18.tar.gz |
4ce37908 MT |
57 | patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2 |
58 | squashfs3.3.tgz = $(URL_IPFIRE)/squashfs3.3.tgz | |
59 | mISDN-1_1_5.tar.gz = $(URL_IPFIRE)/mISDN-1_1_5.tar.gz | |
4ce37908 MT |
60 | |
61 | $(DL_FILE)_MD5 = fbedc192e654735936cc780da8deeba4 | |
a6e9d42e | 62 | netfilter-layer7-v2.18.tar.gz_MD5 = 8d2e2c00f5c20e8c0852998035aeffd2 |
3185932e | 63 | patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138 |
4ce37908 MT |
64 | squashfs3.3.tgz_MD5 = 95c40fca0d886893631b5de14a0af25b |
65 | mISDN-1_1_5.tar.gz_MD5 = 93b1cff7817b82638a0475c2b7b7f1b6 | |
df5e82b3 MT |
66 | |
67 | install : $(TARGET) | |
68 | ||
69 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
70 | ||
71 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
72 | ||
73 | md5 : $(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 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 | ||
c138eec8 AF |
100 | # Temperatursensoren von Intel Core & Core 2 Prozessoren |
101 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.20-hwmon-coretemp.patch | |
102 | ||
40d4c454 AF |
103 | # Add USB ID of US-Robotics USR805423 to ZD1211 driver |
104 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.20.21-zd1211-usrobotics-usbid.patch | |
105 | ||
38f05351 | 106 | # Openswan nat-t |
4ce37908 | 107 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openswan-2.4.12.kernel-2.6.20.21-natt.patch |
ac1cfefa | 108 | |
44254afd | 109 | # Reiser4 |
4ce37908 | 110 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/reiser4-for-2.6.20.patch |
3185932e MT |
111 | |
112 | # SquashFS | |
113 | cd $(DIR_SRC) && rm -rf squashfs* | |
4ce37908 MT |
114 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/squashfs3.3.tgz |
115 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/squashfs3.3/kernel-patches/linux-2.6.20/squashfs3.3-patch | |
89069053 | 116 | |
56b548f1 | 117 | # ip_conntrack permissions from 440 to 444 |
3185932e MT |
118 | cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/ip_conntrack_standalone-patch-for-ipfire.patch |
119 | ||
3a1019f6 | 120 | # Layer7-patch |
a6e9d42e AF |
121 | cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.18 |
122 | cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.18.tar.gz | |
123 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.18/for_older_kernels/kernel-2.6.20-2.6.21-layer7-2.16.1.patch | |
df5e82b3 | 124 | |
6f300951 | 125 | # Linux Intermediate Queueing Device |
3185932e | 126 | ifeq "$(XEN)" "" |
4ce37908 | 127 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.20-imq.diff |
3185932e | 128 | endif |
769a61c5 | 129 | |
1ee8bf5d | 130 | # mISDN |
376e42ce | 131 | cd $(DIR_SRC) && rm -rf mISDN-* |
1b273e8f MT |
132 | cd $(DIR_SRC) && tar xfz $(DIR_DL)/mISDN-1_1_5.tar.gz |
133 | cd $(DIR_SRC)/mISDN-1_1_5 && yes 'yes' | ./std2kern -k /usr/src/linux | |
7146d4a5 MT |
134 | |
135 | cd $(DIR_APP)/drivers/isdn/hardware/mISDN && patch -Np0 < $(DIR_SRC)/src/patches/mISDN-avmfritz.patch | |
3185932e | 136 | |
df5e82b3 MT |
137 | # Cleanup kernel source |
138 | cd $(DIR_APP) && make mrproper | |
3a1019f6 | 139 | |
3a1019f6 | 140 | ifeq "$(SMP)" "1" |
df5e82b3 | 141 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE).smp $(DIR_APP)/.config |
6230f0da MT |
142 | else |
143 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE) $(DIR_APP)/.config | |
df5e82b3 | 144 | endif |
df5e82b3 MT |
145 | |
146 | cd $(DIR_APP) && make CC="$(KGCC)" oldconfig | |
df5e82b3 | 147 | cd $(DIR_APP) && make CC="$(KGCC)" clean |
3a1019f6 | 148 | |
3a1019f6 | 149 | ifeq "$(SMP)" "1" |
376e42ce | 150 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire-smp/' 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-smp | |
376e42ce | 153 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire-smp |
c4166091 | 154 | ln -sf vmlinuz-$(VER)-ipfire-smp /boot/vmlinuz-ipfire-smp |
376e42ce MT |
155 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules |
156 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
376e42ce MT |
157 | else |
158 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-ipfire/' Makefile | |
872e5216 MT |
159 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage |
160 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-ipfire | |
376e42ce MT |
161 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-ipfire |
162 | cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-ipfire | |
89069053 | 163 | ln -sf vmlinuz-$(VER)-ipfire /boot/vmlinuz-ipfire |
63817c2a | 164 | ln -sf System.map-$(VER)-ipfire /boot/System.map-ipfire |
376e42ce MT |
165 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules |
166 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
df5e82b3 | 167 | endif |
376e42ce | 168 | |
ee78a5ef MT |
169 | ifeq "$(SMP)" "" |
170 | # Only do this once on the non-SMP pass | |
81e974f3 | 171 | cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/ |
ee78a5ef MT |
172 | endif |
173 | ||
3185932e | 174 | @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/mISDN-* $(DIR_SRC)/netfilter-layer7-* |
df5e82b3 | 175 | @$(POSTBUILD) |