@@ -95,6 +95,17 @@
matching linux-*.patch in the directory will be applied.
#
+# Pre-compile script
+#
+
+config BR2_LINUX_KERNEL_PRE_COMPILE_SCRIPT
+ string "Pre-compile script(s)"
+ help
+ A name of a script or the name of a directory containing one or
+ more scripts to be executed before kernel compilation
+ and after application of patches (if any).
+
+#
# Configuration selection
#
@@ -32,6 +32,7 @@
endif
LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))
+LINUX_PRE_SCRIPTS = $(call qstrip,$(BR2_LINUX_KERNEL_PRE_COMPILE_SCRIPT))
LINUX_INSTALL_IMAGES = YES
LINUX_DEPENDENCIES += host-module-init-tools
@@ -149,6 +150,21 @@
LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES
+define LINUX_PRE_COMPILE_SCRIPT
+ if test -d $(LINUX_PRE_SCRIPTS); then \
+ for s in `ls -1 $(LINUX_PRE_SCRIPTS)`; do \
+ echo "Calling script $(LINUX_PRE_SCRIPTS)/$$s"; \
+ $(LINUX_PRE_SCRIPTS)/$$s; \
+ done \
+ else \
+ echo "Calling script $$s"; \
+ $$s; \
+ fi
+endef
+
+LINUX_POST_PATCH_HOOKS += LINUX_PRE_COMPILE_SCRIPT
+
+
ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)