summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/detect_devices.pm19
1 files changed, 13 insertions, 6 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index c8189d3d2..85e4195b0 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -52,12 +52,19 @@ sub zips() {
sub floppies() {
require modules;
- eval { modules::load("floppy") } if $::isInstall;
- my @fds = $@ ? () : map {
- my $info = (!dev_is_devfs() || -e "/dev/fd$_") && c::floppy_info(devices::make("fd$_"));
- if_($info && $info ne '(null)', { device => "fd$_", devfs_device => "floppy/$_", media_type => 'fd', info => $info });
- } qw(0 1);
-
+ my @fds;
+ my @dmis = dmidecode();
+ # do not try to load floppy if there's no floppy drive:
+ if (!@dmis || find { $_->{'Internal Reference Designator'} eq 'FLOPPY' && $_->{name} eq 'Port Connector' } @dmis) {
+ eval { modules::load("floppy") if $::isInstall };
+ if (!$@) {
+ @fds = map {
+ my $info = (!dev_is_devfs() || -e "/dev/fd$_") && c::floppy_info(devices::make("fd$_"));
+ if_($info && $info ne '(null)', { device => "fd$_", devfs_device => "floppy/$_", media_type => 'fd', info => $info });
+ } qw(0 1);
+ }
+ }
+
my @ide = ls120s() and eval { modules::load("ide-floppy") };
eval { modules::load("usb-storage") } if usbStorage();