Repository navigation
Add TGL FW build with MEU signing - #3187
Conversation
b6bb9cb to
c9c6ed0
Compare
|
Cc: @KaiChuan-Hsieh from PR #3198 noticed by chance. |
|
@ranj063 @marc-hb just to confirm that this PR works really nicely for me at least: Running with our CI docker and specifying absolute paths to meu and symbolic link to openssl: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -m /home/sof/work/sof.git/MEU15_TGL/Linux64 -s /home/sof/work/sof.git/MEU15_TGL/openssl -k /home/sof/work/sof.git/MEU15_TGL/private.pem tgl (absolute paths are paths inside docker, so for example put "pwd" to the build script in meu error branch to figure out) |
Print usage when no arguments are passed to the script. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
c9c6ed0 to
43043d5
Compare
|
@lgirdwood @marc-hb @juimonen this PR is updated now. Sorry for the delay! |
43043d5 to
7159af6
Compare
|
@ranj063 can you check the build. CI reporting some issues. |
85bed7c to
646e699
Compare
marc-hb
left a comment
There was a problem hiding this comment.
Thanks! Just some minor changes that I think could each be done later but because of their number I'm going to "request" them, sorry!
Also, some CI is hosed right now so these changes are a good excuse to force-push a new version some time later hoping CI got back on its feet by then :-)
marc-hb
left a comment
There was a problem hiding this comment.
Just some minor changes that I think could each be done later but...
I take that back: see newer comment / request for a "real" change about otc_private_key_3k.pem
646e699 to
a565e3e
Compare
Travis CI doesn't sign TGL yet. Jenkins CI does thanks to a private script that predates this one. So as far as TGL is concerned you can't be building TGL the same as CI yet. CI is obviously not "interactive" like developers are. I totally agree CI and developers should always be using the exact same code, however developers will always use the build differently: in a more fine-grained and controlled way. For instance developers use incremental builds, otherwise they never see warnings at the start of the build. They need to change some flag or some
You could submit a PR with Another option could be to "hardcode" |
I understand most of these hours seem to have been because of the addition of a submodule that broke non-TGL platforms too, which proves it was totally unrelated to this PR. |
|
@marc-hb "--env RIMAGE_PRIVATE_KEY=path" in docker-run doesn't work for me, compilation goes fine but in meu phase it is giving me empty path to meu tool for some reason. also I don't get sof_tgl_gcc directory anymore, just sof_tgl with empty RIMAGE_PRIVATE_KEY. |
|
I understand you don't want to do this eventually but please use |
|
@marc-hb adding this else branch to xtensa-build-all.sh makes it work: Not sure if that's the proper way but I guess without something similar the RIMAGE_PRIVATE_KEY is not pushed to meu tool. At least for me doesn't matter are you inside/outside docker. |
|
@juimonen can you create a PR with your update. Having a cmd line override is useful here when we need to make releases. |
|
@lgirdwood sure. So not yet sure/convinced why the private key needs to be environment variable and the MEU path tool not? Both are kind of external entities that we can't put inside public docker and they might change (so you sometimes use different keys etc. as I do). But I'm not shell script / parameter passing expert, maybe we are in trouble with long quoted/unquoted parameters etc. |
Thanks, so you seem to be mis-using Remember CMakeList.txt uses both
I already gave a tentative answer to this, see above.
Instead, please create a github issue to summarize and discuss the design issues. I think @juimonen patch would break users who use PRIVATE_KEY_OPTION as expected. A number of the usability and compatibility points brought up by @juimonen were already discussed above but he missed them pre-merge and they're now buried in other minor review comments or resolved. We're now in the typical "time loop" where the discussion is too long so the same questions get asked again and again. Ask them in a new, cleaner place and I'll extract the information from this PR. PRs are really bad places for high level or user interface discussions because comments get hidden when resolved or lost when force pushing. |
|
@marc-hb I think I'm lost with this, can you please explain me how the private key "-k" is supposed to be used? in the beginning the "-k" is checked and if you have not defined RIMAGE_PRIVATE_KEY you get error, otherwise if [ "x$USE_PRIVATE_KEY" == "xyes" ] then later in tgl section we check that if PRIVATE_KEY_OPTION is empty, we set it to otc_private_key_3k.pem But it can't be empty with -k ? later the PRIVATE_KEY_OPTION is given to CMAKE: So what is the PRIVATE_KEY_OPTION "-k" used for? How will I ever be able to specify some key with -k? |
|
Don't use the Define PRIVATE_KEY_OPTION directly instead, it's more flexible because it lets you do anything you want. You cannot use both If you don't define anything, TGL has a sensible default value for PRIVATE_KEY_OPTION. @ranj063 could you submit a Repeating previous comments of mine: PRIVATE_KEY_OPTION is simply passed-through to CMake, no logic. |
@marc-hb Im not sure Im the best person to write about the usage of the -k option. @xiulipan you're the one who opposed to changing this? Could you please add that? @juimonen btw for building TGL you shouldnt need to use the -k option if thats what you're asking. The script takes care of it as long as you specify that you're using meu to sign with the -m option. |
s/shouldnt/cannot/ @ranj063 this is I think what's missing in |
|
@ranj063 @marc-hb only thing I'm missing is the ability to define the key in the command line of this script. I mean for me it is changing as i need to use the debug key with devices, and it can't be included in our distros. But now I need to give it as env variable to docker-run -> every time I rebase sof I need to add that line there -> I don't like it. |
|
so I can build it now with: and adding this to docker-run.sh: |
|
Please try the docker-run.sh patch I wrote in #3187 (comment) and submit it if it works for you. |
|
@marc-hb sorry don't get how your patch is supposed to be used? it exports empty env variables into the docker? |
|
@marc-hb sorry just reading the docs so it should then take my local env vars with same name and move it to docker, ok that could be really nice actually... |
= pass-through. |
|
with @marc-hb patch idea this is working also (and without me touching the scripts): Anyway I would still argue the grounds of having the other as env variable and other as command line param, as they both are changing and not very static. So I would then prefer that most things would be env variables or vice versa. Anyway this works for me, so no worries. @marc-hb please put the patch in, it is good, I want it. |
I think you can use By the way did you just confirm that the default, undefined openssl location works for you too?
I have neither a docker image nor a TGL environment and bar exceptional circumstances I never submit and put my name on something I cannot at least smoke test myself. |
|
@marc-hb yes the sof-docker has openssl built into it and it works at least for this tgl signing. I was not sure about this, because in the previous version of this PR it was given as external parameter... I'm not sure about the MEU_TOOL_PATH, because if I read the docs correctly the -m you need to give to choose between rimage and meu signing. So I guess I anyway need to give the path...? Ok, I'll put the patch, seems that I'm anyway the only person using it. |
|
After a little bit more water under the bridge I still think this TGL / MEU user interface was the right one, however there's something that was definitely missing from this PR: documentation! This can be observed in PR #3511 attempt to "fix TGL MEU custom key" which looks like about to repeat the (too long) discussion above. So I just submitted a 10 lines, pure |
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>
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>
No description provided.