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

cmd/snap-bootstrap: mount base directly on /sysroot #14537

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alfonsosanchezbeato
Copy link
Member

Mount the base directly on /sysroot in all UC modes, while for hybrid
we mount /run/mnt/data instead of the /run/mnt/sysroot symlink that
was pointing to the former. With this change we do not need to have
the /run/mnt/base mount anymore.

Mount the base directly on /sysroot in UC's run mode, while for hybrid
we mount /run/mnt/data instead of the /run/mnt/sysroot symlink that
was pointing to the former.
@alfonsosanchezbeato alfonsosanchezbeato added the Run nested The PR also runs tests inluded in nested suite label Sep 25, 2024
@alfonsosanchezbeato
Copy link
Member Author

Opening as draft as we will need canonical/core-initrd#265 landed first. As a side note, we should discuss how to handle this initramfs/snap-bootstrap interlocks in an easier way.

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 53.73134% with 31 lines in your changes missing coverage. Please review.

Project coverage is 78.86%. Comparing base (ac897ee) to head (87a834f).
Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
cmd/snap-bootstrap/cmd_initramfs_mounts.go 51.51% 11 Missing and 5 partials ⚠️
cmd/snap-bootstrap/initramfs_systemd_mount.go 55.88% 10 Missing and 5 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #14537    +/-   ##
========================================
  Coverage   78.85%   78.86%            
========================================
  Files        1079     1080     +1     
  Lines      145615   145813   +198     
========================================
+ Hits       114828   114997   +169     
- Misses      23601    23619    +18     
- Partials     7186     7197    +11     
Flag Coverage Δ
unittests 78.86% <53.73%> (+<0.01%) ⬆️

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.

}
}

// Do a daemon reload so systemd knows about the new mount units
Copy link
Collaborator

Choose a reason for hiding this comment

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

will it also perform the mount then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, as the new mount unit has an After=snap-initramfs-mounts.service dependency

}
}

// Do a daemon reload so systemd knows about the new mount units
sysd := systemd.New(systemd.SystemMode, nil)
if err := sysd.DaemonReload(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will will always have units that need loading? daemon-reload is costly. If we could try to not do it if we did not call writeSysrootMountUnit, then it would be very good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run nested The PR also runs tests inluded in nested suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants