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

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

Copyt trusty code

File size: 1.4 KB
Line 
1package Ocsinventory::Agent::Backend::OS::Linux::Archs::PowerPC::Various;
2
3use strict;
4
5sub check { 1 };
6
7sub run {
8  my $params = shift;
9  my $common = $params->{common};
10
11############ Motherboard
12  my $SystemManufacturer;
13  my $SystemModel;
14  my $SystemSerial;
15  my $BiosManufacturer;
16  my $BiosVersion;
17  my $BiosDate;
18
19 if (open SERIAL,"</proc/device-tree/serial-number") {
20   $SystemSerial = <SERIAL>;
21   $SystemSerial =~ s/[^\,^\.^\w^\ ]//g; # I remove some unprintable char
22   close SERIAL;
23 }
24
25 if (open MODEL,"</proc/device-tree/model") {
26   $SystemModel = <MODEL>;
27   $SystemModel =~ s/[^\,^\.^\w^\ ]//g;
28   close MODEL;
29 }
30
31 if (open COLOR,"</proc/device-tree/color-code") {
32   my $tmp = <COLOR>;
33   close COLOR;
34   my ($color) = unpack "h7" , $tmp;
35   $SystemModel = $SystemModel." color: $color" if $color;
36 }
37
38 if (open OPENBOOT,"</proc/device-tree/openprom/model") {
39   $BiosVersion = <OPENBOOT>;
40   $BiosVersion =~ s/[^\,^\.^\w^\ ]//g;
41   close OPENBOOT;
42 }
43
44 if (open COPYRIGHT,"</proc/device-tree/copyright") {
45   my $tmp = <COPYRIGHT>;
46   close COPYRIGHT;
47
48   if ($tmp =~ /Apple/) {
49   # What about the Apple clone?
50     $BiosManufacturer = "Apple Computer, Inc.";
51     $SystemManufacturer = "Apple Computer, Inc." 
52   }
53 }
54 
55  $common->setBios ({
56      SMANUFACTURER => $SystemManufacturer,
57      SMODEL => $SystemModel,
58      SSN => $SystemSerial,
59      BMANUFACTURER => $BiosManufacturer,
60      BVERSION => $BiosVersion,
61      BDATE => $BiosDate,
62    });
63
64}
65
661
Note: See TracBrowser for help on using the repository browser.