Merge branch 'master' into kernel-4.9
[ipfire-2.x.git] / lfs / linux
index a0968a1..e309cd5 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -40,15 +40,21 @@ CXXFLAGS   =
 PAK_VER    = 73
 DEPS      = ""
 
-KERNEL_ARCH = $(MACHINE)
-
-ifeq "$(MACHINE)" "i586"
+ifeq "$(BUILD_ARCH)" "i586"
        KERNEL_ARCH = i386
+else
+       KERNEL_ARCH = $(BUILD_ARCH)
+endif
+
+ifeq "$(BUILD_ARCH)" "aarch64"
+       HEADERS_ARCH = arm64
+else
+       HEADERS_ARCH = $(BUILD_PLATFORM)
 endif
 
 VERSUFIX=ipfire$(KCFG)
 
-ifeq "$(TOOLS)" "1"
+ifeq "$(TOOLCHAIN)" "1"
        TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools
        HEADERS_PREFIX = /tools
 else
@@ -56,12 +62,6 @@ else
        HEADERS_PREFIX = /usr
 endif
 
-ifeq "$(MACHINE_TYPE)" "arm"
-       HEADERS_ARCH=arm
-else
-       HEADERS_ARCH=x86
-endif
-
 ifeq "$(KCFG)" ""
 LASTKERNEL=1
 endif
@@ -69,6 +69,9 @@ ifeq "$(KCFG)" "-kirkwood"
 LASTKERNEL=1
 endif
 
+# The buildsystem does not correctly detect if our compiler supports plugins
+export DISABLE_PAX_PLUGINS=y
+
 ###############################################################################
 # Top-level Rules
 ###############################################################################
@@ -183,8 +186,11 @@ endif
 ifeq "$(KCFG)" "-rpi"
        # Apply Raspberry Pi kernel patches.
        cd $(DIR_APP) && xzcat $(DIR_DL)/rpi-patches-$(RPI_PATCHES).patch.xz | patch -Np1
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/linux-3.14.79-rpi-suspend-not-inline.patch
 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
@@ -198,7 +204,7 @@ else
                drivers/video/logo/logo_linux_clut224.ppm
 
        # Cleanup kernel source
-       cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
+       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
@@ -229,7 +235,7 @@ endif
        cd $(DIR_APP) && make $(MAKETUNING) modules_install
        cd $(DIR_APP) && make $(MAKETUNING) firmware_install
 
-ifeq "$(MACHINE_TYPE)" "arm"
+ifeq "$(BUILD_PLATFORM)" "arm"
        cd $(DIR_APP) && make $(MAKETUNING) dtbs
        cd $(DIR_APP) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
                                mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \