summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-14 07:05:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-14 07:05:21 +0000
commitc53ca0963d70ff63547e057cd6ee6e43b9e61a71 (patch)
treee7b747e4b755e3e6498e753f7baecc3addda1a98 /perl-install/detect_devices.pm
parentdc9c8c552be8aff80653250805ae343ddd8b3b16 (diff)
downloaddrakx-c53ca0963d70ff63547e057cd6ee6e43b9e61a71.tar
drakx-c53ca0963d70ff63547e057cd6ee6e43b9e61a71.tar.gz
drakx-c53ca0963d70ff63547e057cd6ee6e43b9e61a71.tar.bz2
drakx-c53ca0963d70ff63547e057cd6ee6e43b9e61a71.tar.xz
drakx-c53ca0963d70ff63547e057cd6ee6e43b9e61a71.zip
get the scsi driver name in field {driver}
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 47d027e1e..dd599706c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -187,6 +187,16 @@ sub may_be_a_hd {
);
}
+sub get_scsi_driver {
+ my (@l) = @_;
+ my %host2driver = map { if_(m!.*/(.*)/(.*)!, $2, $1) } glob("/proc/scsi/*/*");
+ foreach (@l) {
+ if (my $driver = $host2driver{$_->{host}}) {
+ $_->{driver} = $driver;
+ }
+ }
+}
+
sub getSCSI_24() {
my $err = sub { log::l("ERROR: unexpected line in /proc/scsi/scsi: $_[0]") };
@@ -226,6 +236,7 @@ sub getSCSI_24() {
get_devfs_devices(@l);
get_sys_cdrom_info(@l);
+ get_scsi_driver(@l);
@l;
}
@@ -284,6 +295,7 @@ sub getSCSI_26() {
get_devfs_devices(@l);
get_sys_cdrom_info(@l);
+ get_scsi_driver(@l);
@l;
}
sub getSCSI() { c::kernel_version() =~ /^\Q2.6/ ? getSCSI_26() : getSCSI_24() }