/[fai]/people/michael/features/setup_harddisks_2/implementation/lib/sizes.pm
ViewVC logotype

Diff of /people/michael/features/setup_harddisks_2/implementation/lib/sizes.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3585 by michael-guest, Fri Jul 21 22:06:18 2006 UTC revision 3586 by michael-guest, Fri Jul 21 23:40:08 2006 UTC
# Line 4  use strict; Line 4  use strict;
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  }  }

Legend:
Removed from v.3585  
changed lines
  Added in v.3586

  ViewVC Help
Powered by ViewVC 1.1.5