summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-06 12:51:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-06 12:51:19 +0000
commit5c2dacabb3f62574c0d936a118b688de8a5a1f6d (patch)
tree84641be7f59fc1068b20629c6ee7237f283438ee /perl-install/partition_table.pm
parentf8c581d20a0d50165bae7edbc2548afae68deb40 (diff)
downloaddrakx-5c2dacabb3f62574c0d936a118b688de8a5a1f6d.tar
drakx-5c2dacabb3f62574c0d936a118b688de8a5a1f6d.tar.gz
drakx-5c2dacabb3f62574c0d936a118b688de8a5a1f6d.tar.bz2
drakx-5c2dacabb3f62574c0d936a118b688de8a5a1f6d.tar.xz
drakx-5c2dacabb3f62574c0d936a118b688de8a5a1f6d.zip
- fix partition device name for some dmraid (missing "p", cf #38363)
simplifying code, since using "p" to separate device name from partition number when device name ends with a digit is standard in the kernel $hd->{prefix} is no more always created. Only used in same special cases
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index dd4a295f0..6890b466d 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -80,7 +80,13 @@ sub verifyPrimary {
sub compute_device_name {
my ($part, $hd) = @_;
- $part->{device} = $hd->{prefix} . $part->{part_number};
+ $part->{device} = _compute_device_name($hd, $part->{part_number});
+}
+
+sub _compute_device_name {
+ my ($hd, $nb) = @_;
+ my $prefix = $hd->{prefix} || $hd->{device} . ($hd->{device} =~ /\d$/ ? 'p' : '');
+ $prefix . $nb;
}
sub assign_device_numbers {
@@ -98,7 +104,7 @@ sub assign_device_numbers {
#- now loop through them, assigning partition numbers - reserve one for the holes
foreach (@{$hd->{primary}{normal}}) {
if ($_->{start} > $start) {
- log::l("PPC: found a hole on $hd->{prefix} before $_->{start}, skipping device...");
+ log::l("PPC: found a hole on $hd->{device} before $_->{start}, skipping device...");
$i++;
}
$_->{part_number} = $i;
@@ -113,7 +119,7 @@ sub assign_device_numbers {
$i++;
}
foreach (map { $_->{normal} } @{$hd->{extended} || []}) {
- my $dev = $hd->{prefix} . $i;
+ my $dev = _compute_device_name($hd, $i);
my $renumbered = $_->{device} && $dev ne $_->{device};
if ($renumbered) {
require fs::mount;