summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}
}