line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Hardware::Kernel; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
39
|
use v5.12.5; |
|
3
|
|
|
|
|
12
|
|
8
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
143
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.14.3'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
30
|
use Rex::Helper::Run; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
724
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require Rex::Hardware; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
|
|
|
|
|
|
|
18
|
9
|
|
|
9
|
0
|
82
|
my $cache = Rex::get_cache(); |
19
|
9
|
|
|
|
|
83
|
my $cache_key_name = $cache->gen_key_name("hardware.kernel"); |
20
|
|
|
|
|
|
|
|
21
|
9
|
50
|
|
|
|
90
|
if ( $cache->valid($cache_key_name) ) { |
22
|
0
|
|
|
|
|
0
|
return $cache->get($cache_key_name); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
9
|
|
|
|
|
66
|
my $data = { |
26
|
|
|
|
|
|
|
architecture => i_run("uname -m"), |
27
|
|
|
|
|
|
|
kernel => i_run("uname -s"), |
28
|
|
|
|
|
|
|
kernelrelease => i_run("uname -r"), |
29
|
|
|
|
|
|
|
kernelversion => i_run("uname -v"), |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
9
|
|
|
|
|
213
|
$cache->set( $cache_key_name, $data ); |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
196
|
return $data; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |