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

overlord/fdestate/fdestate.go: fix path to data mount point on hybrid #14734

Open
wants to merge 5 commits into
base: fde-manager-features
Choose a base branch
from

Conversation

valentindavid
Copy link
Contributor

@valentindavid valentindavid commented Nov 18, 2024

We used a path that is not a mount point on hybrid to discover the data disk. Instead we now use / for hybrid, and /writable on core.

@valentindavid valentindavid added Run nested The PR also runs tests inluded in nested suite FDE Manager Pull requests that target FDE manager branch labels Nov 18, 2024
@valentindavid valentindavid reopened this Nov 18, 2024
@valentindavid
Copy link
Contributor Author

That should make tests/nested/manual/muinstaller-real work again.

@valentindavid valentindavid force-pushed the valentindavid/fix-hybrid-data-path branch from 19c0055 to 6f19bb3 Compare November 18, 2024 11:50
@valentindavid valentindavid force-pushed the valentindavid/fix-hybrid-data-path branch from 6f19bb3 to 39ad1ff Compare November 18, 2024 12:11
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (fde-manager-features@cbf35eb). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             fde-manager-features   #14734   +/-   ##
=======================================================
  Coverage                        ?   78.83%           
=======================================================
  Files                           ?     1093           
  Lines                           ?   147838           
  Branches                        ?        0           
=======================================================
  Hits                            ?   116549           
  Misses                          ?    24013           
  Partials                        ?     7276           
Flag Coverage Δ
unittests 78.83% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@valentindavid valentindavid marked this pull request as ready for review November 18, 2024 12:29
Copy link
Contributor

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

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

Can you update the PR description?

@@ -218,7 +219,12 @@ func initializeState(st *state.State) error {

// FIXME mount points will be different in recovery or factory-reset modes
// either inspect degraded.json, or use boot.HostUbuntuDataForMode()
dataUUID, dataErr := disksDMCryptUUIDFromMountPoint(dirs.SnapdStateDir(dirs.GlobalRootDir))
dataDir := dirs.GlobalRootDir
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this true on hybrid as well? Unless, I'm misunderstanding what the problem is and which path exists in which scenario.

Suggested change
dataDir := dirs.GlobalRootDir
dataDir := dirs.SnapdStateDir(dirs.GlobalRootDir)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think it is a mount point on hybrid. On core it is a bind mount.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also tests/nested/manual/muinstaller-real fails with this.

Comment on lines 224 to 226
if osutil.FileExists(writable) {
dataDir = writable
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if osutil.FileExists(writable) {
dataDir = writable
}
if osutil.FileExists(writable) {
// appears be an Ubuntu Core device, where /writable exists
dataDir = writable
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking of it, I will test it is a mount point. Because someone could create /writable and easily break it.

Copy link
Contributor

Choose a reason for hiding this comment

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

could we check whether release indicates we are on Core and so choose the right path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. That might be just simpler.

… hybrid

overlord/fdestate/fdestate.go: fix path to data mount point on hybrid

We used a path that is not a mount point on hybrid to discover the
data disk. Insted we now use / for hybrid, and /writable on core.
… hybrid

overlord/fdestate/fdestate.go: fix path to data mount point on hybrid

We used a path that is not a mount point on hybrid to discover the
data disk. Instead we now use / for hybrid, and /writable on core.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FDE Manager Pull requests that target FDE manager branch Run nested The PR also runs tests inluded in nested suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants