From a0092a3d667863341339645f5d0bc9bc4b4b5108 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 15 Jan 2004 11:27:12 +0000 Subject: - remove the use of BLKRRPART (telling the kernel to re-read the partition table) in most cases - replace with tell_kernel() and will_tell_kernel() - correctly handle in standalone the need to reboot, with no way to forget it (telling the WM to quit nicely then call reboot when it's done) --- perl-install/partition_table/raw.pm | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'perl-install/partition_table/raw.pm') diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index 5713e69d6..d8bcf8954 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -113,18 +113,6 @@ sub openit { my $F; sysopen($F, $hd->{file}, $o_mode || 0) && $F; } -# cause kernel to re-read partition table -sub kernel_read($) { - my ($hd) = @_; - common::sync(); - my $F = openit($hd) or return 0; - common::sync(); sleep(1); - $hd->{rebootNeeded} = !ioctl($F, c::BLKRRPART(), 0); - common::sync(); - close $F; - common::sync(); sleep(1); -} - sub raw_removed { my ($_hd, $_raw) = @_; } @@ -157,10 +145,10 @@ sub zero_MBR { } sub zero_MBR_and_dirty { - my ($hd) = @_; + my ($hd) = @_; + my @parts = (partition_table::get_normal_parts($hd), if_($hd->{primary}{extended}, $hd->{primary}{extended})); + partition_table::will_tell_kernel($hd, del => $_) foreach @parts; zero_MBR($hd); - $hd->{isDirty} = $hd->{needKernelReread} = 1; - } #- ugly stuff needed mainly for Western Digital IDE drives -- cgit v1.2.1