Install dlkm to appropriate place and symlink am: e51dff25ec am: 9a599be8df

Original change: https://android-review.googlesource.com/c/platform/build/+/1316439

Change-Id: I208c1fb5d1450442de4bbbe5d9134ec9033e3441
This commit is contained in:
Yifan Hong 2020-07-14 19:47:24 +00:00 committed by Automerger Merge Worker
commit c11bec7696

View file

@ -383,7 +383,7 @@ $(foreach dir,$(BOARD_KERNEL_MODULE_DIRS), \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-image-kernel-modules-dir,RECOVERY,$(TARGET_RECOVERY_ROOT_OUT),,modules.load.recovery,,$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-image-kernel-modules-dir,VENDOR_RAMDISK,$(TARGET_VENDOR_RAMDISK_OUT),,modules.load,$(VENDOR_RAMDISK_STRIPPED_MODULE_STAGING_DIR),$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-vendor-ramdisk-recovery-load,$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-image-kernel-modules-dir,VENDOR,$(TARGET_OUT_VENDOR),vendor,modules.load,$(VENDOR_STRIPPED_MODULE_STAGING_DIR),$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-image-kernel-modules-dir,VENDOR,$(if $(filter true,$(BOARD_USES_VENDOR_DLKMIMAGE)),$(TARGET_OUT_VENDOR_DLKM),$(TARGET_OUT_VENDOR)),vendor,modules.load,$(VENDOR_STRIPPED_MODULE_STAGING_DIR),$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-vendor-charger-load,$(dir))) \
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(call build-image-kernel-modules-dir,ODM,$(TARGET_OUT_ODM),odm,modules.load,,$(dir))) \
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
@ -2726,6 +2726,34 @@ define create-vendor-odm-symlink
endef
endif
# Create symlinks for vendor_dlkm on devices with a vendor_dlkm partition:
# /vendor/lib/modules -> /vendor_dlkm/lib/modules
#
# On devices with a vendor_dlkm partition,
# - /vendor/lib/modules is a symlink to a directory that stores vendor DLKMs.
# - /vendor_dlkm/{etc,...} store other vendor_dlkm files directly. The vendor_dlkm partition is
# mounted at /vendor_dlkm at runtime and the symlinks created in system/core/rootdir/Android.mk
# are hidden.
# On devices without a vendor_dlkm partition,
# - /vendor/lib/modules stores vendor DLKMs directly.
# - /vendor_dlkm/{etc,...} are symlinks to directories that store other vendor_dlkm files.
# See system/core/rootdir/Android.mk for a list of created symlinks.
# The vendor DLKMs and other vendor_dlkm files must not be accessed using other paths because they
# are not guaranteed to exist on all devices.
ifdef BOARD_USES_VENDOR_DLKMIMAGE
define create-vendor-vendor_dlkm-symlink
$(hide) if [ -d $(TARGET_OUT_VENDOR)/lib/modules ] && [ ! -h $(TARGET_OUT_VENDOR)/lib/modules ]; then \
echo 'Non-symlink $(TARGET_OUT_VENDOR)/lib/modules detected!' 1>&2; \
echo 'You cannot install files to $(TARGET_OUT_VENDOR)/lib/modules while building a separate vendor_dlkm.img!' 1>&2; \
exit 1; \
fi
$(hide) ln -sf /vendor_dlkm/lib/modules $(TARGET_OUT_VENDOR)/lib/modules
endef
else
define create-vendor-vendor_dlkm-symlink
endef
endif
vendorimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,vendor)
BUILT_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img
@ -2733,6 +2761,7 @@ define build-vendorimage-target
$(call pretty,"Target vendor fs image: $(INSTALLED_VENDORIMAGE_TARGET)")
@mkdir -p $(TARGET_OUT_VENDOR)
$(call create-vendor-odm-symlink)
$(call create-vendor-vendor_dlkm-symlink)
@mkdir -p $(vendorimage_intermediates) && rm -rf $(vendorimage_intermediates)/vendor_image_info.txt
$(call generate-image-prop-dictionary, $(vendorimage_intermediates)/vendor_image_info.txt,vendor,skip_fsck=true)
PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH \
@ -4287,6 +4316,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \
$(call create-system-product-symlink)
$(call create-system-system_ext-symlink)
$(call create-vendor-odm-symlink)
$(call create-vendor-vendor_dlkm-symlink)
$(hide) rm -rf $@ $@.list $(zip_root)
$(hide) mkdir -p $(dir $@) $(zip_root)
ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))