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

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

Copyt trusty code

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