diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-29 13:04:38 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-29 13:04:38 +0000 |
commit | e42c89f180ea62cd61cbd44248a7f9286519529d (patch) | |
tree | a1dfdd37196d772b75a19b6f00e6c734f160f529 | |
parent | 4cab9d5d508d6cafbc6e860a1ecd04b8750ff804 (diff) | |
download | drakx-e42c89f180ea62cd61cbd44248a7f9286519529d.tar drakx-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.gz drakx-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.bz2 drakx-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.xz drakx-e42c89f180ea62cd61cbd44248a7f9286519529d.zip |
(isRemovableUsb): using "Floppy (UFI)" usb media_type is no good, use magical usb2removable instead
(usb_description2removable): more entries
(suggest_mount_point): use new function usb2removable
-rw-r--r-- | perl-install/detect_devices.pm | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index ca18588e4..b9a3d4870 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -196,7 +196,7 @@ sub isDvdDrive { sub isZipDrive { $_[0]{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive. sub isJazzDrive { $_[0]{info} =~ /\bJAZZ?\b/i } #- accept "iomega jaz 1GB" sub isLS120Drive { $_[0]{info} =~ /LS-?120|144MB/ } -sub isRemovableUsb { index($_[0]{usb_media_type}, 'Mass Storage|Floppy (UFI)') == 0 } +sub isRemovableUsb { index($_[0]{usb_media_type}, 'Mass Storage|') == 0 && usb2removable($_[0]) } sub isFloppyUsb { $_[0]{usb_driver} eq 'Removable:floppy' } sub isRemovableDrive { my ($e) = @_; @@ -725,24 +725,32 @@ sub usb_description2removable { local ($_) = @_; return 'camera' if /\bcamera\b/i; return 'memory_card' if /\bmemory\s?stick\b/i || /\bcompact\s?flash\b/i || /\bsmart\s?media\b/i; + return 'memory_card' if /DiskOnKey/i || /IBM-DMDM/i; + return 'zip' if /\bzip\s?(100|250|750)/i; + return 'floppy' if /\bLS-?120\b/i; return; } -sub suggest_mount_point { +sub usb2removable { my ($e) = @_; + $e->{usb_driver} or return; - if (isRemovableUsb($e)) { - if ($e->{usb_driver} =~ /Removable:(.*)/) { - return $1; - } elsif (my $name = usb_description2removable($e->{usb_description})) { - return $name; - } else { - return 'removable'; - } + if ($e->{usb_driver} =~ /Removable:(.*)/) { + return $1; + } elsif (my $name = usb_description2removable($e->{usb_description})) { + return $name; } + undef; +} + +sub suggest_mount_point { + my ($e) = @_; my $name = $e->{media_type}; if (member($name, 'hd', 'fd')) { + if (exists $e->{usb_driver}) { + return usb2removable($e) || 'removable'; + } if (isZipDrive($e)) { $name = 'zip'; } elsif ($name eq 'fd') { |