mbox series

[meta,00/12] Support to call functions inside sw-description

Message ID 20220405071005.3855186-1-sbabic@denx.de
Headers show
Series Support to call functions inside sw-description | expand

Message

Stefano Babic April 5, 2022, 7:09 a.m. UTC
sw-description is often generated from a template. There are several help functions
to assign automatically values to attributes, like the generation of sha256 hash.
Some other functions were added and more will be added in future, and this is
done creating quirks and some unlogical matching rules when sw-description is
parsed in the classes. This was done with '@', or '@SWU_VERSION', etc.

To avoid to create any time new rules that are starting to conflict, implement
a generic method to call a user defined function returning an attribute value.
The syntax is:

	<attribute name > = "$<function name>(<function parameters>)";

Example:
	sha256 = "$swupdate_get_sha256(rootfs)";

The series convert auto version and sha256 to the new rule, but maintain the old syntax
for sha256 because this is large used to avoid compatibiity issues in the short time.
Later, old syntax will be removed for sha256, too.

Series adds a function to sign any aritifact, too. This shows also a method to add
further functions and collect them in swupdate-lib.class

Stefano Babic (12):
  Evaluate functions inside sw-description
  swupdate-common: factorize function get_pwd_file_args
  class: add a library file for generic function
  Make usage of library class
  class: add function that signs and returns hash of artifact
  Add SPDX identifier to classes file
  class: move swupdate_get_sha256 to library
  class: move swupdate_encrypt_file to lib
  class: move swupdate_extract_keys to lib
  class: rework autoversion to be more generic
  rename swupdate_auto_versions to swupdate_get_pkgvar
  Raise a warning if old syntax for sha256 is used

 classes/swupdate-common.bbclass | 144 +++++++-------------------------
 classes/swupdate-image.bbclass  |   2 +
 classes/swupdate-lib.bbclass    | 112 +++++++++++++++++++++++++
 classes/swupdate.bbclass        |   2 +
 4 files changed, 148 insertions(+), 112 deletions(-)
 create mode 100644 classes/swupdate-lib.bbclass