2 # Copyright (C) 2021 The LineageOS Project
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 FACTORY_PATH
:= device
/radxa
/radxa0
/factory
19 PRODUCT_UPGRADE_OUT
:= $(PRODUCT_OUT
)/upgrade
20 PACKAGE_CONFIG_FILE
:= $(PRODUCT_UPGRADE_OUT
)/image.cfg
21 AML_IMAGE_TOOL
:= $(HOST_OUT_EXECUTABLES
)/aml_image_packer
$(HOST_EXECUTABLE_SUFFIX
)
23 INSTALLED_AML_UPGRADE_PACKAGE_TARGET
:= $(PRODUCT_OUT
)/aml_upgrade_package.img
25 define aml-symlink-file
26 $(hide
) ln
-f
$(1) $(PRODUCT_UPGRADE_OUT
)/$(strip $(if
$(2), $(2), $(notdir $(1))))
36 $(INSTALLED_AML_UPGRADE_PACKAGE_TARGET
): $(addprefix $(PRODUCT_OUT
)/,$(NEEDED_IMAGES
)) $(AML_IMAGE_TOOL
)
37 $(hide
) mkdir
-p
$(PRODUCT_UPGRADE_OUT
)
38 ifneq ("$(wildcard $(FACTORY_PATH)/u-boot.bin)","")
39 $(hide
) $(call aml-symlink-file
, $(FACTORY_PATH
)/u-boot.bin
)
40 else ifneq ("$(wildcard vendor/firmware/radxa0/bootloader.img)","")
41 $(hide
) $(call aml-symlink-file
, vendor
/firmware
/radxa0
/bootloader.img
, u-boot.bin
)
43 $(error
"no u-boot.bin found in $(FACTORY_PATH)")
45 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/logo.img
)
46 $(hide
) $(call aml-symlink-file
, $(FACTORY_PATH
)/aml_sdc_burn.ini
)
47 $(hide
) $(call aml-symlink-file
, $(FACTORY_PATH
)/image.cfg
)
48 $(hide
) $(call aml-symlink-file
, $(FACTORY_PATH
)/platform.conf
)
49 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/boot.img
)
50 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/recovery.img
)
51 $(hide
) $(call aml-symlink-file
, $(INSTALLED_2NDBOOTLOADER_TARGET
), dtb.img
)
52 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/dtbo.img
)
53 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/super.img
)
54 $(hide
) $(call aml-symlink-file
, $(PRODUCT_OUT
)/vbmeta.img
)
55 $(hide
) $(AML_IMAGE_TOOL
) -r
$(PACKAGE_CONFIG_FILE
) $(PRODUCT_UPGRADE_OUT
)/ $@
56 $(hide
) rm -rf
$(PRODUCT_UPGRADE_OUT
)
57 $(hide
) echo
" $@ created"
60 aml_upgrade
: $(INSTALLED_AML_UPGRADE_PACKAGE_TARGET
)