In this patch series the following is adressed: * When building and the link `bg_printenv` already exists, an error is produced. Fix that. * To maintain continuous tests, tests are compiled by default. For environments where tests cannot be built or executed, a configure option is added to disable tests: --disable-tests * For better usability, `bg_setenv`'s parameter -f was changed from `--file` to `--filepath` and now accepts a path, where `BGENV.DAT` is created so that it can be directly applied to the real environment location. * The environment API consisted of two static libraries of which one was used by the tools and one was for external applications. This API was refactored to one library only and also with respect to better file naming. FAT implementation specific stuff goes into env_api_fat.c and generic stuff into env_api.c. * The option for different environment storage backends is given by the configure option --with-env-type, which currently only supports FAT. * The number of environment partitions is now configurable with --with-num-config-parts, where the minimum amount is 1. * The complicated mapping between `boot_once` and `testing` flags and `ustate` is removed and a real `ustate` struct member is introduced. This significantly improves API usage as only two functions `set_global_state` and `get_global_state` are needed to get the update status instead of six different functions with a specific order. * Add support for user variables. From the API the user can insert all kind of binary data into the environment by defining user specific types, stored as `char *`. It is completely up to the user to interpret the stored data. From the tools side, a standard data type is defined as String and stores `char *` character arrays into the user variable space of the environment. Single variables can be set via `bg_setenv -x KEY=VAL`, where the -x option can be repeated multiple times. `bg_printenv` shows a list of all set user variables and prints their values if their type is of `String`. Variables can be deleted by omitting `VAL`. * Fix a problem with crc32 testing of environment tools: When the tools are compiled for a different size of user variable space, the position of the crc32 value changes. If it is not read correctly, tools must reinitialize the working copy of the environment to remain usable. * Documentation is updated. * Tests are updated. * docs/TODO.md is updated.
Signed-off-by: Andreas Reichel <[email protected]> Reichel Andreas (11): Makefile.am: Bugfix for bg_printenv symlink tests: Add configure option to control build bg_setenv: Specify output path with --filepath env: Rename environment API files env: Make backend for environment storage configurable env: Make number of config partitions configurable ustate: Refactor state variable swupdate-adapter: Simplify API Combine libraries to one API env_api_fat: Fix problem with crc32 testing env: Add user variables Makefile.am | 35 +- configure.ac | 78 +++- docs/COMPILE.md | 6 +- docs/TODO.md | 34 +- docs/TOOLS.md | 16 +- docs/UPDATE.md | 35 +- docs/USAGE.md | 12 +- env/env_api.c | 216 +++++++++ env/env_api_fat.c | 805 ++++++++++++++++++++++++++++++++++ env/fatvars.c | 53 +-- include/ebgenv.h | 93 ++++ {tools => include}/ebgpart.h | 0 tools/bg_utils.h => include/env_api.h | 49 ++- include/envdata.h | 10 +- {tools => include}/test-interface.h | 2 +- swupdate-adapter/ebgenv.c | 458 ------------------- swupdate-adapter/ebgenv.h | 90 ---- tools/bg_setenv.c | 151 +++++-- tools/bg_utils.c | 476 -------------------- tools/tests/Makefile | 25 +- tools/tests/test_api.c | 222 +++++++--- tools/tests/test_environment.c | 7 +- tools/tests/test_partitions.c | 41 +- 23 files changed, 1635 insertions(+), 1279 deletions(-) create mode 100644 env/env_api.c create mode 100644 env/env_api_fat.c create mode 100644 include/ebgenv.h rename {tools => include}/ebgpart.h (100%) rename tools/bg_utils.h => include/env_api.h (50%) rename {tools => include}/test-interface.h (96%) delete mode 100644 swupdate-adapter/ebgenv.c delete mode 100644 swupdate-adapter/ebgenv.h delete mode 100644 tools/bg_utils.c -- 2.13.3 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20170822161551.12662-1-andreas.reichel.ext%40siemens.com. For more options, visit https://groups.google.com/d/optout.
