From: Andreas Reichel <[email protected]> For API refactoring, storage backend should be configurable. Add --with-env-backend configure option to specify the c-file with the backend implementation.
Signed-off-by: Andreas Reichel <[email protected]> --- Makefile.am | 4 ++-- configure.ac | 10 ++++++++++ env/env_api_fat.c | 1 + include/env_api.h | 4 +--- tools/tests/test_partitions.c | 1 + 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2335d4d..2417215 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,7 @@ CLEANFILES = lib_LIBRARIES = libebgenv.a libenv_api.a libebgenv_a_SOURCES = \ - env/env_api_fat.c \ + env/@[email protected] \ tools/ebgpart.c \ swupdate-adapter/ebgenv.c @@ -55,7 +55,7 @@ libebgenv_a_CFLAGS = \ libenv_api_a_SOURCES = \ tools/ebgpart.c \ - env/env_api_fat.c + env/@[email protected] libenv_api_a_CFLAGS = \ $(AM_CFLAGS) diff --git a/configure.ac b/configure.ac index 9196e8e..fdff617 100644 --- a/configure.ac +++ b/configure.ac @@ -5,6 +5,7 @@ # # Authors: # Claudius Heine <[email protected]> +# Andreas Reichel <[email protected]> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. @@ -125,6 +126,13 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T +AC_ARG_WITH([env-backend], + AS_HELP_STRING([--with-env-backend=STRING], + [define the environment backend, defaults to "env_api_fat"]), + [ ENV_API_FILE="$withval" ], + [ ENV_API_FILE="env_api_fat" ]) + +AC_SUBST([env_api_file], [${ENV_API_FILE}]) # ------------------------------------------------------------------------------ AC_CONFIG_FILES([ Makefile @@ -144,4 +152,6 @@ AC_MSG_RESULT([ libdir: ${libdir} efi libs: ${GNUEFI_LIB_DIR} + + environment backend: ${ENV_API_FILE}.c ]) diff --git a/env/env_api_fat.c b/env/env_api_fat.c index 8056ab3..ee8c5b3 100644 --- a/env/env_api_fat.c +++ b/env/env_api_fat.c @@ -11,6 +11,7 @@ */ #include "env_api.h" +#include "ebgpart.h" #include "test-interface.h" const char *tmp_mnt_dir = "/tmp/mnt-XXXXXX"; diff --git a/include/env_api.h b/include/env_api.h index 70727e9..83c7123 100644 --- a/include/env_api.h +++ b/include/env_api.h @@ -26,9 +26,7 @@ #include <fcntl.h> #include <sys/file.h> #include <sys/mount.h> - -#include "ebgpart.h" - +#include "config.h" #include <zlib.h> #include "envdata.h" diff --git a/tools/tests/test_partitions.c b/tools/tests/test_partitions.c index 4203480..e292200 100644 --- a/tools/tests/test_partitions.c +++ b/tools/tests/test_partitions.c @@ -17,6 +17,7 @@ #include <setjmp.h> #include <cmocka.h> #include "env_api.h" +#include "ebgpart.h" #include "test-interface.h" static PedDevice ped_devices[32] = {0}; -- 2.14.1 -- 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/20170926115638.2006-5-andreas.reichel.ext%40siemens.com. For more options, visit https://groups.google.com/d/optout.
