diff options
Diffstat (limited to 'perl-install/partition_table_raw.pm')
-rw-r--r-- | perl-install/partition_table_raw.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm index 668913d9c..e48cddce0 100644 --- a/perl-install/partition_table_raw.pm +++ b/perl-install/partition_table_raw.pm @@ -63,6 +63,7 @@ sub get_geometry($) { ioctl(F, c::HDIO_GETGEO(), $g) or return; my %geom; @geom{qw(heads sectors cylinders start)} = unpack "CCSL", $g; + $geom{totalcylinders} = $geom{cylinders}; { geom => \%geom, totalsectors => $geom{heads} * $geom{sectors} * $geom{cylinders} }; } @@ -72,8 +73,15 @@ sub openit($$;$) { sysopen $_[1], $_[0]{file}, $_[2] || 0; } # cause kernel to re-read partition table sub kernel_read($) { my ($hd) = @_; + sync(); local *F; openit($hd, *F) or return 0; + sync(); sleep(1); $hd->{rebootNeeded} = !ioctl(F, c::BLKRRPART(), 0); + sync(); sleep(1); + $hd->{rebootNeeded} = !ioctl(F, c::BLKRRPART(), 0); + sync(); + close F; + sync(); sleep(1); } sub zero_MBR($) { |