Skip to content

Add FIT configurations support to upgrade

Piotr Kubik requested to merge pkubik-add-fit-configurations into devel

Add support for:

  • 'configurations' node in FIT images
  • image components list defined on platform level

Image validation:

  • If '/configurations/<board_name>/devices_compatible' property is available in FIT and it contains <board_name> - upgrade image is compatible with the device.

  • If '/configurations/<board_name>/devices_compatible' does not exist - try 'old' compatibility checks (downgrade case).

  • If no matching configuration is found or no image components list is passed, then integrity check of all components from '/images' is done. Otherwise, integrity of images referenced from valid configuration node only is done.

Upgrade:
iopsys_sysupgrade() supports now a list of components to be processed by upgrade functions, passed as a parameter to iopsys_sysupgrade().

This allows determining upgrade image components on a platform level (their existence, flash order, requirement, target device etc.)

Sample upgrade components list contents:

<type>       /configuration/<name> <required> <target device>
pre_upgrade  upgrade_bundle        optional
image        boot                  required   boot\${next_bank_id}
bootloader   bootloader            optional   /dev/mtd1
u_boot_env   u-boot-env            required
post_upgrade upgrade_bundle        optional

Depending on type [pre_upgrade|post_upgrade|image|bootloader|u_boot_env] various end functions are called.

Components order on a list determines real flashing/processing order.

Components on a list can be marked as 'optional' or 'required'. For 'optional' components, there is no requirement for existence in upgrade FIT image.

Platform code can skip/add components to the list depending on current conditions (e.g. bootloader update).

List entries are evaluated during processing, so it is possible to use variables like ${next_bank_id}.

Image components used for flashing are chosen basing on their reference names in relevant '/configuration' node in FIT image passed in image components list to iopsys_sysupgrade().

Requires: iopsys/iopsyswrt!342

refs #14208

Edited by Piotr Kubik

Merge request reports