radxa0: Refactor how we handle installation
authorNolen Johnson <johnsonnolen@gmail.com>
Thu, 25 Jan 2024 02:00:21 +0000 (21:00 -0500)
committerNolen Johnson <johnsonnolen@gmail.com>
Thu, 25 Jan 2024 06:38:21 +0000 (01:38 -0500)
Change-Id: I6ebc47378dee9cf602215bac20005a358b391123

factory.mk
factory/image.cfg [deleted file]
factory/image_install.cfg [new file with mode: 0644]
factory/image_upgrade.cfg [new file with mode: 0644]

index 701ddf04ec951c453ef57629d548db1f41ae7d1c..1c91df3ee2b29866afd8c54a7286f5480143d2f6 100644 (file)
@@ -18,8 +18,8 @@ FACTORY_PATH := device/radxa/radxa0/factory
 
 PRODUCT_INSTALL_OUT := $(PRODUCT_OUT)/aml_install
 PRODUCT_UPGRADE_OUT := $(PRODUCT_OUT)/aml_upgrade
-INSTALL_PACKAGE_CONFIG_FILE := $(PRODUCT_INSTALL_OUT)/image.cfg
-UPGRADE_PACKAGE_CONFIG_FILE := $(PRODUCT_UPGRADE_OUT)/image.cfg
+INSTALL_PACKAGE_CONFIG_FILE := $(PRODUCT_INSTALL_OUT)/image_install.cfg
+UPGRADE_PACKAGE_CONFIG_FILE := $(PRODUCT_UPGRADE_OUT)/image_upgrade.cfg
 AML_IMAGE_TOOL := $(HOST_OUT_EXECUTABLES)/aml_image_packer$(HOST_EXECUTABLE_SUFFIX)
 
 INSTALLED_AML_INSTALL_PACKAGE_TARGET := $(PRODUCT_OUT)/aml_install_package.img
@@ -33,7 +33,7 @@ define aml-copy-upgrade-file
        $(hide) $(ACP) $(1) $(PRODUCT_UPGRADE_OUT)/$(strip $(if $(2), $(2), $(notdir $(1))))
 endef
 
-NEEDED_IMAGES := \
+UPGRADE_IMAGES := \
     boot.img \
     recovery.img \
     dtbo.img \
@@ -42,18 +42,28 @@ NEEDED_IMAGES := \
     super_empty.img \
     logo.img
 
-$(INSTALLED_AML_INSTALL_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(NEEDED_IMAGES)) $(ACP) $(AML_IMAGE_TOOL)
+INSTALL_IMAGES := \
+    boot.img \
+    recovery.img \
+    dtbo.img \
+    vbmeta.img \
+    super.img \
+    super_empty.img \
+    logo.img \
+    misc.img
+
+$(INSTALLED_AML_INSTALL_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(INSTALL_IMAGES)) $(ACP) $(AML_IMAGE_TOOL)
        $(hide) mkdir -p $(PRODUCT_INSTALL_OUT)
 ifneq ("$(wildcard $(FACTORY_PATH)/u-boot.bin)","")
        $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/u-boot.bin)
-else ifneq ("$(wildcard vendor/amlogic/radxa0/radio/bootloader-recovery.img)","")
-       $(hide) $(call aml-copy-install-file, vendor/amlogic/radxa0/radio/bootloader-recovery.img, u-boot.bin)
+else ifneq ("$(wildcard vendor/amlogic/radxa0/radio/bootloader.img)","")
+       $(hide) $(call aml-copy-install-file, vendor/amlogic/radxa0/radio/bootloader.img, u-boot.bin)
 else
        $(error "no u-boot.bin found in $(FACTORY_PATH)")
 endif
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/logo.img)
        $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/aml_sdc_burn.ini)
-       $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/image.cfg)
+       $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/image_install.cfg, image.cfg)
        $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/platform.conf)
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/boot.img)
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/recovery.img)
@@ -61,14 +71,15 @@ endif
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/dtbo.img)
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/super_empty.img, super.img)
        $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/vbmeta.img)
-       $(hide) $(AML_IMAGE_TOOL) -r $(INSTALL_PACKAGE_CONFIG_FILE) $(PRODUCT_INSTALL_OUT)/ $@
+       $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/misc.img)
+       $(hide) $(AML_IMAGE_TOOL) -r  $(PRODUCT_INSTALL_OUT)/image.cfg $(PRODUCT_INSTALL_OUT)/ $@
        $(hide) rm -rf $(PRODUCT_INSTALL_OUT)
        $(hide) echo " $@ created"
 
 .PHONY: aml_install
 aml_install: $(INSTALLED_AML_INSTALL_PACKAGE_TARGET)
 
-$(INSTALLED_AML_UPGRADE_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(NEEDED_IMAGES)) $(ACP) $(AML_IMAGE_TOOL)
+$(INSTALLED_AML_UPGRADE_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(UPGRADE_IMAGES)) $(ACP) $(AML_IMAGE_TOOL)
        $(hide) mkdir -p $(PRODUCT_UPGRADE_OUT)
 ifneq ("$(wildcard $(FACTORY_PATH)/u-boot.bin)","")
        $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/u-boot.bin)
@@ -79,7 +90,7 @@ else
 endif
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/logo.img)
        $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/aml_sdc_burn.ini)
-       $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/image.cfg)
+       $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/image_upgrade.cfg, image.cfg)
        $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/platform.conf)
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/boot.img)
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/recovery.img)
@@ -87,7 +98,7 @@ endif
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/dtbo.img)
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/super.img)
        $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/vbmeta.img)
-       $(hide) $(AML_IMAGE_TOOL) -r $(UPGRADE_PACKAGE_CONFIG_FILE) $(PRODUCT_UPGRADE_OUT)/ $@
+       $(hide) $(AML_IMAGE_TOOL) -r  $(PRODUCT_UPGRADE_OUT)/image.cfg $(PRODUCT_UPGRADE_OUT)/ $@
        $(hide) rm -rf $(PRODUCT_UPGRADE_OUT)
        $(hide) echo " $@ created"
 
diff --git a/factory/image.cfg b/factory/image.cfg
deleted file mode 100644 (file)
index 401c7c6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[LIST_NORMAL]
-file="u-boot.bin"              main_type="USB"         sub_type="DDR"
-file="u-boot.bin"              main_type="USB"         sub_type="UBOOT"
-file="u-boot.bin"              main_type="UBOOT"               sub_type="aml_sdc_burn"
-file="aml_sdc_burn.ini"                main_type="ini"         sub_type="aml_sdc_burn"
-file="dtb.img"         main_type="dtb"         sub_type="meson1"
-file="platform.conf"           main_type="conf"                sub_type="platform"
-file="dtb.img"         main_type="PARTITION"           sub_type="_aml_dtb"
-file="boot.img"                main_type="PARTITION"           sub_type="boot"
-file="u-boot.bin"              main_type="PARTITION"           sub_type="bootloader"
-file="dtbo.img"                main_type="PARTITION"           sub_type="dtbo"
-file="logo.img"                main_type="PARTITION"           sub_type="logo"
-file="recovery.img"            main_type="PARTITION"           sub_type="recovery"
-file="super.img"               main_type="PARTITION"           sub_type="super"
-file="vbmeta.img"              main_type="PARTITION"           sub_type="vbmeta"
diff --git a/factory/image_install.cfg b/factory/image_install.cfg
new file mode 100644 (file)
index 0000000..68c2144
--- /dev/null
@@ -0,0 +1,16 @@
+[LIST_NORMAL]
+file="u-boot.bin"              main_type="USB"         sub_type="DDR"
+file="u-boot.bin"              main_type="USB"         sub_type="UBOOT"
+file="u-boot.bin"              main_type="UBOOT"               sub_type="aml_sdc_burn"
+file="aml_sdc_burn.ini"                main_type="ini"         sub_type="aml_sdc_burn"
+file="dtb.img"         main_type="dtb"         sub_type="meson1"
+file="platform.conf"           main_type="conf"                sub_type="platform"
+file="dtb.img"         main_type="PARTITION"           sub_type="_aml_dtb"
+file="boot.img"                main_type="PARTITION"           sub_type="boot"
+file="u-boot.bin"              main_type="PARTITION"           sub_type="bootloader"
+file="dtbo.img"                main_type="PARTITION"           sub_type="dtbo"
+file="logo.img"                main_type="PARTITION"           sub_type="logo"
+file="recovery.img"            main_type="PARTITION"           sub_type="recovery"
+file="super.img"               main_type="PARTITION"           sub_type="super"
+file="vbmeta.img"              main_type="PARTITION"           sub_type="vbmeta"
+file="misc.img"               main_type="PARTITION"           sub_type="misc"
diff --git a/factory/image_upgrade.cfg b/factory/image_upgrade.cfg
new file mode 100644 (file)
index 0000000..401c7c6
--- /dev/null
@@ -0,0 +1,15 @@
+[LIST_NORMAL]
+file="u-boot.bin"              main_type="USB"         sub_type="DDR"
+file="u-boot.bin"              main_type="USB"         sub_type="UBOOT"
+file="u-boot.bin"              main_type="UBOOT"               sub_type="aml_sdc_burn"
+file="aml_sdc_burn.ini"                main_type="ini"         sub_type="aml_sdc_burn"
+file="dtb.img"         main_type="dtb"         sub_type="meson1"
+file="platform.conf"           main_type="conf"                sub_type="platform"
+file="dtb.img"         main_type="PARTITION"           sub_type="_aml_dtb"
+file="boot.img"                main_type="PARTITION"           sub_type="boot"
+file="u-boot.bin"              main_type="PARTITION"           sub_type="bootloader"
+file="dtbo.img"                main_type="PARTITION"           sub_type="dtbo"
+file="logo.img"                main_type="PARTITION"           sub_type="logo"
+file="recovery.img"            main_type="PARTITION"           sub_type="recovery"
+file="super.img"               main_type="PARTITION"           sub_type="super"
+file="vbmeta.img"              main_type="PARTITION"           sub_type="vbmeta"