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

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Sun Jul 23 20:22:24 UTC 2006


Author: michael-guest
Date: 2006-07-23 20:22:23 +0000 (Sun, 23 Jul 2006)
New Revision: 3670

Modified:
   people/michael/features/setup_harddisks_2/implementation/shdd2-commands
   people/michael/features/setup_harddisks_2/implementation/shdd2-init
   people/michael/features/setup_harddisks_2/implementation/shdd2-lib
   people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
Log:
renamed bash_commands to system_commands, comment cleanup


Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-commands
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-23 20:05:49 UTC (rev 3669)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2006-07-23 20:22:23 UTC (rev 3670)
@@ -108,7 +108,7 @@
         else
         {
           push @FAI::commands,
-            "$FAI::bash_commands{'parted'} $disk mklabel $target_label";
+            "$FAI::system_commands{'parted'} $disk mklabel $target_label";
         }
       }
       else
@@ -122,7 +122,7 @@
             next;
           }
           push @FAI::commands,
-            "$FAI::bash_commands{'parted'} $disk rm $part_id";
+            "$FAI::system_commands{'parted'} $disk rm $part_id";
         }
       }
 
@@ -166,7 +166,7 @@
             $FAI::configs{$config}{"partitions"}{"size"}{"eff_size"} +
             $next_start - 1;
           push @FAI::commands,
-            "$FAI::bash_commands{'parted'} $disk resize $part_id $next_start"
+            "$FAI::system_commands{'parted'} $disk resize $part_id $next_start"
             . "B "
             . $part_size . "B";
           unless ( $FAI::configs{$config}{"disklabel"} eq "msdos"
@@ -195,7 +195,7 @@
             $FAI::configs{$config}{"partitions"}{$part_id}{"size"}{"eff_size"} +
             $next_start - 1;
           push @FAI::commands,
-            "$FAI::bash_commands{'parted'} $disk mkpart $part_type $next_start"
+            "$FAI::system_commands{'parted'} $disk mkpart $part_type $next_start"
             . "B "
             . $part_size . "B";
           unless ( $FAI::configs{$config}{"disklabel"} eq "msdos"

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-init
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-23 20:05:49 UTC (rev 3669)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-init	2006-07-23 20:22:23 UTC (rev 3670)
@@ -54,7 +54,6 @@
 @FAI::disks = split( /\n/, $ENV{disklist} );
 
 ################################################################################
-#the hash, where we write the disc config we want to have
 #
 # @brief The hash of all configurations specified in the disk_config file
 #
@@ -70,7 +69,6 @@
 %FAI::configs = ();
 
 ################################################################################
-#the hash, with information about the actual disc config
 #
 # @brief The current disk configuration
 #
@@ -82,7 +80,6 @@
 %FAI::current_config = ();
 
 ################################################################################
-#list of commands
 #
 # @brief The list of commands to be executed
 #
@@ -91,13 +88,15 @@
 
 ################################################################################
 #
-# @brief The parted command to be run
+# @brief A map of commands 
 #
+# TODO check for availability, exact version?
+#
 ################################################################################
-$FAI::parted_binary = "/sbin/parted -s";
+%FAI::system_commands = {
+  mdadm => "/sbin/mdadm",
+  parted => "/sbin/parted -s"
+};
 
-#list of bash commands
-%FAI::bash_commands = ( parted => "/sbin/parted -s", );
-
 1;
 

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-lib
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-lib	2006-07-23 20:05:49 UTC (rev 3669)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-lib	2006-07-23 20:22:23 UTC (rev 3670)
@@ -65,27 +65,21 @@
 
 ################################################################################
 #
-# @brief our structure, in which we hold informations about existing partitions
-# and partitions we wan't to create a hold in hash of hashes. This debug function
+# @brief The structure, in which we hold informations about existing partitions
+# and partitions we want to create a hold in hash of hashes. This debug function
 # allows to recursivly print such a hash with all keys und subhashes
-# @brief Recursively explore the hash
 #
 # @param hash_ref the reference to the hash, where we want to start printing
 # the hash recursively
-# @param $cmd Command that is to be found in $PATH
 #
-# @param k help variable, is only to be used for the recursion. caller function
-# shoudn't set this one
+# @param k A helper variable, is only to be used for the recursion. The caller
+# caller shoudn't set this one
 #
-# @return returns nothing, is a void function
-# @return 1, if the command is found, else 0
-#
 ################################################################################
 sub print_hash
 {
 
   # This function is for debugging purposes only
-  # only be used in debugging mode, otherwise return silently
   ( $FAI::debug > 0 ) or return 0;
 
   # get the function parameters

Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-sizes
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-23 20:05:49 UTC (rev 3669)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-sizes	2006-07-23 20:22:23 UTC (rev 3670)
@@ -54,7 +54,7 @@
       $ENV{"NO_DRY_RUN"} = "1";
       my $error =
         &FAI::execute_command(
-        "$FAI::bash_commands{'parted'}} $disk unit TiB print",
+        "$FAI::system_commands{'parted'}} $disk unit TiB print",
         \@parted_print, 0 );
       $ENV{"NO_DRY_RUN"} = "";
 
@@ -63,7 +63,7 @@
       {
         $error =
           &FAI::execute_command(
-          "$FAI::bash_commands{'parted'}} $disk mklabel msdos");
+          "$FAI::system_commands{'parted'}} $disk mklabel msdos");
         next;
       }
 
@@ -134,7 +134,7 @@
     $ENV{"NO_DRY_RUN"} = "1";
     @parted_print = ();
     &FAI::execute_command_std(
-      "$FAI::bash_commands{'parted'}} $disk unit B print",
+      "$FAI::system_commands{'parted'}} $disk unit B print",
       \@parted_print, 0 );
     $ENV{"NO_DRY_RUN"} = "";
 
@@ -182,7 +182,7 @@
     $ENV{"NO_DRY_RUN"} = "1";
     @parted_print = ();
     &FAI::execute_command_std(
-      "$FAI::bash_commands{'parted'}} $disk unit chs print",
+      "$FAI::system_commands{'parted'}} $disk unit chs print",
       \@parted_print, 0 );
     $ENV{"NO_DRY_RUN"} = "";
 




More information about the Fai-commit mailing list