summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install_any.pm4
-rw-r--r--perl-install/partition_table_raw.pm5
2 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index fbea1410b..a82ebe5b9 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -948,7 +948,9 @@ sub getHds {
$o->setupSCSI; #- ask for an unautodetected scsi card
goto getHds;
}
- $::testing or partition_table_raw::test_for_bad_drives($_) foreach @$hds;
+ if (!$::testing) {
+ @$hds = grep { partition_table_raw::test_for_bad_drives($_) } @$hds;
+ }
$ok = fsedit::verifyHds($hds, $flags->{readonly}, $ok)
if !($flags->{clearall} || $flags->{clear});
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index 733970a4e..5a5f27f1b 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -129,6 +129,8 @@ sub zero_MBR_and_dirty {
#- ugly stuff needed mainly for Western Digital IDE drives
#- try writing what we've just read, yells if it fails
#- testing on last sector of head #0 (unused in 99% cases)
+#-
+#- return false if the device can't be written to (especially for Smartmedia)
sub test_for_bad_drives {
my ($hd) = @_;
@@ -136,7 +138,7 @@ sub test_for_bad_drives {
my $sector = $hd->{geom}{sectors} - 1;
- local *F; openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
+ local *F; openit($hd, *F, 2) or return;
my $seek = sub {
c::lseek_sector(fileno(F), $sector, 0) or die "seeking to sector $sector failed";
@@ -152,6 +154,7 @@ sub test_for_bad_drives {
_("Something bad is happening on your drive.
A test to check the integrity of data has failed.
It means writing anything on the disk will end up with random trash");
+ 1;
}
1;