use diagnostics; use strict; my $scsiDeviceAvailable; my $CSADeviceAvailable; 1; sub scsiDeviceAvailable { defined $scsiDeviceAvailable and return $scsiDeviceAvailable; local *F; open F, "/proc/scsi/scsi" or log::l("failed to open /proc/scsi/scsi: $!"), return 0; foreach () { /devices: none/ and log::l("no scsi devices are available"), return $scsiDeviceAvailable = 0; } log::l("scsi devices are available"); $scsiDeviceAvailable = 1; } sub CompaqSmartArrayDeviceAvailable { defined $CSADeviceAvailable and return $CSADeviceAvailable; -r "/proc/array/ida0" or log::l("failed to open /proc/array/ida0: $!"), return $CSADeviceAvailable = 0; log::l("Compaq Smart Array controllers available"); $CSADeviceAvailable = 1; } sub scsiGetDevices { my @drives; my ($driveNum, $cdromNum, $tapeNum) = qw(0 0 0); my $err = sub { chop; log::l("unexpected line in /proc/scsi/scsi: $_"); error() }; local $_; local *F; open F, "/proc/scsi/scsi" or return &$err(); $_ = ; /^Attached devices:/ or return &$err(); while ($_ = ) { my ($id) = /^Host:.*?Id: (\d+)/ or return &$err(); $_ = ; my ($vendor, $model) = /^\s*Vendor:\s*(.*?)\s+Model:\s*(.*?)\s+Rev:/ or return &$err(); $_ = ; my ($type) = /^\s*Type:\s*(.*)/ or &$err(); my $device; if ($type =~ /Direct-Access/) { $type = 'hd'; $device = "sd" . chr($driveNum++ + ord('a')); } elsif ($type =~ /Sequential-Access/) { $type = 'tape'; $device = "st" . $tapeNum++; } elsif ($type =~ /CD-ROM/) { $type = 'cdrom'; $device = "scd" . $cdromNum++; } $device and push @drives, { device => $device, type => $type, info => "$vendor $model", id => $id, bus => 0 }; } [ @drives ]; } sub ideGetDevices { my @idi; -r "/proc/ide" or die "sorry, /proc/ide not available, seems like you have a pre-2.2 kernel\n => not handled yet :("; #- Great. 2.2 kernel, things are much easier and less error prone. foreach my $d (glob_('/proc/ide/hd*')) { my ($t) = chomp_(cat_("$d/media")); my $type = $ {{disk => 'hd', cdrom => 'cdrom', tape => 'tape', floppy => 'fd'}}{$t} or next; my ($info) = chomp_(cat_("$d/model")); $info ||= "(none)"; my $num = ord (($d =~ /(.)$/)[0]) - ord 'a'; push @idi, { type => $type, device => basename($d), info => $info, bus => $num/2, id => $num%2 }; } [ @idi ]; } sub CompaqSmartArrayGetDevices { my @idi; my $f; for (my $i = 0; -r ($f = "/proc/array/ida$i"); $i++) { local *F; open F, $f or die; local $_ = ; my ($name) = m|ida/(.*?):| or next; push @idi, { device => $name, info => "Compaq RAID logical disk", type => 'hd' }; } [ @idi ]; } sub dac960GetDevices { my @idi; my $file = "/var/log/dmesg"; -r $file or $file = "/tmp/syslog"; local *F; open F, $file or die "Failed to open $file: $!"; #- We are looking for lines of this format:DAC960#0: #- /dev/rd/c0d0: RAID-7, Online, 17928192 blocks, Write Thru0123456790123456789012 foreach () { my ($devicename, $info) = m|/dev/rd/(.*?): (.*?),| or next; push @idi, { info => $info, type => 'hd', devicename => $devicename }; log::l("DAC960: $devicename: $info"); } [ @idi ]; } /mandrakesoft Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-04 16:56:16 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-04 16:56:16 +0000
commit262a638e936bf99ff539815fe35895e144fa4e2d (patch)
treec1a6cd6745023b7f6700527b53c11291a48dffb3 /perl-install/install2.pm
parent68c3c1cd6e89d6a0f91f6c86510ec661864da336 (diff)
downloaddrakx-262a638e936bf99ff539815fe35895e144fa4e2d.tar
drakx-262a638e936bf99ff539815fe35895e144fa4e2d.tar.gz
drakx-262a638e936bf99ff539815fe35895e144fa4e2d.tar.bz2
drakx-262a638e936bf99ff539815fe35895e144fa4e2d.tar.xz
drakx-262a638e936bf99ff539815fe35895e144fa4e2d.zip
no_comment
Diffstat (limited to 'perl-install/install2.pm')
-rw-r--r--perl-install/install2.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index ffa55fd36..1e902d1aa 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -329,7 +329,7 @@ sub selectLanguage {
addToBeDone {
unless ($o->{isUpgrade}) {
- lang ::write($o->{prefix});
+ lang::write($o->{prefix});
keyboard::write($o->{prefix}, $o->{keyboard});
}
} 'doInstallStep';