Skip to content

rimage: enable key to be override by ENV - #1240

Closed
xiulipan wants to merge 1 commit into
thesofproject:masterfrom
xiulipan:pr/rimageenv
Closed

xiulipan wants to merge 1 commit into
thesofproject:masterfrom
xiulipan:pr/rimageenv

Conversation

@xiulipan

@xiulipan xiulipan commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

To use the key from ENV instead of args.

Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com

some enhancement to #1239
usage:

export SOF_RIMAGE_KEY=path/to/you/key
make bin

...
using ENV key path/to/you/key
...
Firmware file size 0x2d000 page count 39
 pkcs: signing with key path/to/you/key
...

Fix #1238

To use the key from ENV instead of args.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@xiulipan
xiulipan requested review from jajanusz and plbossart April 9, 2019 07:20

@jajanusz jajanusz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm against passing it through env variables, just use cmdline arugments.

@jajanusz

jajanusz commented Apr 9, 2019 •

Copy link
Copy Markdown
Contributor

I guess you can just fix -k arguments if it doesn't work - @plbossart thinks that's the case in #1238 , but I think he just changed key in the wrong place and it never got passed to the rimage.

If -k works ok, I'll close this PR, unless you have another strong reason to start passing arguments via env variables.

@plbossart

plbossart commented Apr 9, 2019 via email

Copy link
Copy Markdown
Member

@jajanusz

jajanusz commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

I don't get your point. What happens when you want to build all firmware
with different keys, e.g. APL with the OTC key and ICL with a debug key?
You'd want to just use the existing build system and just update a
variable.

Just use cmake variable, you have to make different build/config for each of them anyway so you'll have something like that for APL:

cmake -Bbuild_apl -DRIMAGE_KEY=/path/to/apl/key ...

For ICL smth like:

cmake -Bbuild_icl -DRIMAGE_KEY=/path/to/icl/key ...

etc.

We already have dependencies on tools location and core, I
don't see the issue with having a pointer to a specific key?

The fact that w had to comply to bad practice in one place, doesn't mean we have to continue doing it.

The last thing I want is a manual command I have to run after the build
is done with the OTC public key.

You don't have to run any manual command after the build, you just do configuration step once for each config (set of cmake variables) and rebuild it with 1 command: make bin

@jajanusz
jajanusz requested a review from mmaka1 April 9, 2019 14:43
@plbossart

plbossart commented Apr 9, 2019 via email

Copy link
Copy Markdown
Member

@jajanusz

jajanusz commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

I don't get your point. What happens when you want to build all firmware with different keys, e.g. APL with the OTC key and ICL with a debug key? You'd want to just use the existing build system and just update a variable. Just use cmake variable, you have to make different build/config for each of them anyway so you'll have something like that for APL: |cmake -Bbuild_apl -DRIMAGE_KEY=/path/to/apl/key ... | For ICL smth like: |cmake -Bbuild_icl -DRIMAGE_KEY=/path/to/icl/key ... |
so I guess you have no objection to having an RIMAGE_KEY environment variable defined in xtensa-build-all.sh and using it to generate the makefiles? cmake -Bbuild_icl -DRIMAGE_KEY=${RIMAGE_KEY} ..

Yea, it's better to handle it in shell script

@xiulipan

Copy link
Copy Markdown
Contributor Author

@jajanusz @plbossart I will close this and update #1239

@xiulipan xiulipan closed this Apr 10, 2019
@xiulipan
xiulipan deleted the pr/rimageenv branch September 19, 2019 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants