From 7a0feada755ba78590f08e9e3087942ada4152ee Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Tue, 9 Apr 2019 15:16:40 +0800 Subject: [PATCH] rimage: enable key to be override by ENV To use the key from ENV instead of args. Signed-off-by: Pan Xiuli --- rimage/rimage.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rimage/rimage.c b/rimage/rimage.c index 46e14c30977c..8ff067a4512f 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -52,6 +52,7 @@ int main(int argc, char *argv[]) { struct image image; const char *mach = NULL; + const char *env_key = NULL; int opt, ret, i, elf_argc = 0; memset(&image, 0, sizeof(image)); @@ -90,6 +91,12 @@ int main(int argc, char *argv[]) } } + env_key = getenv("SOF_RIMAGE_KEY"); + if (env_key) { + fprintf(stdout, "using ENV key %s\n", env_key); + image.key_name = env_key; + } + elf_argc = optind; /* make sure we have an outfile and machine */