diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-11-30 15:27:24 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-11-30 15:27:24 +0000 |
commit | be3f8750d635d2a008d919aa46f219996926a502 (patch) | |
tree | 458895dfed0bb0b815b41c89e6256e1078249e9b | |
parent | 3d9262a59e3a5c82d68d21ab60f9a2c3f188010e (diff) | |
download | drakx-be3f8750d635d2a008d919aa46f219996926a502.tar drakx-be3f8750d635d2a008d919aa46f219996926a502.tar.gz drakx-be3f8750d635d2a008d919aa46f219996926a502.tar.bz2 drakx-be3f8750d635d2a008d919aa46f219996926a502.tar.xz drakx-be3f8750d635d2a008d919aa46f219996926a502.zip |
(floppies) do not try to load floppy if there's no floppy drive (#8211)
a side effect is that now we'll still see the floppy drive even if
some buggy code triggered $@ earlier
-rw-r--r-- | perl-install/detect_devices.pm | 19 |
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(); |