summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-13 11:37:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-13 11:37:17 +0000
commitccd328a91005d8942f6afb74880e018636ba573c (patch)
treee37ced6a8977666aa3276385126499e8fe1a199c
parent648e175de516e58070c89fa691fcbce89192d4c5 (diff)
downloaddrakx-ccd328a91005d8942f6afb74880e018636ba573c.tar
drakx-ccd328a91005d8942f6afb74880e018636ba573c.tar.gz
drakx-ccd328a91005d8942f6afb74880e018636ba573c.tar.bz2
drakx-ccd328a91005d8942f6afb74880e018636ba573c.tar.xz
drakx-ccd328a91005d8942f6afb74880e018636ba573c.zip
- handle WORM type in /proc/scsi/scsi
- added media_type cdrom-burner - adapting to new media_type - nicer fd&hd testing
-rw-r--r--perl-install/detect_devices.pm22
-rw-r--r--perl-install/diskdrake/interactive.pm2
-rw-r--r--perl-install/fs.pm4
3 files changed, 16 insertions, 12 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index e63ba16a8..c83d1043c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -32,12 +32,12 @@ sub get {
getIDE(), getSCSI(), getDAC960(), getCompaqSmartArray(), getATARAID();
}
sub hds() { grep { $_->{media_type} eq 'hd' && ($::isStandalone || !isRemovableDrive($_)) } get(); }
-sub zips() { grep { $_->{media_type} =~ /.d/ && isZipDrive($_) } get(); }
-sub ide_zips() { grep { $_->{media_type} =~ /.d/ && isZipDrive($_) } getIDE(); }
-#-sub jazzs() { grep { $_->{media_type} =~ /.d/ && isJazDrive($_) } get(); }
-sub ls120s() { grep { $_->{media_type} =~ /.d/ && isLS120Drive($_) } get(); }
+sub zips() { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } get(); }
+sub ide_zips() { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } getIDE(); }
+#-sub jazzs() { grep { member($_->{media_type}, 'fd', 'hd') && isJazDrive($_) } get(); }
+sub ls120s() { grep { member($_->{media_type}, 'fd', 'hd') && isLS120Drive($_) } get(); }
sub cdroms() {
- my @l = grep { $_->{media_type} eq 'cdrom' } get();
+ my @l = grep { $_->{media_type} =~ /cdrom/ } get();
if (my @l2 = IDEburners()) {
require modules;
modules::add_alias('scsi_hostadapter', 'ide-scsi');
@@ -50,9 +50,9 @@ sub cdroms() {
}
@l;
}
-sub burners { grep { $_->{media_type} eq 'cdrom' && isBurner($_) } get() }
-sub IDEburners { grep { $_->{media_type} eq 'cdrom' && isBurner($_) } getIDE() }
-sub dvdroms { grep { $_->{media_type} eq 'cdrom' && isDvdDrive($_) } get() }
+sub burners { grep { $_->{media_type} eq 'cdrom-burner' || $_->{media_type} =~ /cdrom/ && isBurner($_) } get() }
+sub IDEburners { grep { $_->{media_type} eq 'cdrom-burner' || $_->{media_type} =~ /cdrom/ && isBurner($_) } getIDE() }
+sub dvdroms { grep { $_->{media_type} =~ /cdrom/ && isDvdDrive($_) } get() }
sub get_mac_model() {
my $mac_model = cat_("/proc/device-tree/model") || die "Can't open /proc/device-tree/model";
@@ -94,7 +94,8 @@ sub floppy { first(floppies_dev()) }
#- example ls120, model = "LS-120 SLIM 02 UHD Floppy"
sub isBurner {
- my $dev = $_[0]{device};
+ my ($e) = @_;
+ my $dev = $e->{device};
if (my($nb) = $dev =~ /scd(.*)/) {
grep { /^(scd|sr)$nb:.*writer/ } syslog();
} else {
@@ -142,6 +143,9 @@ sub getSCSI() {
} elsif ($type =~ /CD-ROM/) {
$device = "scd" . $cdromNum++;
$type = 'cdrom';
+ } elsif ($type =~ /WORM/) {
+ $device = "scd" . $cdromNum++;
+ $type = 'cdrom-burner';
}
$device and push @drives, { device => $device, media_type => $type, info => "$vendor $model", id => $id, bus => 0 };
}
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index a4d731b83..ff3e85051 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -99,7 +99,7 @@ struct hd {
int totalsectors # size in sectors
string device # 'hda', 'sdc' ...
string device_alias # 'cdrom', 'floppy' ...
- string media_type # one of { 'hd', 'cdrom', 'fd', 'tape' }
+ string media_type # one of { 'hd', 'cdrom', 'cdrom-burner', 'fd', 'tape' }
string info # name of the hd, eg: 'QUANTUM ATLAS IV 9 WLS'
bool isDirty # does it need to be written to the disk
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 5156a9c4c..e75970330 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -331,11 +331,11 @@ sub set_default_options {
if ($options->{supermount} && $is_auto) {
# this can't work, guessing :-(
- $part->{type} = fs2type($part->{media_type} eq 'cdrom' ? 'iso9660' : 'vfat');
+ $part->{type} = fs2type($part->{media_type} =~ /cdrom/ ? 'iso9660' : 'vfat');
$is_auto = 0;
}
- if ($part->{media_type} eq 'cdrom') {
+ if ($part->{media_type} =~ /cdrom/) {
$options->{ro} = 1;
}