]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - lfs/linux
kernel: update to 4.14.40
[ipfire-2.x.git] / lfs / linux
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
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
25include Config
26
27VER = 4.14.40
28ARM_PATCHES = 4.14.40-ipfire0
29
30THISAPP = linux-$(VER)
31DL_FILE = linux-$(VER).tar.xz
32DL_FROM = $(URL_IPFIRE)
33DIR_APP = $(DIR_SRC)/$(THISAPP)
34CFLAGS =
35CXXFLAGS =
36
37PAK_VER = 73
38DEPS = ""
39
40ifeq "$(BUILD_ARCH)" "i586"
41 KERNEL_ARCH = i386
42else
43 KERNEL_ARCH = $(BUILD_ARCH)
44endif
45
46ifeq "$(BUILD_ARCH)" "aarch64"
47 HEADERS_ARCH = arm64
48else
49 HEADERS_ARCH = $(BUILD_PLATFORM)
50endif
51
52VERSUFIX=ipfire$(KCFG)
53
54ifeq "$(TOOLCHAIN)" "1"
55 TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools
56 HEADERS_PREFIX = $(TOOLS_DIR)
57else
58 TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
59 HEADERS_PREFIX = /usr
60endif
61
62ifeq "$(KCFG)" ""
63LASTKERNEL=1
64endif
65ifeq "$(KCFG)" "-multi"
66LASTKERNEL=1
67endif
68
69###############################################################################
70# Top-level Rules
71###############################################################################
72objects =$(DL_FILE) \
73 arm-multi-patches-$(ARM_PATCHES).patch.xz
74
75$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
76arm-multi-patches-$(ARM_PATCHES).patch.xz = $(URL_IPFIRE)/arm-multi-patches-$(ARM_PATCHES).patch.xz
77
78$(DL_FILE)_MD5 = 8376ed89777760443a359edb1d08ed9a
79arm-multi-patches-$(ARM_PATCHES).patch.xz_MD5 = ae7091bb79bad05c8394c8bacc48dd60
80
81install : $(TARGET)
82
83check : $(patsubst %,$(DIR_CHK)/%,$(objects))
84
85download :$(patsubst %,$(DIR_DL)/%,$(objects))
86
87md5 : $(subst %,%_MD5,$(objects))
88
89dist:
90 @$(PAK)
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)
110 @rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
111
112 ln -svf linux-$(VER) $(DIR_SRC)/linux
113
114 # Linux Intermediate Queueing Device
115 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14-imq.diff
116
117 # Layer7-patch
118 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14-layer7.patch
119
120 # DVB Patches
121 cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
122
123 # Wlan Patches
124# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/backports-4.2.6-1_ath10k_remove_logspam.patch
125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-ath_ignore_eeprom_regd.patch
126 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-iwlwifi-noibss_only_on_radar_chan.patch
127# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-rt2x00usb_suppress_queue_warnings.patch
128# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.39-add_libertas_uap.patch
129
130 # Add LED trigger
131 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.16-ledtrig_netdev.patch
132
133 # Fix igb and e1000e crash
134 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14.1-igb-e1000e_fix_lock_at_update_stats.patch
135
136 # cs5535audio spams syslog if no ac97 was present (geos router)
137 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8_cs5535audio_fix_logspam_on_geos.patch
138
139 # Add PC Engines APU led support
140 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-apu_leds.patch
141
142 # Fix uevent PHYSDEVDRIVER
143 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-2.6.32.27_mcs7830-fix-driver-name.patch
144
145ifeq "$(KCFG)" "-kirkwood"
146# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.10-mv_cesa_disable_failing_hmac_sha1.patch
147endif
148
149ifeq "$(KCFG)" "-multi"
150 # Apply Arm-multiarch kernel patches.
151 cd $(DIR_APP) && xzcat $(DIR_DL)/arm-multi-patches-$(ARM_PATCHES).patch.xz | patch -Np1
152endif
153 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-3.14.79-amba-fix.patch
154
155ifeq "$(KCFG)" "-headers"
156 # Install the header files
157 cd $(DIR_APP) && make ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH=dest headers_install
158 -mkdir -pv $(BUILDROOT)/$(HEADERS_PREFIX)/include
159 cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
160 cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/$(HEADERS_PREFIX)/include
161else
162
163 # Install ipfire logo
164 cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
165 drivers/video/logo/logo_linux_clut224.ppm
166
167 # Cleanup kernel source
168 cp $(DIR_SRC)/config/kernel/kernel.config.$(BUILD_ARCH)-$(VERSUFIX) $(DIR_APP)/.config
169 cd $(DIR_APP) && make oldconfig
170 cd $(DIR_APP) && make clean
171 cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
172
173ifeq "$(KCFG)" "-kirkwood"
174 cd $(DIR_APP) && make $(MAKETUNING) zImage modules
175 cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
176# cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
177else
178ifeq "$(KCFG)" "-multi"
179 cd $(DIR_APP) && make $(MAKETUNING) zImage modules
180 cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
181else
182 cd $(DIR_APP) && make $(MAKETUNING) bzImage modules
183 cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
184endif
185endif
186
187 cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
188 cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
189 cd $(DIR_APP) && make $(MAKETUNING) modules_install
190
191ifeq "$(BUILD_PLATFORM)" "arm"
192 cd $(DIR_APP) && make $(MAKETUNING) dtbs
193 cd $(DIR_APP) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
194 mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \
195 install -m 644 $$f /boot/dtb-$(VER)-$(VERSUFIX)/ ; \
196 done
197endif
198
199ifeq "$(LASTKERNEL)" "1"
200 # Only do this once
201 cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
202
203 # disable drm by install drm to /bin/false because i915 ignore blacklisting
204 echo install drm /bin/false > /etc/modprobe.d/framebuffer.conf
205
206 # Blacklist old framebuffer modules
207 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video/fbdev/ -name *.ko); do \
208 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer.conf ; \
209 done
210 # Blacklist new drm framebuffer modules
211 for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm -name *.ko); do \
212 echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer.conf ; \
213 done
214 sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer.conf
215
216 # Disable ipv6 at runtime
217 echo "options ipv6 disable_ipv6=1" > /etc/modprobe.d/ipv6.conf
218endif
219endif
220
221 #force new build of external modules and initrd if the kernel was rebuild
222 -rm -f /usr/src/log/*-kmod-$(VER)-$(VERSUFIX)
223 -rm -f /usr/src/log/linux-initrd-$(VER)-$(VERSUFIX)
224
225 @rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
226 @$(POSTBUILD)