You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.7 KiB

# preload env setup
INSTALLED_PRELOAD_TARGET := $(PRODUCT_OUT)/preload.img
TARGET_OUT_PRELOAD := $(PRODUCT_OUT)/preload
PRELOAD_INTERMEDIATES := $(TARGET_OUT_INTERMEDIATES)/PACKAGING/preload_intermediates
ROOTFS_PRELOAD := $(TARGET_ROOT_OUT)/preload
BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
ifeq ($(strip $(PRODUCT_TYPE)),tablet)
BOARD_PRELOAD_PARTITION_SIZE ?= 629145600 #600M
else ifeq ($(strip $(PRODUCT_TYPE)),xr)
BOARD_PRELOAD_PARTITION_SIZE ?= 209715200 #200M
else
BOARD_PRELOAD_PARTITION_SIZE ?= 629145600 #600M
endif
INTERNAL_PRELOADIMAGE_FILES := $(sort $(filter $(TARGET_OUT_PRELOAD)/%, \
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES) ) )
# preload objs
$(PRELOAD_INTERMEDIATES)/preload_image_info.txt:
$(hide) mkdir -p $(PRELOAD_INTERMEDIATES)
$(hide) rm -rf $@
$(call generate-image-prop-dictionary,$@,userdata,skip_fsck=true)
$(hide) echo mount_point=preload >> $@; \
echo partition_size=$(BOARD_PRELOAD_PARTITION_SIZE) >> $@; \
echo extfs_rsv_pct=0 >> $@
$(INSTALLED_PRELOAD_TARGET): $(PRELOAD_INTERMEDIATES)/preload_image_info.txt $(INTERNAL_PRELOADIMAGE_FILES) \
$(PRODUCT_OUT)/userdata.img
$(hide) mkdir -p $(TARGET_OUT_PRELOAD)
PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
build/make/tools/releasetools/build_image.py $(TARGET_OUT_PRELOAD) $< $@ $(PRODUCT_OUT)
$(ROOTFS_PRELOAD):
$(hide) mkdir -p $@
$(hide) touch $@/.gitkeep
$(BUILT_RAMDISK_TARGET): $(ROOTFS_PRELOAD)
# final images
.PHONY: preloadimage
preloadimage: $(INSTALLED_PRELOAD_TARGET) $(ROOTFS_PRELOAD) |$(ACP)
$(hide) mkdir -p $(PRODUCT_OUT)/images
$(ACP) -f $< $(PRODUCT_OUT)/images/preload.img
# add to droidcore/ramdisk dependency
droidcore: preloadimage