Skip to content

Commit

Permalink
storage: set read_only to planned devices
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Oct 22, 2024
1 parent fed316a commit bb5b271
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions service/lib/y2storage/proposal/agama_device_planner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def grow?(device, config)
config.size.max.unlimited? || config.size.max > device.size
end

# @param planned [Planned::Disk, Planned::Partition]
# @param planned [Planned::Disk, Planned::Partition, Planned::LvmLv]
# @param config [#encryption, #filesystem]
def configure_block_device(planned, config)
configure_encryption(planned, config.encryption) if config.encryption
configure_filesystem(planned, config.filesystem) if config.filesystem
end

# @param planned [Planned::Disk, Planned::Partition]
# @param planned [Planned::Disk, Planned::Partition, Planned::LvmLv]
# @param config [Agama::Storage::Configs::Filesystem]
def configure_filesystem(planned, config)
planned.mount_point = config.path
Expand All @@ -105,25 +105,25 @@ def configure_filesystem(planned, config)
configure_filesystem_type(planned, config.type) if config.type
end

# @param planned [Planned::Disk, Planned::Partition]
# @param planned [Planned::Disk, Planned::Partition, Planned::LvmLv]
# @param config [Agama::Storage::Configs::FilesystemType]
def configure_filesystem_type(planned, config)
planned.filesystem_type = config.fs_type
configure_btrfs(planned, config.btrfs) if config.btrfs
end

# @param planned [Planned::Disk, Planned::Partition]
# @param planned [Planned::Disk, Planned::Partition, Planned::LvmLv]
# @param config [Agama::Storage::Configs::Btrfs]
def configure_btrfs(planned, config)
# TODO: we need to discuss what to do with transactional systems and the read_only
# property. We are not sure whether those things should be configurable by the user.
# planned.read_only = config.read_only?
planned.read_only = config.read_only?
planned.snapshots = config.snapshots?
planned.default_subvolume = config.default_subvolume
planned.subvolumes = config.subvolumes
end

# @param planned [Planned::Disk, Planned::Partition]
# @param planned [Planned::Disk, Planned::Partition, Planned::LvmLv]
# @param config [Agama::Storage::Configs::Encryption]
def configure_encryption(planned, config)
planned.encryption_password = config.password
Expand All @@ -134,7 +134,7 @@ def configure_encryption(planned, config)
planned.encryption_key_size = config.key_size
end

# @param planned [Planned::Partition]
# @param planned [Planned::Partition, Planned::LvmLv]
# @param config [Agama::Storage::Configs::Size]
def configure_size(planned, config)
planned.min_size = config.min
Expand Down

0 comments on commit bb5b271

Please sign in to comment.