]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # # | |
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 # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation, either version 3 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # This program is distributed in the hope that it will be useful, # | |
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 # | |
17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
18 | # # | |
19 | ############################################################################### | |
20 | ||
21 | ############################################################################### | |
22 | # Definitions | |
23 | ############################################################################### | |
24 | ||
25 | include Config | |
26 | ||
27 | PATCHLEVEL = .8 | |
28 | VER = 2.6.32.8 | |
29 | ||
30 | THISAPP = linux-$(VER) | |
31 | DL_FILE = $(THISAPP).tar.bz2 | |
32 | DL_FROM = $(URL_IPFIRE) | |
33 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
34 | CFLAGS = | |
35 | CXXFLAGS = | |
36 | ||
37 | PROG = linux-xen | |
38 | PAK_VER = 8 | |
39 | DEPS = "" | |
40 | ||
41 | # Normal build or XEN build. | |
42 | # | |
43 | ||
44 | ifeq "$(XEN)" "1" | |
45 | VERSUFIX=ipfire-xen | |
46 | else | |
47 | VERSUFIX=ipfire | |
48 | endif | |
49 | ||
50 | TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX) | |
51 | ||
52 | ############################################################################### | |
53 | # Top-level Rules | |
54 | ############################################################################### | |
55 | objects =$(DL_FILE) \ | |
56 | netfilter-layer7-v2.22.tar.gz \ | |
57 | patch-2.6.16-nath323-1.3.bz2 \ | |
58 | reiser4-for-2.6.32.patch.bz2 \ | |
59 | squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 \ | |
60 | linux-$(VER)-suse_xen_patches-1.tar.bz2 | |
61 | ||
62 | $(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE) | |
63 | netfilter-layer7-v2.22.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.21.tar.gz | |
64 | patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2 | |
65 | reiser4-for-2.6.32.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.32.patch.bz2 | |
66 | squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 = $(URL_IPFIRE)/squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 | |
67 | linux-$(VER)-suse_xen_patches-1.tar.bz2 = $(URL_IPFIRE)/linux-$(VER)-suse_xen_patches-1.tar.bz2 | |
68 | ||
69 | $(DL_FILE)_MD5 = 82023ede52f067fcc55c5e70b02e48ae | |
70 | netfilter-layer7-v2.22.tar.gz_MD5 = 98dff8a3d5a31885b73341633f69501f | |
71 | patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138 | |
72 | reiser4-for-2.6.32.patch.bz2_MD5 = 3246397973d9271eb8e6d7c97c5d2d91 | |
73 | squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2_MD5 = d2a84311081023c7ffd28cdca67c45d4 | |
74 | linux-$(VER)-suse_xen_patches-1.tar.bz2_MD5 = 0bf813cbfef22f37e5060daa7dad0496 | |
75 | ||
76 | install : $(TARGET) | |
77 | ||
78 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
79 | ||
80 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
81 | ||
82 | md5 : $(subst %,%_MD5,$(objects)) | |
83 | ||
84 | dist: | |
85 | @$(PAK) | |
86 | ############################################################################### | |
87 | # Downloading, checking, md5sum | |
88 | ############################################################################### | |
89 | ||
90 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
91 | @$(CHECK) | |
92 | ||
93 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
94 | @$(LOAD) | |
95 | ||
96 | $(subst %,%_MD5,$(objects)) : | |
97 | @$(MD5) | |
98 | ||
99 | ############################################################################### | |
100 | # Installation Details | |
101 | ############################################################################### | |
102 | ||
103 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
104 | @$(PREBUILD) | |
105 | @rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/linux-*-suse_xen_patches $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
106 | ||
107 | ln -s linux-$(VER) /usr/src/linux | |
108 | ||
109 | ifeq "$(XEN)" "1" | |
110 | # Apply Xen patches (provided by SuSE) | |
111 | cd $(DIR_SRC) && tar jxf $(DIR_DL)/linux-$(VER)-suse_xen_patches-1.tar.bz2 | |
112 | cp -f $(DIR_SRC)/src/patches/suse_xen_series.conf $(DIR_SRC)/linux-$(VER)-suse_xen_patches/series.conf | |
113 | cd $(DIR_SRC)/linux-$(VER)-suse_xen_patches && \ | |
114 | for x in $$( ./guards $$( ./arch-symbols) < ./series.conf); do \ | |
115 | echo "*********** [Patch: $$x]"; \ | |
116 | patch -d $(DIR_APP) -p1 < $$x || break; \ | |
117 | done | |
118 | rm -rf $(DIR_SRC)/linux-*-suse_xen_patches | |
119 | ||
120 | # Fix strange patchset errors | |
121 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-patch-fixes.patch | |
122 | ||
123 | # Linux Intermediate Queueing Device | |
124 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-imq-test2.patch | |
125 | else | |
126 | # Linux Intermediate Queueing Device | |
127 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-imq-test2.patch | |
128 | endif | |
129 | ||
130 | # # Add Vodafone K3565-Z USB ID's to option driver | |
131 | # cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.25-option_add_vf-k3565-z_usbids.patch | |
132 | ||
133 | # Not report deprecated syscall 1.23 (for kudzu) | |
134 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch | |
135 | ||
136 | # Reiser4 (don't check if fail (some patches are already in xen patchset) | |
137 | -cd $(DIR_APP) && bzcat $(DIR_DL)/reiser4-for-2.6.32.patch.bz2 | patch -Np1 | |
138 | ||
139 | # ipp2p 0.8.2-pomng | |
140 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-ipp2p-0.8.2-pomng.patch | |
141 | ||
142 | # Layer7-patch | |
143 | cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.22 | |
144 | cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.22.tar.gz | |
145 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch | |
146 | ||
147 | # Squashfs LZMA support | |
148 | cd $(DIR_APP) && bzcat $(DIR_DL)/squashfs-lzma-linux-2.6.32-kernel-patches.tar.bz2 | patch -Np1 | |
149 | ||
150 | # Cleanup kernel source | |
151 | ||
152 | cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config | |
153 | cd $(DIR_APP) && make CC="$(KGCC)" oldconfig | |
154 | cd $(DIR_APP) && make CC="$(KGCC)" clean | |
155 | cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile | |
156 | ||
157 | ifeq "$(XEN)" "1" | |
158 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz | |
159 | cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX) | |
160 | else | |
161 | cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage | |
162 | cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX) | |
163 | endif | |
164 | cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX) | |
165 | cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX) | |
166 | ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX) | |
167 | ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX) | |
168 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules | |
169 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install | |
170 | cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install | |
171 | ||
172 | ifeq "$(XEN)" "" | |
173 | # Only do this once on the non-XEN pass | |
174 | cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/ | |
175 | endif | |
176 | ||
177 | # Rename ide-cd module to match with old kernel | |
178 | mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd_mod.ko \ | |
179 | /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-cd.ko | |
180 | mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-gd_mod.ko \ | |
181 | /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/ide/ide-disk.ko | |
182 | ||
183 | # # Remove mISDN modules | |
184 | # rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN | |
185 | # rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN | |
186 | ||
187 | @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-* | |
188 | @$(POSTBUILD) |