Skip to content

xtensa-build-all: document PRIVATE_KEY_OPTION and deprecate -k - #3512

Merged
lgirdwood merged 1 commit into
thesofproject:masterfrom
marc-hb:build-key-usage
Oct 19, 2020
Merged

lgirdwood merged 1 commit into
thesofproject:masterfrom
marc-hb:build-key-usage

Conversation

@marc-hb

@marc-hb marc-hb commented Oct 10, 2020

Copy link
Copy Markdown
Collaborator

Following commit 88b69cc ("scripts: xtensa-build-all: Add support
for building TGL and signing with MEU") we now have an unified and
flexible PRIVATE_KEY_OPTION that can do anything with very little code.

The -k option was never a good idea in the first place because it
already required an environment variable anyway (RIMAGE_PRIVATE_KEY)
instead of a command line argument so the code should have just checked
whether RIMAGE_PRIVATE_KEY was defined, that would have been
enough. Requiring the user to "double-confirm" with -k has been adding
extra complication for both the user interface and the implementation.

xtensa-build-all is effectively a "CMake configuration convenience"
script, however it shouldn't become an additional layer of indirection
and complexity and its interface should expose CMake (which is already a
layer of indirection!) as directly as possible.

See longer discussion in PR #3187

Signed-off-by: Marc Herbert marc.herbert@intel.com

@juimonen

Copy link
Copy Markdown

@marc-hb, yes looks good.

I wonder could we even add a concrete example like in some man pages, like:

to build with docker for tgl with private/external key and meu tool:
export PRIVATE_KEY_OPTION=-DMEU_PRIVATE_KEY=/path_to_key/private.pem
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -m /path_to_meu/ tgl

This would make it very clear how to do it.

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good, could you add a litte more help for the user so they know the new switch/env variable to use in this case.

Comment thread scripts/xtensa-build-all.sh Outdated
Following commit 88b69cc ("scripts: xtensa-build-all: Add support
for building TGL and signing with MEU") we now have an unified and
flexible PRIVATE_KEY_OPTION that can do anything with very little code.

The -k option was never a good idea in the first place because it
already required an environment variable anyway (RIMAGE_PRIVATE_KEY)
instead of a command line argument so the code should have just checked
whether RIMAGE_PRIVATE_KEY was defined, that would have been
enough. Requiring the user to "double-confirm" with -k has been adding
extra complication for both the user interface and the implementation.

xtensa-build-all is effectively a "CMake configuration convenience"
script, however it shouldn't become an additional layer of indirection
and complexity and its interface should expose CMake (which is already a
layer of indirection!) as directly as possible.

See longer discussion in PR thesofproject#3187

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb

marc-hb commented Oct 14, 2020

Copy link
Copy Markdown
Collaborator Author

I wonder could we even add a concrete example like in some man pages,

We don't have man pages, I think the closest is sof-docs. Happy to review anything you submit there :-)

like, to build with docker for tgl with private/external key and meu tool:

export PRIVATE_KEY_OPTION=-DMEU_PRIVATE_KEY=/path_to_key/private.pem
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -m /path_to_meu/ tgl

I already added something very close to this in the usage. I just added the -m /path_to_meu/ now.

I didn't add tgl because I prefer to keep the example generic. The platform name is the most basic parameter that everyone has been using since forever and it's the first line of the usage message that gets printed if you forget it.

I didn't add ./scripts/docker-run.sh either because this script is unrelated to docker. I use this script all the time and I never use docker.

@lgirdwood
lgirdwood merged commit ec3ccab into thesofproject:master Oct 19, 2020
@marc-hb
marc-hb deleted the build-key-usage branch October 19, 2020 17:02
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