[Fai-commit] r6249 - branches/stable/3.4/lib/setup-storage

Michael Prokop mika at alioth.debian.org
Thu Dec 23 12:45:50 UTC 2010


Author: mika
Date: 2010-12-23 12:45:49 +0000 (Thu, 23 Dec 2010)
New Revision: 6249

Modified:
   branches/stable/3.4/lib/setup-storage/Commands.pm
Log:
setup-storage/Commands.pm: Use proper dependencies when entire disks are used as
part of a RAID or LVM volume

Thanks: Peter Kruse

Modified: branches/stable/3.4/lib/setup-storage/Commands.pm
===================================================================
--- branches/stable/3.4/lib/setup-storage/Commands.pm	2010-12-23 12:45:44 UTC (rev 6248)
+++ branches/stable/3.4/lib/setup-storage/Commands.pm	2010-12-23 12:45:49 UTC (rev 6249)
@@ -182,8 +182,11 @@
   # set the raid/lvm unless this is an entire disk flag
   my $cmd = "parted -s $disk set $part_no $t on";
   $cmd = "true" if ($part_no == -1);
-  &FAI::push_command( $cmd, "cleared2_$disk,exist_$d", "type_${t}_$d" );
-  if (defined($FAI::partition_table_deps{$disk})) {
+  my $pre = "exist_$d";
+  $pre .= ",cleared2_$disk" if (defined($FAI::configs{"PHY_$disk"}));
+  &FAI::push_command( $cmd, "$pre", "type_${t}_$d" );
+  if (defined($FAI::partition_table_deps{$disk}) &&
+    $FAI::partition_table_deps{$disk} ne "") {
     $FAI::partition_table_deps{$disk} .= ",type_${t}_$d";
   } else {
     $FAI::partition_table_deps{$disk} = "type_${t}_$d";
@@ -309,12 +312,15 @@
         }
 
         $d = &FAI::enc_name($d);
-	if ($vol->{preserve}) {
-	  $pre_req .= (&FAI::phys_dev($d))[0] ?
-	      ",pt_complete_" . (&FAI::phys_dev($d))[1] :
-	      ",exist_$d";
+        my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($d);
+        if ($vol->{preserve}) {
+          $pre_req .= ($i_p_d && defined($FAI::configs{"PHY_$disk"})) ?
+            ",pt_complete_$disk" :
+            ",exist_$d";
         } elsif (&FAI::set_partition_type_on_phys_dev($d, "raid")) {
-          $pre_req .= ",pt_complete_" . (&FAI::phys_dev($d))[1];
+          $pre_req .= defined($FAI::configs{"PHY_$disk"}) ?
+            ",pt_complete_$disk" :
+            ",exist_$d";
         } else {
           $pre_req .= ",exist_$d";
         }




More information about the Fai-commit mailing list