Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b04bf47 authored by Xu Chao's avatar Xu Chao Committed by Steve Muckle
Browse files

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
parent fb2714e6
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -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 ------