line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# system::fsck Brik |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Metabrik::System::Fsck; |
7
|
1
|
|
|
1
|
|
814
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use base qw(Metabrik::Shell::Command Metabrik::System::Package Metabrik::System::Mount); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
610
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
15
|
|
|
|
|
|
|
tags => [ qw(unstable fat fat16 fat32 repair disk) ], |
16
|
|
|
|
|
|
|
author => 'GomoR ', |
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
18
|
|
|
|
|
|
|
commands => { |
19
|
|
|
|
|
|
|
install => [ ], # Inherited |
20
|
|
|
|
|
|
|
fat => [ qw(device) ], |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
require_binaries => { |
23
|
|
|
|
|
|
|
dosfsck => [ ], |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
need_packages => { |
26
|
|
|
|
|
|
|
ubuntu => [ qw(dosfstools) ], |
27
|
|
|
|
|
|
|
debian => [ qw(dosfstools) ], |
28
|
|
|
|
|
|
|
kali => [ qw(dosfstools) ], |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub fat { |
34
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
35
|
0
|
|
|
|
|
|
my ($device) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('fat', $device) or return; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $is_mounted = $self->is_device_mounted($device); |
40
|
0
|
0
|
|
|
|
|
if (! defined($is_mounted)) { |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
if ($is_mounted) { |
45
|
0
|
0
|
|
|
|
|
my $directory = $self->get_device_mounted_directory($device) or return; |
46
|
0
|
|
|
|
|
|
return $self->log->error("fat: you must unmount [$directory] first"); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my $cmd = 'dosfsck -w -r -l -v "'.$device.'"'; |
50
|
0
|
|
|
|
|
|
return $self->sudo_execute($cmd); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |