-
Notifications
You must be signed in to change notification settings - Fork 43
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
New storage proposal settings #656
Merged
Merged
Conversation
This file contains 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
Update PO files
Integration tests for `agama-dbus-server`
fix wrong name in rake install
Mark more texts for translation
jreidinger
reviewed
Aug 28, 2023
doc/dbus/org.opensuse.Agama.Storage1.Proposal.Calculator.doc.xml
Outdated
Show resolved
Hide resolved
jreidinger
reviewed
Aug 28, 2023
jreidinger
reviewed
Aug 28, 2023
jreidinger
reviewed
Aug 28, 2023
jreidinger
approved these changes
Aug 28, 2023
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.
nothing critical, just typos and one possible code improvement
Merged
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.
Problem
The information about the products offered for installation is provided to Agama by means of a config file (e.g., /etc/agama.yaml). That config file contains an storage section which indicates the volumes (file systems) to create in the target system. Right now, this storage section is basically the same as the section for the YaST config file. But the storage use cases for Agama are only a subset of all the possibities YaST offers. Because of that, some YaST storage options simply do not make sense for Agama, but the config file still has to indicate them in order to make YaST to work properly.
We need an easier way to specify the storage options for the Agama use cases. The very YaST specific options should not be exposed in the Agama config file.
Solution
The storage settings for Agama config are redefined.
See example
The main changes are in the volumes section. Now, volumes only contains the mount points of the volumes to create:
And there is a new volume_templates section. This new section contains a template for each volume. A template consists on a set of default values and a volume outline. The outline represents some specific information about the volume which cannot be changed, for example, the possible file system types for the volume.
There is also a generic volume template to be used for a new arbitrary volume. The generic volume template does not indicate a mount path.
Volumes and storage proposal
Agama initially calculates the storage proposal trying to create all the volumes indicated in the volumes section of the control file. A new proposal can be triggered from D-Bus calling to
#Calculate
method fromorg.opensuse.Agama.Storage1.Proposal.Calculator
interface.#Calculate
receives the settings to use for the new proposal.Proposal settings conversions
In Agama a proposal is calculated by calling to
Agama::Storage::Proposal#calculate
, which receives aAgama::Storage::ProposalSettings
object. The proposal settings object needs to be generated from two different sources: the agama config file for the initial proposal and from the information provided from D-Bus for calculating a new proposal:Agama::Storage::ProposalSettingsReader
generates the proposal settings from the config file.Agama::DBus::Storage::ProposalSettingsConversion::FromDBus
to generate the proposal settings from the D-Bus information.And then, Agama delegates the real computation of the proposal to Y2Storage. For that, the proposal settings are converted to the Y2Storage format thanks to the class
Agama::Storage::ProposalSettingsConversion::ToY2Storage
.There are two more conversions for the proposal settings:
Agama::DBus::Storage::ProposalSettingsConversion::ToDBus
: generates a D-Bus representation of the proposal settings, useful for the D-Bus interfaces providing information about the proposal.Agama::Storage::ProposalSettingsConversion::FromY2Storage
: generates proposal settings from the Y2Storage format. This is useful to rebuild the proposal settings once Y2Storage has finished to calculate the proposal.Testing