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

Introduce generic ostree repository configuration #92

Merged

Conversation

rborn-tx
Copy link
Contributor

This allows one to set the ostree repositories configuration; settings can be independently set for both the main repository (where commits are made) and for the one that is part of OTA image (belonging to a sysroot).

This addition should be helpful when one needs to configure the repository (particularly the OTA one) before generating a deployment. This is the case today with the recently added ostree config "ex-integrity.composefs". When set to "true", ostree admin deploy will produce a composefs image and include it as part of the deployment.

This allows one to set the main ostree repository (OSTREE_REPO)
configuration. The configuration is defined by the new variable
OSTREE_REPO_CONFIG which would be set to a string in the form:

"key1:value1 key2:value2 ..."

The settings are applied to the repository via "ostree config set".

Signed-off-by: Rogerio Guerra Borin <rogerio.borin@toradex.com>
This allows one to set the OTA ostree repository (i.e. the one belonging
to a sysroot) configuration. The configuration is defined by the new
variable OSTREE_OTA_REPO_CONFIG which would be set to a string in the
form:

"key1:value1 key2:value2 ..."

The settings are applied to the repository via "ostree config set".

Signed-off-by: Rogerio Guerra Borin <rogerio.borin@toradex.com>
Copy link
Collaborator

@pattivacek pattivacek left a comment

Choose a reason for hiding this comment

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

Seems fine, but I'm curious, what sort of configuration is relevant to you? Where does it get read and used?

@rborn-tx
Copy link
Contributor Author

rborn-tx commented Feb 29, 2024

@pattivacek The example that I mentioned of "ex-integrity.composefs" is the real case for me at the moment (I'm working with integrating composefs into our Torizon OS). That setting is read by ostree admin deploy when producing the deployment that goes into the sysroot (during build); it would be used by ostree later, at runtime, when producing new deployments upon software updates as well. When "ex-integrity.composefs" is set, ostree generates a deployment as usual but it also generates a new file as part of the deployment, a composefs image. On a device, that composefs image could be mounted and by enabling fs-verity on it one can create a system with a root filesystem protected against tampering. We're doing this to implement a full chain of trust system in Torizon OS.

Since the IMAGE_CMD:ota() function (1) creates a sysroot, (2) populates it from the main ostree repo and (3) generates the deployment, today it's not possible to configure the repo before step (3) which would be required for ostree to produce the composefs image.

The above relates only to the ostree repo on the sysroot (part of the OTA image). I added the feature also to the main ostree repository just for consistency.

Copy link
Collaborator

@pattivacek pattivacek left a comment

Choose a reason for hiding this comment

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

Great, thanks for the explanation! That sounds really cool. Glad to hear progress is finally being made on securing the boot process.

@pattivacek pattivacek merged commit f49e4ac into uptane:kirkstone Feb 29, 2024
1 check passed
@rborn-tx
Copy link
Contributor Author

@pattivacek Thanks the quick reply and merge! Yeah, this work being done on ostree/composefs is really great!

Let me ask you: should I cherry-pick the commits in the present PR into other branches? If so, which ones?

@pattivacek
Copy link
Collaborator

should I cherry-pick the commits in the present PR into other branches? If so, which ones?

That's entirely up to you or anyone else interested. My employer is still using dunfell and I don't think we'll be rolling out features like this, so I'm not personally invested in backporting. I used to try to keep things fairly closely synchronized among the branches but I no longer find it to be worth the effort. I'll gladly review PRs but can't do much more than that at present!

@rborn-tx rborn-tx deleted the generic-ostree-repo-config-kirkstone branch March 1, 2024 15:03
madscientist42 pushed a commit to madscientist42/meta-updater that referenced this pull request Mar 8, 2024
Update the SRCREV to fix a build failure ('uint8_t' does not name a type)
when using poky master branch.

c90723717 (HEAD -> master, origin/master, origin/HEAD) Merge pull request uptane#105 from uptane/merge-upstream-docs
7dff8e1c2 Fixed coverage and static checks jobs (#1837)
d35e774c0 Fixed libOstree links (#1833)
efd939295 Merge pull request uptane#101 from uptane/fix-shellcheck-complaint
b2ee72ebf Merge pull request uptane#102 from DengkeDu/fix-build-error-v2
05b1af5e0 aktualizr: fix build error 'uint8_t' does not name a type
317f2ee65 (origin/fix-shellcheck-complaint) Remove leftover cruft from load tests.
69dfff995 Fix shellcheck complaint that somehow didn't show up until now.
60e2ffbff Merge pull request uptane#96 from cajun-rat/multibyte-part1
b32833489 Fix test flake by picking a random port
28ed95cd9 Add tests for non-ascii targets
6eacb8ac3 Refactor Implementation of HttpFake and MetaFake out of header file
3b92fb0a8 Decode URLs in HttpFake
c54afdd57 Merge pull request uptane#94 from uptane/docs/OTA-5642/update-targets-options
8afa20446 OTA-5642 update targets upload and add-uploaded options
762741ac6 Merge pull request uptane#93 from uptane/document-targets.json-size-limit
16b0d5005 OTA-6069 document targets.json size limit
0622ad789 Merge pull request uptane#92 from uptane/aktualizr-info-root-version
342d176a9 aktualizr-info: Allow specifying the Root metadata version to output.
86cad5a1d Merge pull request uptane#91 from uptane/docs/upstream
69efebebc OTA-5352 add page about how to add/remove key, set threshold
1420ad5f5 OTA-5352 add page about how to add/remove key, set threshold
f039b6f82 Revert "OTA-5352 add page about how to add/remove key, set threshold"
377aad27e Merge pull request uptane#90 from uptane/add-remove-targets-key
04765058a OTA-5352 add page about how to add/remove key, set threshold
0b4e2e71a Merge pull request uptane#88 from uptane/feat/event-sending-improvements
dc5ede14d Fix clang-tidy complaints.
57bae6892 Send smaller payload or drop if 413
b49975c1b Limit event number sent in a single request
e6df198cf Optionally limit event number to fetch
45d033679 Merge pull request uptane#84 from uptane/feat/improve-error-logging
f6816a1b9 Stop emitting LOG_ERROR messages when verifying local metadata
2d6b8a57f Merge pull request uptane#73 from uptane/tuf-test-vectors-uptane-namespace
8a9595b5b Manually fetch the submodules in github CI.
4fb44d770 Use main instead of master; it's newer.
b4513018e Bump tuf-test-vectors and switch to uptane namespace.
bb385161d Merge pull request uptane#86 from uptane/docs-port
afdf96a59 Add login to dockerhub
28b1da02d Changed not relevant link from Troubleshooting BSP Integration & Rollbacks pages (#1818)
2de3b690f Merge pull request uptane#85 from uptane/fix/macos-build
1a44c2a19 (origin/fix/macos-build) Minor fixes to build correctly on MacOS
67596b0b7 Merge pull request uptane#82 from cajun-rat/bug/storekeys
b7b3b287c Only write ManagedSecondary keys once
7b015f9b3 Rename struct stat to 'stat_buf' from 'st'
1f855fe1f Merge pull request uptane#81 from uptane/fix-U-Boot-url-master
e0286749c changed not relevant url
fa12aaaae Merge pull request uptane#78 from uptane/fix/77/arm-int64_t
7594cd55d Merge pull request uptane#79 from uptane/feature/AddDefaultPKCS11ArmPath
f1002f440 Added default path for pkcs11 for arm.
846edc038 Attempt to fix int conversion error found on ARM.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
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.

2 participants