diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-09-07 10:11:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-09-07 10:20:59 +0200 |
commit | 432b4e38794d42c98935975c751c6da5d69097c8 (patch) | |
tree | 0605d9688103d630b4bb268b7edbaf5162285683 /scripts/Makefile.lib | |
parent | 6e64774331c95258f73694364a9514e0911f7ede (diff) | |
download | barebox-432b4e38794d42c98935975c751c6da5d69097c8.tar.gz barebox-432b4e38794d42c98935975c751c6da5d69097c8.tar.xz |
ARM: i.MX: make HAB certificate pathes explicitly overwritable
When building HAB images for i.MX we have to specify some pathes to
the certificates. This can be done with Kconfig variables. For better
build system integration we also want to be able to specify the pathes
in environment variables. This currently doesn't work as we specify
the variables from the environment with the -D option to cpp, but also
include generated/autoconf.h which overwrites the variables with the
values from Kconfig.
To overcome this introduce a Kconfig switch that explcitly selects
whether we want to have the variables from Kconfig or the environment.
Also, only pass the variables from the environment when explicitly
wanted.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3b13086050..3b4277e5ab 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -431,15 +431,20 @@ cmd_imximage_S_dcd= \ echo '.balign STRUCT_ALIGNMENT'; \ ) > $@ +overwrite-hab-env = $(shell set -e; \ + test -n "$(CONFIG_HAB_CERTS_ENV)"; \ + test -n "$$$(1)"; \ + echo -D$(1)=\"$(shell echo $$$(1))\") + imxcfg_cpp_flags = -Wp,-MD,$(depfile) -nostdinc -x assembler-with-cpp \ -I $(srctree)/include -I $(srctree)/arch/arm/mach-imx/include \ -include include/generated/autoconf.h \ - -DCONFIG_HABV3_SRK_PEM=\"$(CONFIG_HABV3_SRK_PEM)\" \ - -DCONFIG_HABV3_CSF_CRT_DER=\"$(CONFIG_HABV3_CSF_CRT_DER)\" \ - -DCONFIG_HABV3_IMG_CRT_DER=\"$(CONFIG_HABV3_IMG_CRT_DER)\" \ - -DCONFIG_HABV4_TABLE_BIN=\"$(CONFIG_HABV4_TABLE_BIN)\" \ - -DCONFIG_HABV4_CSF_CRT_PEM=\"$(CONFIG_HABV4_CSF_CRT_PEM)\" \ - -DCONFIG_HABV4_IMG_CRT_PEM=\"$(CONFIG_HABV4_IMG_CRT_PEM)\" + $(call overwrite-hab-env,CONFIG_HABV3_SRK_PEM) \ + $(call overwrite-hab-env,CONFIG_HABV3_CSF_CRT_DER) \ + $(call overwrite-hab-env,CONFIG_HABV3_IMG_CRT_DER) \ + $(call overwrite-hab-env,CONFIG_HABV4_TABLE_BIN) \ + $(call overwrite-hab-env,CONFIG_HABV4_CSF_CRT_PEM) \ + $(call overwrite-hab-env,CONFIG_HABV4_IMG_CRT_PEM) dcd-tmp = $(subst $(comma),_,$(dot-target).dcd.tmp) |