Skip to content

New public function to check whether a software RAID is candidate for installation#1411

Merged
ancorgs merged 3 commits into
yast:masterfrom
ancorgs:candidate_raid
May 23, 2025
Merged

New public function to check whether a software RAID is candidate for installation#1411
ancorgs merged 3 commits into
yast:masterfrom
ancorgs:candidate_raid

Conversation

@ancorgs
Copy link
Copy Markdown
Contributor

@ancorgs ancorgs commented May 23, 2025

Problem

Agama needs to check whether a software RAID can be used as candidate for installation according to the current YaST heuristics, but the method is private.

Needed for agama-project/agama#2388

Solution

Extract some logic to a new DiskAnalyzer#candidate_software_raid? public method.

@coveralls
Copy link
Copy Markdown

coveralls commented May 23, 2025

Coverage Status

coverage: 97.719% (+0.001%) from 97.718%
when pulling 8c3112c on ancorgs:candidate_raid
into db1febb on yast:master.

Comment thread src/lib/y2storage/disk_analyzer.rb Outdated
Copy link
Copy Markdown
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

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

LGTM

@ancorgs ancorgs merged commit f9ab540 into yast:master May 23, 2025
6 checks passed
@github-actions
Copy link
Copy Markdown

❌ Autosubmission job #15213738959 failed

@github-actions
Copy link
Copy Markdown

✅ Autosubmission job #15213738959 successfully finished
✅ Created submit request #1279992

ancorgs added a commit to agama-project/agama that referenced this pull request May 26, 2025
This pull request adapts Agama to some historical behavior of YaST, but
(hopefully) in a more structured and explicit way.

## Historical background

YaST considers some software RAIDs to be bootable and, thus, it:
  - offers them as an option in the Guided Setup
  - considers them as candidates for the initial proposal

The criteria used by YaST is kind of arbitrary, based on some heuristic
imposed by SUSE partners and refined over time. See [this
explanation](https://github.com/yast/yast-storage-ng/blob/db1febb341453c8cc4972dfe36affe55c013f435/src/lib/y2storage/disk_analyzer.rb#L131).

To not break the existing use cases, we should keep the ability in Agama
to install on those RAIDs. That’s relevant for:
  1. The initial proposal
  2. The web UI
3. The selection of the implicit boot device (when is omitted in the
configuration)

But we also need the option to manipulate other RAID devices that are
not considered to be candidates for a normal installation (ie.
bootable). For example, to be able to select them at the web UI with any
purpose.

## Implementation

This pull request:
- Sets the basis for all scenarios by providing a clear way to
distinguish different types of RAIDs (and drives).
- Improves the situation at 3 (ie. when resolving the omitted boot
device)

To address the first goal, `System` now offers four methods
`available_drives`, `candidate_drives`, `available_md_raids` and
`candidate_md_raids`. Check the documentation for the exact meaning.

To address the latter goal, this introduces the ability to automatically
determine the boot device if the storage configuration omits
`boot.device` but specifies the root partition must be located at a
bootable (candidate) RAID.

## Dependencies

This PR depends on yast/yast-storage-ng#1411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants