-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRebuildParameter.mk
72 lines (57 loc) · 2.92 KB
/
RebuildParameter.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ifdef PRODUCT_PARAMETER_TEMPLATE
$(info build parameter.txt with $(PRODUCT_PARAMETER_TEMPLATE)....)
ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
partition_list := security:4M,uboot_a:4M,trust_a:4M,misc:4M
else
partition_list := security:4M,uboot:4M,trust:4M,misc:4M
endif # BOARD_USES_AB_IMAGE
ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
# Header V3, add vendor_boot and resource.
ifeq (1,$(strip $(shell expr $(BOARD_BOOT_HEADER_VERSION) \>= 3)))
partition_list := $(partition_list),resource_a:16M,vendor_boot_a:$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)
endif # Header V3
partition_list := $(partition_list),dtbo_a:$(BOARD_DTBOIMG_PARTITION_SIZE),vbmeta_a:1M,boot_a:$(BOARD_BOOTIMAGE_PARTITION_SIZE)
else # None-A/B
# Header V3, add vendor_boot and resource.
ifeq (1,$(strip $(shell expr $(BOARD_BOOT_HEADER_VERSION) \>= 3)))
partition_list := $(partition_list),resource:16M,vendor_boot:$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)
endif # Header V3
partition_list := $(partition_list),dtbo:$(BOARD_DTBOIMG_PARTITION_SIZE),vbmeta:1M,boot:$(BOARD_BOOTIMAGE_PARTITION_SIZE),recovery:$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)
endif # BOARD_USES_AB_IMAGE
partition_list := $(partition_list),backup:372M,cache:$(BOARD_CACHEIMAGE_PARTITION_SIZE),metadata:16M
ifeq ($(strip $(BUILD_WITH_GOOGLE_FRP)), true)
partition_list := $(partition_list),frp:512K
endif
ifneq ($(strip $(BOARD_WITH_SPECIAL_PARTITIONS)), )
partition_list := $(partition_list),$(BOARD_WITH_SPECIAL_PARTITIONS)
endif
# Added by ASUS: splash partition
partition_list := $(partition_list),splash:16M
# Added by ASUS: dtoverlay partition
partition_list := $(partition_list),dtoverlay:16M
ifeq ($(strip $(BOARD_SUPER_PARTITION_GROUPS)),rockchip_dynamic_partitions)
partition_list := $(partition_list),super:$(BOARD_SUPER_PARTITION_SIZE)
else # BOARD_USE_DYNAMIC_PARTITIONS
partition_list := $(partition_list),system:$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),vendor:$(BOARD_VENDORIMAGE_PARTITION_SIZE),odm:$(BOARD_ODMIMAGE_PARTITION_SIZE)
endif
ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
partition_list := $(partition_list),data:$(BOARD_USERDATAIMAGE_PARTITION_SIZE)
endif
intermediates := $(call intermediates-dir-for,FAKE,rockchip_parameter)
rebuild_parameter := $(intermediates)/parameter.txt
ROCKCHIP_PARAMETER_TOOLS := $(SOONG_HOST_OUT_EXECUTABLES)/parameter_tools
$(rebuild_parameter) : $(PRODUCT_PARAMETER_TEMPLATE) $(ROCKCHIP_PARAMETER_TOOLS)
@echo "Building parameter.txt $@."
$(ROCKCHIP_PARAMETER_TOOLS) --input $(PRODUCT_PARAMETER_TEMPLATE) \
--start-offset 8192 \
--firmware-version $(BOARD_PLATFORM_VERSION) \
--machine-model "$(PRODUCT_MODEL)" \
--manufacturer "$(PRODUCT_MANUFACTURER)" \
--machine $(PRODUCT_DEVICE) \
--partition-list $(partition_list) \
--output $(rebuild_parameter)
INSTALLED_RK_PARAMETER := $(PRODUCT_OUT)/$(notdir $(rebuild_parameter))
$(INSTALLED_RK_PARAMETER) : $(rebuild_parameter)
$(call copy-file-to-new-target-with-cp)
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_RK_PARAMETER)
endif