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

Support probing of linear RAIDs (SP5) #1358

Merged
merged 5 commits into from Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 13 08:41:15 UTC 2023 - Ancor Gonzalez Sosa <ancor@suse.com>

- New MdLevel value for linear RAIDs (bsc#1215022)
- 4.5.25

-------------------------------------------------------------------
Wed Jul 5 13:42:12 UTC 2023 - Stefan Hundhammer <shundhammer@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage-ng.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-storage-ng
Version: 4.5.24
Version: 4.5.25
Release: 0
Summary: YaST2 - Storage Configuration
License: GPL-2.0-only OR GPL-3.0-only
Expand Down
19 changes: 18 additions & 1 deletion src/lib/y2storage/autoinst_profile/raid_options_section.rb
Expand Up @@ -90,7 +90,7 @@ def self.new_from_storage(device, parent = nil)
# @param md [Md] RAID device
def init_from_raid(md)
@raid_name = md.name unless md.numeric?
@raid_type = md.md_level.to_s
@raid_type = clone_md_level(md).to_s
# A number will be interpreted as KB, so we explicitly set the unit.
@chunk_size = "#{md.chunk_size.to_i}B"
@parity_algorithm = md.md_parity.to_s
Expand All @@ -109,6 +109,23 @@ def md_parity

MdParity.find_with_legacy(parity_algorithm)
end

private

# MD level to be used at {#init_from_raid}
#
# This is a temporary method, created in the context of bsc#1215022, to avoid creating
# entries with "<raid_type>linear</raid_type>" in the AutoYaST profile when cloning the
# system. That may lead to the false impression that creation of linear RAIDs with YaST
# is supported.
#
# In more modern branches, the case of linear RAIDs will probably be handled differently.
#
# @param md [Md] RAID device
# @return [MdLevel]
def clone_md_level(md)
md.md_level.is?(:linear) ? MdLevel::UNKNOWN : md.md_level
end
end
end
end
4 changes: 3 additions & 1 deletion src/lib/y2storage/md_level.rb
Expand Up @@ -38,7 +38,9 @@ class MdLevel
raid5: N_("RAID5"),
raid6: N_("RAID6"),
raid10: N_("RAID10"),
container: N_("Container")
container: N_("Container"),
# TRANSLATOR: RAID level for linear RAIDs
linear: N_("Linear")
}
private_constant :TRANSLATIONS

Expand Down