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

🌱 🐛 Run kcrypt in rootfs stage #1224

Merged
merged 2 commits into from
Mar 30, 2023
Merged

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Mar 30, 2023

What this PR does / why we need it:
Instead of having it as a service we can run it under the rootfs stage. This gives us the assurance that /oem is mounted by that time and that we run it on all boot modes except live mode

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Instead of having it as a serviec we can run it under the rootfs stage.
This gives us the assurance that /oem is mounted by that time and that
we run it on all boot modes except live mode

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
@Itxaka Itxaka requested a review from a team March 30, 2023 12:59
@netlify
Copy link

netlify bot commented Mar 30, 2023

Deploy Preview for kairos-io canceled.

Name Link
🔨 Latest commit 1617670
🔍 Latest deploy log https://app.netlify.com/sites/kairos-io/deploys/64259c9d27bdab00089f3dd0

@Itxaka
Copy link
Member Author

Itxaka commented Mar 30, 2023

May fix #1223

mudler
mudler previously approved these changes Mar 30, 2023
Copy link
Member

@mudler mudler left a comment

Choose a reason for hiding this comment

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

this is looking good, at this point we can drop also the dracut package from the framework, right?

@Itxaka
Copy link
Member Author

Itxaka commented Mar 30, 2023

this is looking good, at this point we can drop also the dracut package from the framework, right?

yyyeeeeee....maybe.

Let me test if this actually works :D

- name: "Unlock encrypted volumes"
if: '[ ! -f "/run/cos/live_mode" ]'
commands:
- kcrypt unlock-all
after-upgrade:
- name: "Update plugins"
if: "[ $(kairos-agent state get oem.found) == 'true' ]"
Copy link
Member

Choose a reason for hiding this comment

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

not part of this PR, I know, but I think the code right after it can be dropped too

Copy link
Member

Choose a reason for hiding this comment

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

we don't need to copy the plugins anymore into oem since .. a while (can't find the PR now)

Copy link
Member Author

Choose a reason for hiding this comment

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

will drop it in a following PR, good to know!

@Itxaka
Copy link
Member Author

Itxaka commented Mar 30, 2023

Yup, this fixes the issue, yay!

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2023

Codecov Report

Merging #1224 (1617670) into master (7bb9af9) will decrease coverage by 0.73%.
The diff coverage is 49.11%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master    #1224      +/-   ##
==========================================
- Coverage   22.79%   22.07%   -0.73%     
==========================================
  Files          22       16       -6     
  Lines        1610     1282     -328     
==========================================
- Hits          367      283      -84     
+ Misses       1179      950     -229     
+ Partials       64       49      -15     
Impacted Files Coverage Δ
internal/agent/config.go 0.00% <ø> (ø)
internal/agent/interactive_install.go 0.00% <ø> (ø)
internal/agent/notify.go 0.00% <0.00%> (ø)
internal/agent/recovery.go 0.00% <ø> (ø)
internal/agent/reset.go 0.00% <0.00%> (ø)
internal/agent/upgrade.go 0.00% <0.00%> (ø)
pkg/config/config.go 0.00% <0.00%> (-51.36%) ⬇️
internal/agent/install.go 5.05% <21.53%> (+5.05%) ⬆️
pkg/config/collector/options.go 64.51% <37.50%> (ø)
pkg/config/collector/collector.go 64.38% <64.38%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

If we run kcrypt in the rootfs stage, we no longer need to run it via
dracut

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
@Itxaka
Copy link
Member Author

Itxaka commented Mar 30, 2023

this is looking good, at this point we can drop also the dracut package from the framework, right?

Nope! Because we need the kcrypt binary in initramfs and the dracut module is the one inserting it. If we drop the package there is no kcrypt binary and the rootfs stage fails so we need a bit more changes before

@mudler
Copy link
Member

mudler commented Mar 30, 2023

this is looking good, at this point we can drop also the dracut package from the framework, right?

Nope! Because we need the kcrypt binary in initramfs and the dracut module is the one inserting it. If we drop the package there is no kcrypt binary and the rootfs stage fails so we need a bit more changes before

ah right! but we can drop the dracut-module logics to call it :)

@Itxaka Itxaka merged commit 5315712 into kairos-io:master Mar 30, 2023
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