| 4 |
|
|
| 5 |
package FAI; |
package FAI; |
| 6 |
|
|
| 7 |
foreach my $config (%FAI::configs) |
%FAI::current_config = (); |
| 8 |
|
|
| 9 |
|
my @parted_print = split( "\n", `/sbin/parted -s /dev/hda unit TB print` ); |
| 10 |
|
my $parted_fs_start = 0; |
| 11 |
|
my $parted_fs_end = 0; |
| 12 |
|
|
| 13 |
|
foreach my $line ( @parted_print ) |
| 14 |
{ |
{ |
| 15 |
|
if( $line =~ /^Disk geometry/ ) |
| 16 |
|
{ |
| 17 |
|
next; |
| 18 |
|
} |
| 19 |
|
elsif( $line =~ /^Disk label/ ) |
| 20 |
|
{ |
| 21 |
|
next; |
| 22 |
|
} |
| 23 |
|
elsif( $line =~ /^Number/ ) |
| 24 |
|
{ |
| 25 |
|
$parted_fs_start = 0; |
| 26 |
|
$parted_fs_end = 0; |
| 27 |
|
my @chars = split( "", $line ); |
| 28 |
|
foreach my $char ( @chars ) |
| 29 |
|
{ |
| 30 |
|
$parted_fs_end++; |
| 31 |
|
if( $char eq "F" ) |
| 32 |
|
{ |
| 33 |
|
$parted_fs_start = $parted_fs_end; |
| 34 |
|
} |
| 35 |
|
elsif( $char eq "m" && $parted_fs_start > 0 ) |
| 36 |
|
{ |
| 37 |
|
last; |
| 38 |
|
} |
| 39 |
|
} |
| 40 |
|
$parted_fs_start--; |
| 41 |
|
$parted_fs_end -= $parted_fs_start; |
| 42 |
|
} |
| 43 |
|
else |
| 44 |
|
{ |
| 45 |
|
$line =~ /^.{$parted_fs_start}(.{$parted_fs_end})/; |
| 46 |
|
my $fs = $1; |
| 47 |
|
print $fs . "\n"; |
| 48 |
|
} |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
foreach my $config ( %FAI::configs ) |
| 53 |
|
{ |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
|
|
| 58 |
} |
} |