kernel: Use prebuilt binaries
perl, lz4c, and a bunch of other binaries are not allowed anymore.
So we need to provide our own.
Change-Id: Idbc88b76247b3dda7c5d52e5eed2d548c33f6f2d
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
index dc3970d..a666b29 100644
--- a/build/soong/Android.bp
+++ b/build/soong/Android.bp
@@ -27,7 +27,7 @@
name: "generated_kernel_includes",
// The headers make command
- cmd: "$(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install",
+ cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install",
// Directories that can be imported by a cc_* module generated_headers property
export_include_dirs: ["usr/include", "usr/techpack/audio/include"],
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index 507c4b0..3ba45a0 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -187,6 +187,9 @@
TARGET_KERNEL_MODULES := INSTALLED_KERNEL_MODULES
endif
+# System tools are no longer allowed on 10+
+PATH_OVERRIDE += $(TOOLS_PATH_OVERRIDE)
+
KERNEL_ADDITIONAL_CONFIG_OUT := $(KERNEL_OUT)/.additional_config
# Internal implementation of make-kernel-target
diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk
index e0553cf..968bc5d 100644
--- a/config/BoardConfigKernel.mk
+++ b/config/BoardConfigKernel.mk
@@ -121,6 +121,11 @@
KERNEL_MAKE_FLAGS += $(TARGET_KERNEL_ADDITIONAL_FLAGS)
endif
+TOOLS_PATH_OVERRIDE := \
+ PATH=$(BUILD_TOP)/prebuilts/tools-lineage/$(HOST_OS)-x86/bin:$$PATH \
+ LD_LIBRARY_PATH=$(BUILD_TOP)/prebuilts/tools-lineage/$(HOST_OS)-x86/lib:$$LD_LIBRARY_PATH \
+ PERL5LIB=$(BUILD_TOP)/prebuilts/tools-lineage/$(HOST_OS)-x86/lib/perl-base
+
# Set DTBO image locations so the build system knows to build them
ifeq ($(TARGET_NEEDS_DTBOIMAGE),true)
BOARD_PREBUILT_DTBOIMAGE ?= $(PRODUCT_OUT)/dtbo/arch/$(KERNEL_ARCH)/boot/dtbo.img
diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk
index 6377f9d..fbdbd04 100644
--- a/config/BoardConfigSoong.mk
+++ b/config/BoardConfigSoong.mk
@@ -1,9 +1,12 @@
+PATH_OVERRIDE_SOONG := $(shell echo $(TOOLS_PATH_OVERRIDE) | sed -e 's|$$|$$$$|g')
+
# Add variables that we wish to make available to soong here.
EXPORT_TO_SOONG := \
KERNEL_ARCH \
KERNEL_CROSS_COMPILE \
KERNEL_MAKE_CMD \
KERNEL_MAKE_FLAGS \
+ PATH_OVERRIDE_SOONG \
TARGET_KERNEL_CONFIG \
TARGET_KERNEL_SOURCE