summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-08-25 15:58:37 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-08-25 15:58:37 +0000
commit4955d09e3c7b57db73bf07724ede3dd0b8791eac (patch)
tree3cfe9fb81e472a84616fde66247ae0929f34e94e /perl-install/detect_devices.pm
parent62dd765fa01539c4c5bfb887173c360d4bc5520c (diff)
downloaddrakx-4955d09e3c7b57db73bf07724ede3dd0b8791eac.tar
drakx-4955d09e3c7b57db73bf07724ede3dd0b8791eac.tar.gz
drakx-4955d09e3c7b57db73bf07724ede3dd0b8791eac.tar.bz2
drakx-4955d09e3c7b57db73bf07724ede3dd0b8791eac.tar.xz
drakx-4955d09e3c7b57db73bf07724ede3dd0b8791eac.zip
(get_scsi_driver) find driver of host controller from sysfs in all
cases (not just usb-storage case)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index a92842a5b..683535eaa 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -194,10 +194,13 @@ sub may_be_a_hd {
sub get_scsi_driver {
my (@l) = @_;
my %host2driver = map { if_(m!.*/(.*)/(.*)!, $2, $1) } glob("/proc/scsi/*/*");
+ # find driver of host controller from sysfs:
foreach (@l) {
- if (my $driver = $host2driver{$_->{host}}) {
- $_->{driver} = $driver;
- }
+ next if $_->{driver};
+ my $host = readlink("/sys/block/$_->{device}/device");
+ $host =~ s!/host.*!!;
+ $_->{driver} = readlink("/sys/block/$_->{device}/$host/driver");
+ $_->{driver} =~ s!.*/!!;
}
}