1LOCAL_PATH := $(call my-dir) 2 3#A/B builds require us to create the mount points at compile time. 4#Just creating it for all cases since it does not hurt. 5FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt 6ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) 7 8$(FIRMWARE_MOUNT_POINT): 9 @echo "Creating $(FIRMWARE_MOUNT_POINT)" 10 @mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt 11 12#---------------------------------------------------------------------- 13# Generate persist image (persist.img) 14#---------------------------------------------------------------------- 15TARGET_OUT_PERSIST_IMG_PATH := $(PRODUCT_OUT)/persist 16 17INTERNAL_PERSISTIMAGE_FILES := \ 18 $(foreach pair,$(PRODUCT_COPY_FILES),\ 19 $(if $(filter persist/%,$(call word-colon,2,$(pair))),\ 20 $(call word-colon,1,$(pair)):$(PRODUCT_OUT)/$(call word-colon,2,$(pair)))) 21 22INSTALLED_PERSISTIMAGE_FILES := $(call copy-many-files,$(INTERNAL_PERSISTIMAGE_FILES)) 23INSTALLED_PERSISTIMAGE_TARGET := $(PRODUCT_OUT)/persist.img 24 25$(INSTALLED_PERSISTIMAGE_TARGET): $(MKEXTUSERIMG) $(MAKE_EXT4FS) $(INSTALLED_PERSISTIMAGE_FILES) 26 $(call pretty,"Target persist fs image: $(INSTALLED_PERSISTIMAGE_TARGET)") 27 @mkdir -p $(TARGET_OUT_PERSIST_IMG_PATH) 28 $(hide) PATH=$(HOST_OUT_EXECUTABLES):$${PATH} $(MKEXTUSERIMG) -s $(TARGET_OUT_PERSIST_IMG_PATH) $@ ext4 persist $(BOARD_PERSISTIMAGE_PARTITION_SIZE) 29 $(hide) chmod a+r $@ 30 $(hide) $(call assert-max-image-size,$@,$(BOARD_PERSISTIMAGE_PARTITION_SIZE)) 31 32ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PERSISTIMAGE_TARGET) 33ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(INSTALLED_PERSISTIMAGE_TARGET) 34INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_PERSISTIMAGE_TARGET) 35 36 37INTERNAL_KERNEL_MODULES := \ 38 $(foreach file,$(wildcard device/google/bonito-kernel/*.ko \ 39 device/google/bonito-kernel/modules.dep),\ 40 $(file):$(TARGET_OUT_VENDOR)/lib/modules/$(notdir $(file))) 41 42INSTALLED_KERNEL_MODULES := $(call copy-many-files,$(INTERNAL_KERNEL_MODULES)) 43 44.PHONY: kernel-modules 45kernel-modules: $(INSTALLED_KERNEL_MODULES) 46 @echo Kernel modules installed 47 48.PHONY: persistimage 49persistimage: $(INSTALLED_PERSISTIMAGE_TARGET) 50 51droidcore: $(INSTALLED_PERSISTIMAGE_TARGET) $(INSTALLED_KERNEL_MODULES) 52 53 54# copy kernel headers to the build tree 55$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr: $(wildcard $(PRODUCT_VENDOR_KERNEL_HEADERS)/*) 56 rm -rf $@ 57 mkdir -p $@/include 58 cp -a $(PRODUCT_VENDOR_KERNEL_HEADERS)/. $@/include 59 60#---------------------------------------------------------------------- 61# build and sign the final stage of bootloader 62#---------------------------------------------------------------------- 63.PHONY: aboot 64ifeq ($(USESECIMAGETOOL), true) 65aboot: gensecimage_target gensecimage_install 66else 67aboot: $(INSTALLED_BOOTLOADER_MODULE) 68endif 69