From 8f74cf0f591abf4c9ff4186b5d24c72f4f9b1900 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 22 Jul 2004 07:14:29 +0000 Subject: - isRemovableDrive() removed, partially replaced with may_be_a_hd() - the main difference is that isRemovableDrive() checked isRemovableUsb() whereas may_be_a_hd() allows more usb removable drives (esp. memory cards and some usb keys declared as memory cards (0x0c76 0x0005)) --- perl-install/detect_devices.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'perl-install') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index ec1db195a..0ecd3c79f 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -34,7 +34,7 @@ sub get() { getIDE(), getSCSI(), getDAC960(), getCompaqSmartArray(), getATARAID(); } -sub hds() { grep { $_->{media_type} eq 'hd' && !isRemovableDrive($_) } get() } +sub hds() { grep { may_be_a_hd($_) } get() } sub tapes() { grep { $_->{media_type} eq 'tape' } get() } sub cdroms() { grep { $_->{media_type} eq 'cdrom' } get() } sub burners() { grep { isBurner($_) } cdroms() } @@ -178,12 +178,13 @@ sub isLS120Drive { $_[0]{info} =~ /LS-?120|144MB/ } sub isRemovableUsb { begins_with($_[0]{usb_media_type} || '', 'Mass Storage') && usb2removable($_[0]) } sub isKeyUsb { begins_with($_[0]{usb_media_type} || '', 'Mass Storage') && $_[0]{media_type} eq 'hd' } sub isFloppyUsb { $_[0]{usb_driver} && $_[0]{usb_driver} eq 'Removable:floppy' } -sub isRemovableDrive { +sub may_be_a_hd { my ($e) = @_; - isZipDrive($e) || isLS120Drive($e) - || $e->{media_type} && $e->{media_type} eq 'fd' - || isRemovableUsb($e) - || begins_with($e->{usb_media_type} || '', 'Mass Storage|Floppy (UFI)'); + $e->{media_type} eq 'hd' && !( + isZipDrive($e) + || isLS120Drive($e) + || begins_with($e->{usb_media_type} || '', 'Mass Storage|Floppy (UFI)') + ); } sub getSCSI_24() { -- cgit v1.2.1