summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-29 13:04:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-29 13:04:38 +0000
commite42c89f180ea62cd61cbd44248a7f9286519529d (patch)
treea1dfdd37196d772b75a19b6f00e6c734f160f529 /perl-install/detect_devices.pm
parent4cab9d5d508d6cafbc6e860a1ecd04b8750ff804 (diff)
downloaddrakx-backup-do-not-use-e42c89f180ea62cd61cbd44248a7f9286519529d.tar
drakx-backup-do-not-use-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.gz
drakx-backup-do-not-use-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.bz2
drakx-backup-do-not-use-e42c89f180ea62cd61cbd44248a7f9286519529d.tar.xz
drakx-backup-do-not-use-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
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm28
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') {