From c53ca0963d70ff63547e057cd6ee6e43b9e61a71 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 14 Sep 2004 07:05:21 +0000 Subject: get the scsi driver name in field {driver} --- perl-install/detect_devices.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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() } -- cgit v1.2.1