summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-10-16 11:51:51 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-10-16 11:51:51 +0000
commit341dbb85e7e447dad25770e316aba660db64afa3 (patch)
treec6db9a4d733fc0e5fffadc3dfa9c7f5c3f5787b7 /perl-install/detect_devices.pm
parent713913efd242010ea8950501c7bd8a631a5d55d4 (diff)
downloaddrakx-341dbb85e7e447dad25770e316aba660db64afa3.tar
drakx-341dbb85e7e447dad25770e316aba660db64afa3.tar.gz
drakx-341dbb85e7e447dad25770e316aba660db64afa3.tar.bz2
drakx-341dbb85e7e447dad25770e316aba660db64afa3.tar.xz
drakx-341dbb85e7e447dad25770e316aba660db64afa3.zip
-add cpus detection
- update todo list - perl_checker fix
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm51
1 files changed, 13 insertions, 38 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 21c2fa22f..ace2d12cb 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -346,46 +346,22 @@ sub getATARAID {
values %l;
}
-<<<<<<< detect_devices.pm
-#-AT&F&O2B40
-#- DialString=ATDT0231389595((
-
-#- modem_detect_backend : detects modem on serial ports and fills the infos in $modem : detects only one card
-#- input
-#- $modem
-#- $mouse : facultative, hash containing device to exclude not to test mouse port : ( device => /ttyS[0-9]/ )
-#- output:
-#- $modem->{device} : device where the modem were detected
-sub getSerialModem {
- my ($modem, $mouse) = @_;
- $mouse ||= {};
- $mouse->{device} = readlink "/dev/mouse";
- my $serdev = arch() =~ /ppc/ ? "macserial" : "serial";
- eval { modules::load($serdev) };
-
- detect_devices::probeSerialDevices();
- foreach ('modem', map { "ttyS$_" } (0..7)) {
- next if $mouse->{device} =~ /$_/;
- next unless -e "/dev/$_";
- detect_devices::hasModem("/dev/$_") and $modem->{device} = $_, last;
- }
-
- #- add an alias for macserial on PPC
- modules::add_alias('serial', $serdev) if (arch() =~ /ppc/ && $modem->{device});
- my @devs = detect_devices::pcmcia_probe();
- foreach (@devs) {
- $_->{type} =~ /serial/ and $modem->{device} = $_->{device};
+sub getCPUs {
+ my (@cpus, $cpu);
+ foreach (cat_("/proc/cpuinfo")) {
+ if (/^processor/) {
+ next unless $cpu;
+ push @cpus, $cpu;
+ $cpu = {};
+ } else {
+ /(\S*)\s*:\s*(\S*)/;
+ $cpu->{$1} = $2 if $1;
+ }
}
+ push @cpus, $cpu;
+ @cpus;
}
-sub getModem() {
- my @modems = grep { $_->{media_type} eq 'COMMUNICATION_MODEM' || $_->{media_type} =~ /modem/ } probeall(0);
- my $serial_modem = {};
- getSerialModem($serial_modem);
- @modems, $serial_modem;
-}
-
-=======
#-AT&F&O2B40
#- DialString=ATDT0231389595((
@@ -428,7 +404,6 @@ sub getSpeedtouch {
grep { $_->{description} eq 'Alcatel|USB ADSL Modem (Speed Touch)' } probeall(0);
}
->>>>>>> 1.217
sub getNet() {
grep { !(($::isStandalone || $::live) && /plip/) && c::hasNetDevice($_) } @netdevices;
}