line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
2
|
|
|
|
|
|
|
$Tapper::Installer::Precondition::Fstab::VERSION = '5.0.1'; |
3
|
|
|
|
|
|
|
use strict; |
4
|
3
|
|
|
3
|
|
21
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
76
|
|
5
|
3
|
|
|
3
|
|
13
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
60
|
|
6
|
|
|
|
|
|
|
use Moose; |
7
|
3
|
|
|
3
|
|
14
|
use YAML; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
25
|
|
8
|
3
|
|
|
3
|
|
15648
|
use File::Basename; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
141
|
|
9
|
3
|
|
|
3
|
|
16
|
extends 'Tapper::Installer::Precondition'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
508
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my ($self, $precond) = @_; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
0
|
1
|
|
my ($filename, $path, $retval); |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $basedir = $self->cfg->{paths}{base_dir}; |
19
|
|
|
|
|
|
|
my $line = $precond->{line}; |
20
|
0
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $cmd = '(echo "" ; echo "# precond::fstab" ; echo "'.$line.'" ) >> '.$basedir.'/etc/fstab'; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$self->log->debug($cmd); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
system($cmd) == 0 or return ("Could not patch /etc/fstab: $!"); |
26
|
|
|
|
|
|
|
return 0; |
27
|
0
|
0
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding UTF-8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Tapper::Installer::Precondition::Fstab |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use Tapper::Installer::Precondition::Fstab; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Tapper::Installer::Precondition::Fstab - Insert a line into /etc/fstab |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 FUNCTIONS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 install |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Install a file from an nfs share. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
@param hash reference - contains all precondition information |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
@return success - 0 |
57
|
|
|
|
|
|
|
@return error - error string |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHORS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over 4 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=back |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is Copyright (c) 2022 by Advanced Micro Devices, Inc. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software, licensed under: |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |