source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/m68k/CPU.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 705 bytes
Line 
1package Ocsinventory::Agent::Backend::OS::Linux::Archs::m68k::CPU;
2use strict;
3
4sub check { can_read("/proc/cpuinfo") }
5
6sub run {
7    my $params = shift;
8    my $common = $params->{common};
9
10    my @cpu;
11    my $current;
12    open CPUINFO, "</proc/cpuinfo" or warn;
13    foreach(<CPUINFO>) {
14        print;
15        if (/^CPU\s+:\s*:/) {
16
17            if ($current) {
18                $common->addCPU($current);
19            }
20
21            $current = {
22                ARCH => 'm68k',
23            };
24
25        } else {
26
27            $current->{TYPE} = $1 if /CPU:\s+(\S.*)/;
28            $current->{SPEED} = $1 if /Clocking:\s+:\s+(\S.*)/;
29
30        }
31    }
32
33    # The last one
34    $common->addCPU($current);
35}
36
371
Note: See TracBrowser for help on using the repository browser.