From 5dc2835bfbf1f53ad51ba540f4423c22cc94b26c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 25 Jul 1999 21:30:14 +0000 Subject: no_comment --- perl-install/partition_table.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 0ad949a53..1986e4dd9 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -78,7 +78,7 @@ my %fs2type = reverse %type2fs; 1; -sub type2name($) { $types{$_[0]} } +sub type2name($) { $types{$_[0]} || 'unknown' } sub type2fs($) { $type2fs{$_[0]} } sub name2type($) { $types_rev{$_[0]} } sub fs2type($) { $fs2type{$_[0]} } @@ -137,6 +137,20 @@ sub assign_device_numbers($) { my $i = 1; foreach (@{$hd->{primary}->{raw}}, map { $_->{normal} } @{$hd->{extended}}) { $_->{device} = $hd->{prefix} . $i++; } + + # try to figure what the windobe drive letter could be! + # + # first verify there's at least one primary dos partition, otherwise it + # means it is a secondary disk and all will be false :( + my ($c, @others) = grep { isDos($_) || isWin($_) } @{$hd->{primary}->{raw}}; + $c or return; + + $i = ord 'D'; + foreach (grep { isDos($_) || isWin($_) } @{$hd->{extended}}) { + $_->{device_windobe} = chr($i++); + } + $c->{device_windobe} = 'C'; + $_->{device_windobe} = chr($i++) foreach @others; } sub get_normal_parts($) { -- cgit v1.2.1