summaryrefslogtreecommitdiffstats
path: root/perl-install/modules.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/modules.pm')
-rw-r--r--perl-install/modules.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index aa1358498..e34f16fd1 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -65,7 +65,19 @@ sub load_raw {
or !run_program::run('/sbin/modprobe', '-n', $_) #- ignore missing modules
or die "insmod'ing module $_ failed" foreach @$l;
}
- sleep 2 if any { /^(usb-storage|mousedev|printer)$/ } @$l;
+ if (any { /^(mousedev|printer)$/ } @$l) {
+ sleep 2;
+ } elsif (member('usb-storage', @$l)) {
+ #- usb-storage is only modprobed when we know there is some scsi devices
+ #- so trying hard to wait for devices to be detected
+ my $retry = 10;
+ sleep 1; #- TOREMOVE for compatibility with previous behaviour: wait at least 2 seconds
+ do {
+ sleep 1;
+ last if all('/sys/bus/scsi/devices');
+ log::l("waiting for usb-storage devices to appear (retry = $retry)");
+ } until !$retry--;
+ }
}
sub load_with_options {
my ($l, $h_options) = @_;