summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-08-25 16:01:28 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-08-25 16:01:28 +0000
commitc4016a940441713854c0a982e4f1ed7129bc0d4c (patch)
tree9e7fc77db135a472488014ad9d521f1e29d32de1
parent4955d09e3c7b57db73bf07724ede3dd0b8791eac (diff)
downloaddrakx-backup-do-not-use-c4016a940441713854c0a982e4f1ed7129bc0d4c.tar
drakx-backup-do-not-use-c4016a940441713854c0a982e4f1ed7129bc0d4c.tar.gz
drakx-backup-do-not-use-c4016a940441713854c0a982e4f1ed7129bc0d4c.tar.bz2
drakx-backup-do-not-use-c4016a940441713854c0a982e4f1ed7129bc0d4c.tar.xz
drakx-backup-do-not-use-c4016a940441713854c0a982e4f1ed7129bc0d4c.zip
since ldetect runs gzip, time spent in some of these detect functions
was a significant part of mcc's startup time
-rw-r--r--perl-install/detect_devices.pm23
1 files changed, 20 insertions, 3 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 683535eaa..77448b3f6 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -673,7 +673,8 @@ sub add_addons {
@l;
}
-sub pci_probe() {
+my (@pci, @usb);
+sub pci_probe__real() {
add_addons($pcitable_addons, map {
my %l;
@l{qw(vendor id subvendor subid pci_bus pci_device pci_function media_type driver description)} = split "\t";
@@ -682,8 +683,15 @@ sub pci_probe() {
\%l;
} c::pci_probe());
}
+sub pci_probe() {
+ if ($::isStandalone && @pci) {
+ @pci;
+ } else {
+ @pci = pci_probe__real();
+ }
+}
-sub usb_probe() {
+sub usb_probe__real() {
-e "/proc/bus/usb/devices" or return;
add_addons($usbtable_addons, map {
@@ -695,6 +703,13 @@ sub usb_probe() {
\%l;
} c::usb_probe());
}
+sub usb_probe() {
+ if ($::isStandalone && @usb) {
+ @usb;
+ } else {
+ @usb = usb_probe__real();
+ }
+}
sub firewire_probe() {
my $dev_dir = '/sys/bus/ieee1394/devices';
@@ -824,11 +839,13 @@ sub tryWrite($) {
sysopen($F, devices::make($_[0]), 1 | c::O_NONBLOCK()) && $F;
}
+my @dmesg;
sub syslog() {
if (-r "/tmp/syslog") {
map { /<\d+>(.*)/ } cat_("/tmp/syslog");
} else {
- `/bin/dmesg`;
+ @dmesg = `/bin/dmesg` if !@dmesg;
+ @dmesg;
}
}