From ffeb132773e872b6aa85d03890e3b67f8275095c Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 9 Feb 2010 19:47:35 +0000 Subject: fix using empty dmraid --- perl-install/partition_table/raw.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'perl-install/partition_table') diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index 1346eeac4..edae9bb65 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -124,7 +124,19 @@ sub get_geometries { my (@hds) = @_; @hds = grep { - if (my $h = get_geometry($_->{file})) { + if ($_->{bus} =~ /dmraid/) { + sysopen(my $F, $_->{file}, 0); + my $total = c::total_sectors(fileno $F); + my %geom; + $geom{heads} = 255; + $geom{sectors} = 63; + $geom{start} = 1; + compute_nb_cylinders(\%geom, $total); + $geom{totalcylinders} = $geom{cylinders}; + log::l("Fake geometry on ".$_->{file}.": heads=$geom{heads} sectors=$geom{sectors} cylinders=$geom{cylinders} start=$geom{start}"); + add2hash_($_, { totalsectors => $total, geom => \%geom }); + 1; + } elsif (my $h = get_geometry($_->{file})) { add2hash_($_, $h); 1; } else { -- cgit v1.2.1