Files
bpfire/lfs/linux
Arne Fitzenreiter eaadeb5af0 kernel: update to 4.14.72
this commit has many important driver updates so we need to ship it fast...

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2018-09-27 08:03:45 +02:00

231 lines
8.6 KiB
Plaintext

###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 4.14.72
ARM_PATCHES = 4.14.72-ipfire0
THISAPP = linux-$(VER)
DL_FILE = linux-$(VER).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
CFLAGS =
CXXFLAGS =
PAK_VER = 78
DEPS = ""
HEADERS_ARCH = $(BUILD_PLATFORM)
KERNEL_ARCH = $(BUILD_ARCH)
KERNEL_TARGET = bzImage
ifeq "$(BUILD_ARCH)" "i586"
KERNEL_ARCH = i386
endif
ifeq "$(BUILD_ARCH)" "aarch64"
HEADERS_ARCH = arm64
KERNEL_ARCH = arm64
KERNEL_TARGET = Image
endif
ifeq "$(BUILD_ARCH)" "armv5tel"
KERNEL_ARCH = arm
KERNEL_TARGET = zImage
endif
VERSUFIX=ipfire$(KCFG)
ifeq "$(TOOLCHAIN)" "1"
TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools
HEADERS_PREFIX = $(TOOLS_DIR)
else
TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)
HEADERS_PREFIX = /usr
endif
ifeq "$(KCFG)" ""
LASTKERNEL=1
endif
ifeq "$(KCFG)" "-multi"
LASTKERNEL=1
endif
###############################################################################
# Top-level Rules
###############################################################################
objects =$(DL_FILE) \
arm-multi-patches-$(ARM_PATCHES).patch.xz
$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
arm-multi-patches-$(ARM_PATCHES).patch.xz = $(URL_IPFIRE)/arm-multi-patches-$(ARM_PATCHES).patch.xz
$(DL_FILE)_MD5 = 450b3f5f1124442dee768eaa097fd149
arm-multi-patches-$(ARM_PATCHES).patch.xz_MD5 = 889a8d49a63bf462067409887f8105bb
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
@$(PAK)
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) $(DIR_SRC)/linux && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
ln -svf linux-$(VER) $(DIR_SRC)/linux
# Linux Intermediate Queueing Device
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14-imq.diff
# Layer7-patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14-layer7.patch
# DVB Patches
cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
# Wlan Patches
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/backports-4.2.6-1_ath10k_remove_logspam.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-ath_ignore_eeprom_regd.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-iwlwifi-noibss_only_on_radar_chan.patch
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-rt2x00usb_suppress_queue_warnings.patch
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.39-add_libertas_uap.patch
# Add LED trigger
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.16-ledtrig_netdev.patch
# Fix igb and e1000e crash
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14.1-igb-e1000e_fix_lock_at_update_stats.patch
# cs5535audio spams syslog if no ac97 was present (geos router)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8_cs5535audio_fix_logspam_on_geos.patch
# Add PC Engines APU led support
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.9.8-apu_leds.patch
# Fix uevent PHYSDEVDRIVER
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-2.6.32.27_mcs7830-fix-driver-name.patch
ifeq "$(KCFG)" "-kirkwood"
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.10-mv_cesa_disable_failing_hmac_sha1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-4.14.40-kirkwood-dtb.patch
endif
ifeq "$(KCFG)" "-multi"
# Apply Arm-multiarch kernel patches.
cd $(DIR_APP) && xzcat $(DIR_DL)/arm-multi-patches-$(ARM_PATCHES).patch.xz | patch -Np1
endif
ifeq "$(BUILD_ARCH)" "aarch64"
# Apply Arm-multiarch kernel patches.
cd $(DIR_APP) && xzcat $(DIR_DL)/arm-multi-patches-$(ARM_PATCHES).patch.xz | patch -Np1
endif
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-3.14.79-amba-fix.patch
ifeq "$(KCFG)" "-headers"
# Install the header files
cd $(DIR_APP) && make ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH=dest headers_install
-mkdir -pv $(BUILDROOT)/$(HEADERS_PREFIX)/include
cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/$(HEADERS_PREFIX)/include
else
# Install ipfire logo
cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
drivers/video/logo/logo_linux_clut224.ppm
# Cleanup kernel source
cp $(DIR_SRC)/config/kernel/kernel.config.$(BUILD_ARCH)-$(VERSUFIX) $(DIR_APP)/.config
cd $(DIR_APP) && make oldconfig
cd $(DIR_APP) && make clean
cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ -$(VERSUFIX)/' Makefile
# Build the kernel
cd $(DIR_APP) && make $(MAKETUNING) $(KERNEL_TARGET) modules
# Install the kernel
cd $(DIR_APP) && cp -v arch/$(KERNEL_ARCH)/boot/$(KERNEL_TARGET) /boot/vmlinuz-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && make $(MAKETUNING) modules_install
ifeq "$(BUILD_PLATFORM)" "arm"
cd $(DIR_APP) && make $(MAKETUNING) dtbs
mkdir -p /boot/dtb-$(VER)-$(VERSUFIX)
cd $(DIR_APP)/arch/$(KERNEL_ARCH)/boot/dts && for f in $$(find -name "*.dtb"); do \
cp -v --parents $$f /boot/dtb-$(VER)-$(VERSUFIX)/ ; \
chmod 644 /boot/dtb-$(VER)-$(VERSUFIX)/$$f ; \
done
endif
ifeq "$(LASTKERNEL)" "1"
# Only do this once
cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
# disable drm by install drm to /bin/false because i915 ignore blacklisting
echo install drm /bin/false > /etc/modprobe.d/framebuffer.conf
# Blacklist old framebuffer modules
for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video/fbdev/ -name *.ko); do \
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer.conf ; \
done
# Blacklist new drm framebuffer modules
for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm -name *.ko); do \
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer.conf ; \
done
sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer.conf
# Disable ipv6 at runtime
echo "options ipv6 disable_ipv6=1" > /etc/modprobe.d/ipv6.conf
endif
endif
#force new build of external modules and initrd if the kernel was rebuild
-rm -f /usr/src/log/*-kmod-$(VER)-$(VERSUFIX)
-rm -f /usr/src/log/linux-initrd-$(VER)-$(VERSUFIX)
@rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
@$(POSTBUILD)