Repository navigation
Add deploy - #170
Open
frederic-hoerni wants to merge 2 commits into
Open
Add deploy#170frederic-hoerni wants to merge 2 commits into
frederic-hoerni wants to merge 2 commits into
Conversation
dimakuv
approved these changes
Nov 25, 2026
Detailed modifications:
- Add subcommand deploy
- exec: Replace custom TeeReader by standard lib io.TeeReader.
This also fixes a bug where garbage bytes could be written to the stdout or
stderr buffers used by the caller. For the record and clarification, Here is a
summary of what should have been fixed if all the code had not been replaced:
- if n, err := t.w.Write(p); err != nil {
+ if n, err := t.w.Write(p[:n]); err != nil {
- Add tests for encrypt and deploy
- Remove unused functions
The code for deploy mostly comes from encrypt-cloud-image:
https://github.com/canonical/encrypt-cloud-image
revision a4824d1f836abd3035dd2f9ef81909a96a9f4466
Note: images made with nullbootctl deploy cannot be used with
nullbootctl <= 0.6.0, as the new format of cloudimg-rootfs.sealed-key
is not compatible.
The sealed key file (/boot/efi/device/fde/cloudimg-rootfs.sealed-key) can have 2 formats: - legacy (binary starting with a magic 'UKS$') - JSON 'nullbootctl install' only handled the legacy format. This change makes it handle both formats. When a reseal is done from a sealed key file in the legacy format, it is converted to the new JSON format. We need to handle both, as: - Existing guest instances which apt-upgrade nullboot need nullbootctl to be compatible with the legacy format (which was produced by encrypt-cloud-image v25.12.0). - 'nullbootctl deploy' creates the sealed key file in the new JSON format. Test made in a guest with legacy format: $ sudo nullbootctl install ... ReasealKey: read key data in legacy format ... ReasealKey: key data not in legacy format. Assuming JSON format... (it reseals twice)
frederic-hoerni
force-pushed
the
add-deploy
branch
from
November 25, 2026 15:58
31fed5e to
31d9664
Compare
dimakuv
approved these changes
Nov 26, 2026
dimakuv
left a comment
Contributor
There was a problem hiding this comment.
All my comments were fixed, approving
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of the merging of
encrypt-cloud-imagewithinnullbootand brings the sub-commanddeployin.Main modifications:
nullbootctl installnow handles the new JSON format ofcloudimg-rootfs.sealed-key, and converts the legacy format to the new format.Other modifications:
Limitations:
nullbootctl deploy(because of the new JSON format forcloudimg-rootfs.sealed-key).This has been tested using the unit tests, ubuntu-boot-test, and manual testing (see
README-test-encrypt-deploy.md).This PR does not deal with: merging documentation and CI jobs, aligning ubuntu-boot-test (other PRs will take care of that)