Skip to content

Commit

Permalink
Merge pull request #1360 from ancorgs/bsc1215022_master
Browse files Browse the repository at this point in the history
Support probing of linear RAIDs (master)
  • Loading branch information
ancorgs committed Oct 11, 2023
2 parents 48607a3 + a0d878c commit 5ba6fc2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 11 08:41:15 UTC 2023 - Ancor Gonzalez Sosa <ancor@suse.com>

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

-------------------------------------------------------------------
Fri Sep 22 08:27:34 UTC 2023 - Ancor Gonzalez Sosa <ancor@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: 5.0.1
Version: 5.0.2
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

0 comments on commit 5ba6fc2

Please sign in to comment.