Skip to content
Snippets Groups Projects
Commit e38d0db2 authored by Piotr Kubik's avatar Piotr Kubik
Browse files

airoha: sysupgrade: Add u-boot-script

Add a script component in sysupgrade.itb file.

Script is intended to be executed by u-boot.
It is expected for the value of a script type property to be "script".
parent 38d4c2fa
No related branches found
No related tags found
1 merge request!1366Add GPT entries to sysupgrade image
...@@ -16,6 +16,7 @@ define Build/iopsys-fit-upgrade-image ...@@ -16,6 +16,7 @@ define Build/iopsys-fit-upgrade-image
gpt-primary-header $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.start \ gpt-primary-header $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.start \
gpt-primary-entry $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.entry \ gpt-primary-entry $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.entry \
gpt-alternate $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.end) \ gpt-alternate $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img.end) \
u-boot-script $(CURDIR)/u-boot-script \
) )
$(call iopsys-fit-upgrade-image-add-configs-same, $@.its, \ $(call iopsys-fit-upgrade-image-add-configs-same, $@.its, \
compat_versions:"1 0", \ compat_versions:"1 0", \
...@@ -25,6 +26,7 @@ define Build/iopsys-fit-upgrade-image ...@@ -25,6 +26,7 @@ define Build/iopsys-fit-upgrade-image
boot \ boot \
rootfs \ rootfs \
u-boot-env \ u-boot-env \
u-boot-script \
$(if $(GPT_PRIMARY_ENTRY_OFFSET), \ $(if $(GPT_PRIMARY_ENTRY_OFFSET), \
gpt-primary-header \ gpt-primary-header \
gpt-primary-entry \ gpt-primary-entry \
...@@ -33,6 +35,7 @@ define Build/iopsys-fit-upgrade-image ...@@ -33,6 +35,7 @@ define Build/iopsys-fit-upgrade-image
gpt-alternate-offset:$(GPT_ALTERNATE_OFFSET)) \ gpt-alternate-offset:$(GPT_ALTERNATE_OFFSET)) \
$(if $(CONFIG_TARGET_UPGRADE_BUNDLE),upgrade_bundle) \ $(if $(CONFIG_TARGET_UPGRADE_BUNDLE),upgrade_bundle) \
) )
$(if $(GPT_PRIMARY_ENTRY_OFFSET), $(call add_fit_sub_image_script_type, $@))
$(call iopsys-fit-upgrade-image-build, $@) $(call iopsys-fit-upgrade-image-build, $@)
endef endef
...@@ -40,6 +43,17 @@ define Build/generate_gpt_entries ...@@ -40,6 +43,17 @@ define Build/generate_gpt_entries
ptgen -a100 -v -g -b -o $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img $(GPT_LAYOUT_STR) ptgen -a100 -v -g -b -o $(dir $@)/$(DEVICE_IMG_PREFIX)-gpt.img $(GPT_LAYOUT_STR)
endef endef
# Add type property to sub-image u-boot script
define add_fit_sub_image_script_type
echo -e '/ { \n\
images {\n\
u-boot-script {\n\
type = "script";\n\
};\n\
};\n\
};' >> $(1).its
endef
# Generate U-Boot RAM image # Generate U-Boot RAM image
define generate-uboot-ram define generate-uboot-ram
@echo Generate fit-dtb image for $(DEVICE_NAME) @echo Generate fit-dtb image for $(DEVICE_NAME)
......
echo "Hello world!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment