Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] rimage: Add support for multiple toml file #179

Closed
wants to merge 2 commits into from

Conversation

aiChaoSONG
Copy link

@aiChaoSONG aiChaoSONG commented Sep 13, 2023

add support for multiple toml file for rimage, prepare for split toml file
to platform related toml and algorithm related toml.

The previous RFC #176 won't work for windows system, because it uses a linux specific function,
This RFC should work both for windows and linux.

Chao Song added 2 commits September 13, 2023 16:20
We are either signing or verifying an image,
not both or neither.

Signed-off-by: Chao Song <[email protected]>
This patch adds support for multiple toml
configuration file.

In this patch, the multiple input toml files
will be merged into a single toml file, and
the merged file will be stored in the same
folder of the firmware to be signing or verifying.

Signed-off-by: Chao Song <[email protected]>
/* make sure we have an outfile if not verifying */
if ((!image.out_file && !image.verify_file)) {
/* We are either signing or verifying an image, not both or neither */
if (!(!!image.out_file ^ !!image.verify_file)) {
Copy link

Choose a reason for hiding this comment

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

possible to figure out a more easier expression for better understanding?

Copy link
Member

Choose a reason for hiding this comment

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

" not both or neither " would this not imply to fail if !out_file == !verify_file ? Pls check my logic here though.

fclose(out_file);
return NULL;
}
copy_file(file, out_file);
Copy link

Choose a reason for hiding this comment

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

use file pointer as parameter is not always proposed, directly read and write is also very simple.
btw, how about fread/fwrite? since toml file is not big.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

@aiChaoSONG btw, this can be better done with the GNU pre-processor (like we already pre-process linker scripts).
i.e. mtl-sku.toml

// all platform memoery addresses
#include <platform.toml>
// all Intel signing config
#include <intel.toml>
// all modules 
#include <volume.toml>
#include <copier.toml>
and so on

@aiChaoSONG
Copy link
Author

replacement: thesofproject/sof#8243

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