summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-28 19:59:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-28 19:59:54 +0000
commit894627271072a1b4bc7c9e476e99da856e4ab2a0 (patch)
tree2332a32c7f581528fef731ddfefa778371d008c5 /perl-install/partition_table.pm
parented167f27c63d598a0ebb35276e4a20ea8bb5ad98 (diff)
downloaddrakx-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar
drakx-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.gz
drakx-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.bz2
drakx-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.xz
drakx-894627271072a1b4bc7c9e476e99da856e4ab2a0.zip
warn if partitions have been renumbered due to a partition being added or removed
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 74645562d..9b09da13b 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -347,9 +347,16 @@ sub assign_device_numbers {
$_->{device} = $hd->{prefix} . $i++;
$start = $_->{start} + $_->{size};
}
- } else {
- $_->{device} = $hd->{prefix} . $i++ foreach @{$hd->{primary}{raw}},
- map { $_->{normal} } @{$hd->{extended} || []};
+ } else {
+ foreach (@{$hd->{primary}{raw}}) {
+ my $dev = $hd->{prefix} . $i++;
+ $_->{device} = $dev;
+ }
+ foreach (map { $_->{normal} } @{$hd->{extended} || []}) {
+ my $dev = $hd->{prefix} . $i++;
+ push @{$hd->{partitionsRenumbered}}, [ $_->{device}, $dev ] if $_->{device} && $dev ne $_->{device};
+ $_->{device} = $dev;
+ }
}
#- try to figure what the windobe drive letter could be!
@@ -633,6 +640,7 @@ sub remove {
delete $_->{normal}; #- remove it
remove_empty_extended($hd);
+ assign_device_numbers($hd);
return $hd->{isDirty} = $hd->{needKernelReread} = 1;
}