Fix optional RAID handling in LVM and partition modules

This commit is contained in:
Ilia Ross
2026-11-03 02:01:24 +01:00
parent 1170a5a35f
commit abc62ae37f
2 changed files with 10 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ name=Partition Manager
category=hardware
os_support=*-linux
desc=Partitions on Local Disks
depends=mount proc raid
depends=mount proc
longdesc=Create and edit partitions on local SCSI, IDE and SATA disks on Linux.
novserver=1
noopenvz=1

View File

@@ -934,13 +934,15 @@ foreach $d (&fdisk::list_disks_partitions()) {
}
}
# Show available RAID devices
local $conf = &raid::get_raidtab();
foreach $c (@$conf) {
next if ($used{$c->{'value'}});
local @ds = &device_status($c->{'value'});
next if (@ds);
push(@opts, [ $c->{'value'}, &text('pv_raid', $c->{'value'} =~ /md(\d+)$/ ? "$1" : $c->{'value'}) ]);
# Show available RAID devices when the module is installed
if ($has_raid) {
local $conf = &raid::get_raidtab();
foreach $c (@$conf) {
next if ($used{$c->{'value'}});
local @ds = &device_status($c->{'value'});
next if (@ds);
push(@opts, [ $c->{'value'}, &text('pv_raid', $c->{'value'} =~ /md(\d+)$/ ? "$1" : $c->{'value'}) ]);
}
}
push(@opts, [ '', $text{'pv_other'} ]);