From 2b04bf4725da85f74680f5e0736cb99da5d06eb6 Mon Sep 17 00:00:00 2001 From: Xu Chao Date: Thu, 6 Jul 2017 14:34:31 +0800 Subject: [PATCH] Move build-image-kernel-modules out of recovery macro build-image-kernel-modules is defined under recovery macro when build without recovery,the driver kos are not packed into the vendor image Test: build with TARGET_NO_RECOVERY on and set ko to be build in BOARD_VENDOR_KERNEL_MODULES to see if kos are packed into vendor image Change-Id: I162ccb2fe50c09ece07b6b07e416721985228006 --- core/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/core/Makefile b/core/Makefile index 82d68a35b..dacb9681e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -967,6 +967,23 @@ $(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\ $(if $(2),$(hide) $(foreach kv,$(2),echo "$(kv)" >> $(1);)) endef +# $(1): modules list +# $(2): output dir +# $(3): mount point +# $(4): staging dir +# Depmod requires a well-formed kernel version so 0.0 is used as a placeholder. +define build-image-kernel-modules + $(hide) rm -rf $(2)/lib/modules + $(hide) mkdir -p $(2)/lib/modules + $(hide) cp $(1) $(2)/lib/modules/ + $(hide) rm -rf $(4) + $(hide) mkdir -p $(4)/lib/modules/0.0/$(3)lib/modules + $(hide) cp $(1) $(4)/lib/modules/0.0/$(3)lib/modules + $(hide) $(DEPMOD) -b $(4) 0.0 + $(hide) sed -e 's/\(.*modules.*\):/\/\1:/g' -e 's/ \([^ ]*modules[^ ]*\)/ \/\1/g' $(4)/lib/modules/0.0/modules.dep > $(2)/lib/modules/modules.dep + $(hide) cp $(4)/lib/modules/0.0/modules.alias $(2)/lib/modules +endef + # ----------------------------------------------------------------- # Recovery image @@ -1097,23 +1114,6 @@ $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys) RECOVERYIMAGE_ID_FILE := $(PRODUCT_OUT)/recovery.id -# $(1): modules list -# $(2): output dir -# $(3): mount point -# $(4): staging dir -# Depmod requires a well-formed kernel version so 0.0 is used as a placeholder. -define build-image-kernel-modules - $(hide) rm -rf $(2)/lib/modules - $(hide) mkdir -p $(2)/lib/modules - $(hide) cp $(1) $(2)/lib/modules/ - $(hide) rm -rf $(4) - $(hide) mkdir -p $(4)/lib/modules/0.0/$(3)lib/modules - $(hide) cp $(1) $(4)/lib/modules/0.0/$(3)lib/modules - $(hide) $(DEPMOD) -b $(4) 0.0 - $(hide) sed -e 's/\(.*modules.*\):/\/\1:/g' -e 's/ \([^ ]*modules[^ ]*\)/ \/\1/g' $(4)/lib/modules/0.0/modules.dep > $(2)/lib/modules/modules.dep - $(hide) cp $(4)/lib/modules/0.0/modules.alias $(2)/lib/modules -endef - # $(1): output file define build-recoveryimage-target @echo ----- Making recovery image ------