-
Notifications
You must be signed in to change notification settings - Fork 594
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
o/devicestate, tests: setup bind mount from /run/mnt/ubuntu-seed to /var/lib/snapd/seed on hybrid system install #15006
base: master
Are you sure you want to change the base?
Conversation
Tue Feb 4 18:08:31 UTC 2025 Failures:Executing:
Restoring:
|
4d973e6
to
1bc1544
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15006 +/- ##
=========================================
Coverage ? 78.23%
=========================================
Files ? 1160
Lines ? 154012
Branches ? 0
=========================================
Hits ? 120496
Misses ? 26094
Partials ? 7422
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, a couple of comments
@@ -1129,6 +1129,39 @@ func (m *DeviceManager) doInstallFinish(t *state.Task, _ *tomb.Tomb) error { | |||
}, perfTimings); err != nil { | |||
return fmt.Errorf("cannot copy seed: %w", err) | |||
} | |||
|
|||
hybrid := systemAndSnaps.Model.Classic() && systemAndSnaps.Model.KernelSnap() != nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check made me realize that a check that we do a few lines before (https://github.com/canonical/snapd/blob/master/overlord/devicestate/handlers_install.go#L1085-L1086) is actually wrong as indeed the device context seen by doInstallFinish
is the one of the installer, not the one for the model we are installing (thanks for this!). It is not surprising that this has not exploded yet as we don't have that many tests for using the installer API to install UC. Would you mind fixing that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, fixed in 7fff430.
1bc1544
to
7fff430
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting to this so quickly. I spotted a typo!
I presume to make this work I need to arrange for /var/lib/snapd/seed to be present but empty in the rootfs that I install?
|
||
hybrid := systemAndSnaps.Model.Classic() && systemAndSnaps.Model.KernelSnap() != nil | ||
if hybrid { | ||
// boot.InitramfsUbuntuSeedDir (/run/mny/ubuntu-data, usually) is a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here, mny vs mnt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
@mwhudson good question, maybe we should verify that is true at install time, or even make it if it isn’t there? |
systemd would take care of creating it if not present |
…var/lib/snapd/seed on hybrid system install
…being installed, not current device context
7fff430
to
70a55cb
Compare
Hybrid systems might not have this mountpoint setup in the pre-existing rootfs. Here, this change makes it so when we install a hybrid system and copy the seed over, we also install and enable a mount unit that will bind mount
/run/mnt/ubuntu-seed
(which is mounted in the initramfs) to/var/lib/snapd/seed
.