Commit 6047f5a0 authored by LuK1337's avatar LuK1337 Committed by Łukasz Patron
Browse files

kernel: Consider depmod version when handling kernel modules

* This fixes dirty boot image rebuilding on devices
  with CONFIG_LOCALVERSION_AUTO=y and any driver
  set to =m.
* Basically appending `cat include/config/kernel.release`
  to modules path makes sure that our find does not
  return old modules which would make cp fail with
  'cp: will not overwrite just-created' message.

Change-Id: Ifb79d33b95d7671d8b2d6633644c8b8290d1f442
parent 19c36cd7
......@@ -66,6 +66,7 @@ SELINUX_DEFCONFIG := $(TARGET_KERNEL_SELINUX_CONFIG)
## Internal variables
KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
KERNEL_CONFIG := $(KERNEL_OUT)/.config
KERNEL_RELEASE := $(KERNEL_OUT)/include/config/kernel.release
ifeq ($(KERNEL_ARCH),x86_64)
KERNEL_DEFCONFIG_ARCH := x86
......@@ -246,7 +247,8 @@ INSTALLED_KERNEL_MODULES: depmod-host
$(hide) if grep -q '=m' $(KERNEL_CONFIG); then \
echo "Installing Kernel Modules"; \
$(call make-kernel-target,INSTALL_MOD_PATH=$(MODULES_INTERMEDIATES) modules_install); \
modules=$$(find $(MODULES_INTERMEDIATES) -type f -name '*.ko'); \
kernel_release=$$(cat $(KERNEL_RELEASE)) \
modules=$$(find $(MODULES_INTERMEDIATES)/lib/modules/$$kernel_release -type f -name '*.ko'); \
for f in $$modules; do \
$(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $$f; \
done; \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment