Disabled geode_aes kernel modul.
[people/pmueller/ipfire-2.x.git] / lfs / linux
CommitLineData
df5e82b3 1###############################################################################
df5e82b3 2# #
70df8302 3# IPFire.org - A linux based firewall #
26c1cc71 4# Copyright (C) 2010 IPFire Team <info@ipfire.org> #
70df8302
MT
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
cfa86dfd
AF
27PATCHLEVEL = .28
28VER = 2.6.32.28
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
acdf0e61 37PROG = linux-xen
9e9fca31 38PAK_VER = 16
acdf0e61 39DEPS = ""
bd9921dd
MT
40
41# Normal build or XEN build.
df5e82b3 42#
b0d0b681 43
26c1cc71
AF
44ifeq "$(PAE)" "1"
45 VERSUFIX=ipfire-pae
46else
3c4d4ed0
AF
47ifeq "$(XEN)" "1"
48 VERSUFIX=ipfire-xen
49else
50 VERSUFIX=ipfire
51endif
26c1cc71 52endif
b0d0b681 53
2b2e03ed 54TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
6230f0da 55
df5e82b3
MT
56###############################################################################
57# Top-level Rules
58###############################################################################
59objects =$(DL_FILE) \
b0d0b681 60 netfilter-layer7-v2.22.tar.gz \
f418a984 61 patch-2.6.16-nath323-1.3.bz2 \
b0d0b681 62 reiser4-for-2.6.32.patch.bz2 \
93337760 63 xen-patches-2.6.32-2d.tar.bz2
e69f1bf2 64
64cf4991 65$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
9b16f056 66netfilter-layer7-v2.22.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.22.tar.gz
4ce37908 67patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
b0d0b681 68reiser4-for-2.6.32.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.32.patch.bz2
93337760 69xen-patches-2.6.32-2d.tar.bz2 = $(URL_IPFIRE)/xen-patches-2.6.32-2d.tar.bz2
e69f1bf2 70
cfa86dfd 71$(DL_FILE)_MD5 = 9ee6d4023f34eb055ec32f201b5f9206
b0d0b681 72netfilter-layer7-v2.22.tar.gz_MD5 = 98dff8a3d5a31885b73341633f69501f
3185932e 73patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
b0d0b681 74reiser4-for-2.6.32.patch.bz2_MD5 = 3246397973d9271eb8e6d7c97c5d2d91
93337760 75xen-patches-2.6.32-2d.tar.bz2_MD5 = d1690d2b8b0c9124897981aea505f8f7
df5e82b3
MT
76
77install : $(TARGET)
78
79check : $(patsubst %,$(DIR_CHK)/%,$(objects))
80
81download :$(patsubst %,$(DIR_DL)/%,$(objects))
82
83md5 : $(subst %,%_MD5,$(objects))
84
f418a984
AF
85dist:
86 @$(PAK)
df5e82b3
MT
87###############################################################################
88# Downloading, checking, md5sum
89###############################################################################
90
91$(patsubst %,$(DIR_CHK)/%,$(objects)) :
92 @$(CHECK)
93
94$(patsubst %,$(DIR_DL)/%,$(objects)) :
95 @$(LOAD)
96
97$(subst %,%_MD5,$(objects)) :
98 @$(MD5)
99
100###############################################################################
101# Installation Details
102###############################################################################
103
104$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
105 @$(PREBUILD)
e69f1bf2 106 @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)
b0d0b681 107
8eec2184 108 ln -s linux-$(VER) /usr/src/linux
3a1019f6 109
3c4d4ed0 110ifeq "$(XEN)" "1"
de167abd
AF
111 # Apply gentoo Xen patches
112 mkdir -p $(DIR_SRC)/xen-patches
93337760 113 cd $(DIR_SRC)/xen-patches && tar jxf $(DIR_DL)/xen-patches-2.6.32-2d.tar.bz2
de167abd 114
9898206e 115 for x in `ls -1 $(DIR_SRC)/xen-patches/*.patch1`; do \
de167abd 116 echo "*********** [Patch: $$x]"; \
9898206e 117 cd $(DIR_APP) && pwd && patch -Np1 < $$x || exit 1; \
de167abd
AF
118 done
119 rm -rf $(DIR_SRC)/xen-patches
0e717101 120
3c4d4ed0 121 # Linux Intermediate Queueing Device
0e717101 122 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-imq-test2.patch
3c4d4ed0 123else
bd9921dd 124 # Linux Intermediate Queueing Device
b0d0b681 125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-imq-test2.patch
3c4d4ed0 126endif
bd9921dd 127
3c4d4ed0
AF
128 # Not report deprecated syscall 1.23 (for kudzu)
129 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.25.18-not_report_sysctl_1.23.patch
b0d0b681 130
0e717101
AF
131 # Reiser4 (don't check if fail (some patches are already in xen patchset)
132 -cd $(DIR_APP) && bzcat $(DIR_DL)/reiser4-for-2.6.32.patch.bz2 | patch -Np1
a3b414d3 133
4f1b7a27 134 # ipp2p 0.8.2-pomng
b0d0b681 135 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-ipp2p-0.8.2-pomng.patch
4f1b7a27 136
3a1019f6 137 # Layer7-patch
b0d0b681
AF
138 cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.22
139 cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.22.tar.gz
140 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch
df5e82b3 141
f0ed79fb
MT
142 # Add some more LED triggers
143 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.11-netdev-1.patch
144
f17cac4a
AF
145 # Huawei Android Phones (Vodafone V845, T-Mobile Pulse/mini ...)
146 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.15-option_add_huawei_android.patch
147
87837787 148 # Fix uevent PHYSDEVDRIVER
9256a1df 149 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_ipg-fix-driver-name.patch
87837787 150 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_mcs7830-fix-driver-name.patch
9256a1df 151
aa2049e5
MT
152 # Install ipfire logo
153 cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
154 drivers/video/logo/logo_linux_clut224.ppm
155
df5e82b3 156 # Cleanup kernel source
3a1019f6 157
2b2e03ed 158 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
bd9921dd 159 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 160 cd $(DIR_APP) && make CC="$(KGCC)" clean
2b2e03ed 161 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
3a1019f6 162
3c4d4ed0
AF
163ifeq "$(XEN)" "1"
164 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz
165 cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
166else
872e5216 167 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
2b2e03ed 168 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
3c4d4ed0 169endif
2b2e03ed
AF
170 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
171 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
172 ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
173 ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
376e42ce
MT
174 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
175 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 176 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
376e42ce 177
26c1cc71
AF
178ifneq "$(PAE)" "1"
179ifneq "$(XEN)" "1"
180 # Only do this once on the standard kernel pass
81e974f3 181 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
d644d86f 182
efa8b615 183 # Blacklist matroxfb_base
e2e106be 184 echo "blacklist matroxfb_base" >> /etc/modprobe.d/framebuffer
aa1dd878 185 # Blacklist old framebuffer modules
030a57c5
AF
186 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video -name *fb.ko); do \
187 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
188 done
aa1dd878
AF
189 # Blacklist new drm framebuffer modules
190 for f in $$(ls -1 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm/*/*.ko); do \
191 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
192 done
6886b70c 193 sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer
e2e106be
AF
194
195 # Blacklist isdn modules
196 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn -name *.ko); do \
197 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/isdn ; \
198 done
b29c22a4 199 sed -i -e "s|.ko||g" /etc/modprobe.d/isdn
78a51aaf
AF
200
201 # Disable ipv6 at runtime
202 echo "options ipv6 disable_ipv6=1" > /etc/modprobe.d/ipv6
203
030a57c5 204endif
26c1cc71
AF
205endif
206
207 # Remove mISDN modules
208 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
209 rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
030a57c5 210
8885467f
AF
211 # Disable geode_aes modul
212 mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko \
213 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko.off
214
d644d86f 215 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 216 @$(POSTBUILD)