summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-20 09:46:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-20 09:46:40 +0000
commit651a256ee82c18578c3f551e89d3bcadaf68ab43 (patch)
treeabe7390dbcf53aa1d6028e07eaf3d633fe70c9b7 /perl-install/partition_table.pm
parent67ac3075349e74f4984ea04d19569c19ca1efa70 (diff)
downloaddrakx-651a256ee82c18578c3f551e89d3bcadaf68ab43.tar
drakx-651a256ee82c18578c3f551e89d3bcadaf68ab43.tar.gz
drakx-651a256ee82c18578c3f551e89d3bcadaf68ab43.tar.bz2
drakx-651a256ee82c18578c3f551e89d3bcadaf68ab43.tar.xz
drakx-651a256ee82c18578c3f551e89d3bcadaf68ab43.zip
- add field {part_number} for partitions
(handle it in subpart_from_wild_device_name(), partition_table::read()) - create migrate_device_names() to handle the change of device names when changing kernel&modules (eg: hde->hda or hda->sda) - change prototype of install_any::use_root_part() (prefix is dropped, optional $in is added) - create fs::type::can_be_this_fs_type() and use it - create devices::part_number() and devices::part_prefix() and use them
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm20
1 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index edb061bdb..26995921d 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -86,6 +86,12 @@ sub verifyPrimary {
verifyParts_(@{$pt->{normal}}, $pt->{extended});
}
+sub compute_device_name {
+ my ($part, $hd) = @_;
+ $part->{device} = $hd->{prefix} . $part->{part_number};
+ $part->{devfs_device} = $hd->{devfs_prefix} . '/part' . $part->{part_number};
+}
+
sub assign_device_numbers {
my ($hd) = @_;
@@ -104,15 +110,15 @@ sub assign_device_numbers {
log::l("PPC: found a hole on $hd->{prefix} before $_->{start}, skipping device...");
$i++;
}
- $_->{device} = $hd->{prefix} . $i;
- $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
+ $_->{part_number} = $i;
+ compute_device_name($_, $hd);
$start = $_->{start} + $_->{size};
$i++;
}
} else {
foreach (@{$hd->{primary}{raw}}) {
- $_->{device} = $hd->{prefix} . $i;
- $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
+ $_->{part_number} = $i;
+ compute_device_name($_, $hd);
$i++;
}
foreach (map { $_->{normal} } @{$hd->{extended} || []}) {
@@ -124,8 +130,8 @@ sub assign_device_numbers {
will_tell_kernel($hd, del => $_, 'delay_del');
push @{$hd->{partitionsRenumbered}}, [ $_->{device}, $dev ];
}
- $_->{device} = $dev;
- $_->{devfs_device} = $hd->{devfs_prefix} . '/part' . $i;
+ $_->{part_number} = $i;
+ compute_device_name($_, $hd);
if ($renumbered) {
will_tell_kernel($hd, add => $_, 'delay_add');
}
@@ -338,7 +344,7 @@ sub will_tell_kernel {
will_tell_kernel($hd, del => $o_part);
will_tell_kernel($hd, add => $o_part);
} else {
- my $part_number = sub { $o_part->{device} =~ /(\d+)$/ ? $1 : internal_error("bad device " . description($o_part)) };
+ my $part_number = sub { devices::part_number($o_part) || internal_error("bad device " . description($o_part)) };
push @{$hd->{'will_tell_kernel' . ($o_delay || '')} ||= []},
[
$action,