kernel: update to 3.2.28.
[people/teissler/ipfire-2.x.git] / lfs / linux
CommitLineData
df5e82b3 1###############################################################################
df5e82b3 2# #
70df8302 3# IPFire.org - A linux based firewall #
524ba44a 4# Copyright (C) 2007-2012 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
f00884a0 27VER = 3.2.28
fdecb907
AF
28
29RPI_PATCHES = linux-3.2-bootc-f23da7f
df5e82b3
MT
30
31THISAPP = linux-$(VER)
fdecb907 32DL_FILE = linux-$(VER).tar.bz2
a2cb3a33 33DL_FROM = $(URL_IPFIRE)
df5e82b3
MT
34DIR_APP = $(DIR_SRC)/$(THISAPP)
35CFLAGS =
36CXXFLAGS =
37
524ba44a 38PAK_VER = 20
acdf0e61 39DEPS = ""
bd9921dd 40
fdf0c7c1 41VERSUFIX=ipfire$(KCFG)
b0d0b681 42
51f9e7ac
MT
43ifeq "$(HEADERS)" "1"
44ifeq "$(TOOLS)" "1"
45 TARGET = $(DIR_INFO)/linux-libc-headers-$(VER)-$(VERSUFIX)-tools
46 HEADERS_PREFIX = /tools
47else
48 TARGET = $(DIR_INFO)/linux-libc-headers-$(VER)-$(VERSUFIX)
49 HEADERS_PREFIX = /usr
50endif
51else
52 TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
53endif
54
cc72d5cb 55ifeq "$(MACHINE_TYPE)" "arm"
51f9e7ac
MT
56 HEADERS_ARCH=arm
57else
58 HEADERS_ARCH=x86
59endif
6230f0da 60
bc8fe5ff
AF
61ifeq "$(KCFG)" ""
62LASTKERNEL=1
63endif
64ifeq "$(KCFG)" "-kirkwood"
65LASTKERNEL=1
66endif
67
df5e82b3
MT
68###############################################################################
69# Top-level Rules
70###############################################################################
71objects =$(DL_FILE) \
fdecb907
AF
72 rpi-patches-$(RPI_PATCHES).patch.xz
73
e69f1bf2 74
64cf4991 75$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
fdecb907 76rpi-patches-$(RPI_PATCHES).patch.xz = $(URL_IPFIRE)/rpi-patches-$(RPI_PATCHES).patch.xz
e69f1bf2 77
f00884a0 78$(DL_FILE)_MD5 = d387130f084f48fae7b2d1756f6c9257
fdecb907 79rpi-patches-$(RPI_PATCHES).patch.xz_MD5 = 5651c6411bb1cbdbfe4b2908c117aaf3
df5e82b3
MT
80
81install : $(TARGET)
82
83check : $(patsubst %,$(DIR_CHK)/%,$(objects))
84
85download :$(patsubst %,$(DIR_DL)/%,$(objects))
86
87md5 : $(subst %,%_MD5,$(objects))
88
f418a984
AF
89dist:
90 @$(PAK)
df5e82b3
MT
91###############################################################################
92# Downloading, checking, md5sum
93###############################################################################
94
95$(patsubst %,$(DIR_CHK)/%,$(objects)) :
96 @$(CHECK)
97
98$(patsubst %,$(DIR_DL)/%,$(objects)) :
99 @$(LOAD)
100
101$(subst %,%_MD5,$(objects)) :
102 @$(MD5)
103
104###############################################################################
105# Installation Details
106###############################################################################
107
108$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
109 @$(PREBUILD)
fdecb907 110 @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
b0d0b681 111
51f9e7ac 112 ln -svf linux-$(VER) $(DIR_SRC)/linux
3a1019f6 113
3c4d4ed0 114 # Linux Intermediate Queueing Device
fdecb907 115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-imq.patch
bd9921dd 116
fdecb907
AF
117 # ipp2p 0.8.2-ipfire
118 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.0-ipp2p-0.8.2-ipfire.patch
4f1b7a27 119
3a1019f6 120 # Layer7-patch
fdecb907 121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/netfilter_layer7_2.22_kernel3.0.patch
df5e82b3 122
f0ed79fb 123 # Add some more LED triggers
fdecb907 124# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.11-netdev-1.patch
f0ed79fb 125
f17cac4a
AF
126 # Huawei Android Phones (Vodafone V845, T-Mobile Pulse/mini ...)
127 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.15-option_add_huawei_android.patch
128
87837787 129 # Fix uevent PHYSDEVDRIVER
fdecb907 130# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_ipg-fix-driver-name.patch
87837787 131 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_mcs7830-fix-driver-name.patch
9256a1df 132
bc8fe5ff 133ifeq "$(KCFG)" "-kirkwood"
c05f6df0 134 # Add dreamplug,guruplug and icy 62x0 support on ARM-kirkwood
cc7e3a98 135 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2.25-arm_kirkwood_setups.patch
8e6fb99d
AF
136endif
137
7fbc483a
AF
138ifeq "$(MACHINE_TYPE)" "arm"
139 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.45_align_ssb_modtable_32bit_boundary.patch
fdecb907
AF
140
141 # Reverse some asm optimizations that are incompatible with older gcc
142 cd $(DIR_APP) && patch -p1 -R < $(DIR_SRC)/src/patches/linux-2.6-arm-asm-constraint.patch
143endif
144
145ifeq "$(KCFG)" "-omap"
146 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0001-panda-wlan-fix.patch
147 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0002-panda-i2c.patch
148 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-panda-reboot.patch
149 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch
150endif
151
152ifeq "$(KCFG)" "-rpi"
153 # Apply Raspberry Pi kernel patches.
154 cd $(DIR_APP) && xzcat $(DIR_DL)/rpi-patches-$(RPI_PATCHES).patch.xz | patch -Np1
155 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-bcm2835-alsamixer.patch
156 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-bcm2835-limit_volume.patch
7fbc483a 157endif
8e6fb99d 158
51f9e7ac
MT
159ifeq "$(HEADERS)" "1"
160 # Install the header files
161 cd $(DIR_APP) && make ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH=dest headers_install
162 -mkdir -pv $(BUILDROOT)/$(HEADERS_PREFIX)/include
163 cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
164 cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/$(HEADERS_PREFIX)/include
165else
166
aa2049e5
MT
167 # Install ipfire logo
168 cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
169 drivers/video/logo/logo_linux_clut224.ppm
170
df5e82b3 171 # Cleanup kernel source
2b2e03ed 172 cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
bd9921dd 173 cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
df5e82b3 174 cd $(DIR_APP) && make CC="$(KGCC)" clean
fdecb907 175 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
3a1019f6 176
bc8fe5ff 177ifeq "$(KCFG)" "-kirkwood"
8e6fb99d
AF
178 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage
179 cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
bc8fe5ff
AF
180 cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
181else
fdecb907
AF
182ifeq "$(KCFG)" "-omap"
183 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage
184 cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
185 cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
186else
187ifeq "$(KCFG)" "-rpi"
188 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage
189 cd /boot && cat first32k.bin $(DIR_APP)/arch/arm/boot/Image > kernel.img
190 cd $(DIR_APP) && cp -v /boot/kernel.img /boot/vmlinuz-$(VER)-$(VERSUFIX)
92655908 191else
8e6fb99d 192 cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
2b2e03ed 193 cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
92655908 194endif
bc8fe5ff 195endif
3c4d4ed0 196endif
2b2e03ed
AF
197 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
198 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
199 ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
200 ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
376e42ce
MT
201 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
202 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
a3b414d3 203 cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
376e42ce 204
bc8fe5ff
AF
205ifeq "$(LASTKERNEL)" "1"
206 # Only do this once
81e974f3 207 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
d644d86f 208
efa8b615 209 # Blacklist matroxfb_base
e2e106be 210 echo "blacklist matroxfb_base" >> /etc/modprobe.d/framebuffer
aa1dd878 211 # Blacklist old framebuffer modules
030a57c5
AF
212 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video -name *fb.ko); do \
213 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
214 done
aa1dd878
AF
215 # Blacklist new drm framebuffer modules
216 for f in $$(ls -1 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm/*/*.ko); do \
217 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
218 done
6886b70c 219 sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer
e2e106be
AF
220
221 # Blacklist isdn modules
222 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn -name *.ko); do \
223 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/isdn ; \
224 done
b29c22a4 225 sed -i -e "s|.ko||g" /etc/modprobe.d/isdn
78a51aaf
AF
226
227 # Disable ipv6 at runtime
228 echo "options ipv6 disable_ipv6=1" > /etc/modprobe.d/ipv6
26c1cc71
AF
229endif
230
cc72d5cb 231ifneq "$(MACHINE_TYPE)" "arm"
8885467f
AF
232 # Disable geode_aes modul
233 mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko \
234 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko.off
2f5e1d43 235endif
51f9e7ac 236endif
8885467f 237
d644d86f 238 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
df5e82b3 239 @$(POSTBUILD)