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

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Sat Jul 22 09:27:43 UTC 2006


Author: michael-guest
Date: 2006-07-22 09:27:43 +0000 (Sat, 22 Jul 2006)
New Revision: 3603

Added:
   people/michael/features/setup_harddisks_2/implementation/shdd2-init
Modified:
   people/michael/features/setup_harddisks_2/implementation/shdd2
   people/michael/features/setup_harddisks_2/implementation/shdd2-parser
   people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
Log:
backup


Modified: people/michael/features/setup_harddisks_2/implementation/shdd2
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2	2006-07-22 00:46:04 UTC (rev 3602)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2	2006-07-22 09:27:43 UTC (rev 3603)
@@ -2,6 +2,7 @@
 
 use strict;
 
+require "shdd2-init";
 require "shdd2-parser";
 require "shdd2-sizes";
 require "shdd2-commands";

Added: people/michael/features/setup_harddisks_2/implementation/shdd2-init
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-22 00:46:04 UTC (rev 3602)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-22 09:27:43 UTC (rev 3603)
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+package FAI;
+
+# getopt processing
+
+#REMOVE THIS
+# use a predefined list?
+
+$ENV{disklist} = "hda
+";
+################
+#
+
+ at FAI::disks = split(/\n/, $ENV{disklist});
+
+%FAI::disklabels = ();
+
+$FAI::disklabels{ "msdos" } = {
+  "has_extended" => 1,
+  "max_primary"
+};
+
+1;
+


Property changes on: people/michael/features/setup_harddisks_2/implementation/shdd2-init
___________________________________________________________________
Name: svn:executable
   + *

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-parser
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-22 00:46:04 UTC (rev 3602)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-parser	2006-07-22 09:27:43 UTC (rev 3603)
@@ -83,14 +83,6 @@
 
 package FAI;
 
-#REMOVE THIS
-$ENV{disklist} = "hda
-";
-################
-#
-
- at FAI::disks = split(/\n/, $ENV{disklist});
-
 %FAI::configs = ();
 
 $FAI::device = "";
@@ -254,20 +246,66 @@
         {
         }
     mountpoint: '-'
+        {
+          $FAI::partition_pointer->{ "mountpoint" } = "-";
+        }
         | 'swap'
+        {
+          $FAI::partition_pointer->{ "mountpoint" } = "swap";
+        }
         | m{^/\S*}
+        {
+          $FAI::partition_pointer->{ "mountpoint" } = $item[ 1 ];
+        }
     name: /^\S+/
-    size: /^\d+%?(-(\d+%?)?)?(:resize)?\s+/
+    size: /^(\d+%?(-(\d+%?)?)?)(:resize)?\s+/
         {
-           printf "matched nr.1 $item[1] \n";
+          my $range = $1;
+          if( ! defined( $2 ) )
+          {
+            $range = $range . "-" . $1;
+          }
+          elsif( ! defined( $3 ) )
+          {
+            $range = $range . "100%";
+          }
+          $FAI::partition_pointer->{ "size" } = {
+            "range" => $range
+          };
+          if( defined( $4 ) || defined( $FAI::partition_pointer->{ "size" }{ "resize" } ) )
+          {
+            $FAI::partition_pointer->{ "size" } = {
+              "resize" => 1
+            };
+          }
+          else
+          {
+            $FAI::partition_pointer->{ "size" } = {
+              "resize" => 0
+            };
+          }
         }
-        | /^-\d+%?(:resize)?\s+/
+        | /^(-\d+%?)(:resize)?\s+/
         {
-          printf "matched nr.2 $item[1] \n";
+          $FAI::partition_pointer->{ "size" } = {
+            "range" => "0" . $1
+          };
+          if( defined( $2 ) || defined( $FAI::partition_pointer->{ "size" }{ "resize" } ) )
+          {
+            $FAI::partition_pointer->{ "size" } = {
+              "resize" => 1
+            };
+          }
+          else
+          {
+            $FAI::partition_pointer->{ "size" } = {
+              "resize" => 0
+            };
+          }
         }
-        | /^preserve\d+\s+/
+        | /^preserve(\d+)\s+/
         {
-          printf "matched nr.3 $item[1] \n";
+          $FAI::partition_pointer->{ "size" } = $item[ 1 ];
         }
         | /^[^\d,:\s\-][^,:\s]*(:(spare|missing))*(,[^,:\s]+(:(spare|missing))*)*\s+/
         {

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-22 00:46:04 UTC (rev 3602)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-22 09:27:43 UTC (rev 3603)
@@ -141,10 +141,14 @@
    }
    elsif( $config =~ /^PHY_(.*)$/ )
    {
-     foreach my $part_id ( keys %{ $FAI::configs{ $config }{ "partitions" } } )
+     foreach my $part_id ( sort keys %{ $FAI::configs{ $config }{ "partitions" } } )
      {
+       # my $part_size = $FAI::configs{ $config }{ "partitions" }{ $part_id }{
+       # "size" }
+
        print "$part_id of $config configured\n";
      }
+     # compute size of extended later on
    }
    else
    {




More information about the Fai-commit mailing list