[Fai-commit] r3586 - people/michael/features/setup_harddisks_2/implementation

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Fri Jul 21 23:40:08 UTC 2006


Author: michael-guest
Date: 2006-07-21 23:40:08 +0000 (Fri, 21 Jul 2006)
New Revision: 3586

Modified:
   people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
Log:
parted parsing


Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-21 23:02:57 UTC (rev 3585)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-21 23:40:08 UTC (rev 3586)
@@ -4,8 +4,55 @@
 
 package FAI;
 
-foreach my $config (%FAI::configs)
+%FAI::current_config = ();
+
+my @parted_print = split( "\n", `/sbin/parted -s /dev/hda unit TB print` );
+my $parted_fs_start = 0;
+my $parted_fs_end = 0;
+
+foreach my $line ( @parted_print )
 {
+  if( $line =~ /^Disk geometry/ )
+  {
+    next;
+  }
+  elsif( $line =~ /^Disk label/ )
+  {
+    next;
+  }
+  elsif( $line =~ /^Number/ )
+  {
+    $parted_fs_start = 0;
+    $parted_fs_end = 0;
+    my @chars = split( "", $line );
+    foreach my $char ( @chars )
+    {
+      $parted_fs_end++;
+      if( $char eq "F" )
+      {
+        $parted_fs_start = $parted_fs_end;
+      }
+      elsif( $char eq "m" && $parted_fs_start > 0 )
+      {
+        last;
+      }
+    }
+    $parted_fs_start--;
+    $parted_fs_end -= $parted_fs_start;
+  }
+  else
+  {
+    $line =~ /^.{$parted_fs_start}(.{$parted_fs_end})/;
+    my $fs = $1;
+    print $fs . "\n";
+  }
+}
+
+
+foreach my $config ( %FAI::configs )
+{
+    
+
   
 
 }




More information about the Fai-commit mailing list