[Fai-commit] r5185 - people/michael/experimental/patches

mt at alioth.debian.org mt at alioth.debian.org
Sun Oct 12 08:54:41 UTC 2008


Author: mt
Date: 2008-10-12 08:54:41 +0000 (Sun, 12 Oct 2008)
New Revision: 5185

Modified:
   people/michael/experimental/patches/setup-storage_command-dependencies
   people/michael/experimental/patches/setup-storage_liblinux-lvm
Log:
further bugfixes:
- logic errors in command dependencies
- perl syntax problem in use of Linux::LVM


Modified: people/michael/experimental/patches/setup-storage_command-dependencies
===================================================================
--- people/michael/experimental/patches/setup-storage_command-dependencies	2008-10-10 10:20:25 UTC (rev 5184)
+++ people/michael/experimental/patches/setup-storage_command-dependencies	2008-10-12 08:54:41 UTC (rev 5185)
@@ -27,16 +27,40 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Commands.pm
 +++ trunk/lib/setup-storage/Commands.pm	
-@@ -293,7 +293,7 @@
+@@ -291,9 +291,10 @@
+     &FAI::push_command( "pvcreate $_", "pv_sigs_removed,exist_$_",
+       "pv_done_$_" ) foreach (@devices);
      # create the volume group
-     my $pre_dev = join(",pv_done_", @devices);
+-    my $pre_dev = join(",pv_done_", @devices);
++    my $pre_dev = "";
++    $pre_dev .= ",pv_done_$_" foreach (@devices);
      $pre_dev =~ s/^,//;
 -    &FAI::push_command( "vgcreate $vg " . join (" ", @devices), "$pre_dev",
 +    &FAI::push_command( "vgcreate $vg " . join (" ", @devices), "exist_$pre_dev",
        "vg_created_$vg" );
      # we are done
      return;
-@@ -436,7 +436,14 @@
+@@ -315,7 +316,8 @@
+   &FAI::push_command( "pvcreate $_", "exist_$_", "pv_done_$_" ) foreach (@new_devices);
+ 
+   # extend the volume group by the new devices (includes the current ones)
+-  my $pre_dev = join(",pv_done_", @new_devices);
++  my $pre_dev = "";
++  $pre_dev .= ",pv_done_$_" foreach (@new_devices);
+   $pre_dev =~ s/^,//;
+   &FAI::push_command( "vgextend $vg " . join (" ", @new_devices), "$pre_dev",
+     "vg_extended_$vg" );
+@@ -329,7 +331,8 @@
+ 
+   # run vgreduce to get them removed
+   if (scalar (keys %rm_devs)) {
+-    $pre_dev = join(",pv_done_", keys %rm_devs);
++    $pre_dev = "";
++    $pre_dev .= ",pv_done_$_" foreach (keys %rm_devs);
+     &FAI::push_command( "vgreduce $vg " . join (" ", keys %rm_devs),
+       "vg_extended_$vg$pre_dev", "vg_created_$vg" );
+   } else {
+@@ -436,7 +439,14 @@
      # set proper partition types for LVM
      &FAI::set_partition_type_on_phys_dev($_, "lvm")
        foreach (keys %{ $FAI::configs{$config}{devices} });
@@ -52,7 +76,7 @@
      $type_pre =~ s/^,//;
      # wait for udev to set up all devices
      &FAI::push_command( "udevsettle --timeout=10", "$type_pre",
-@@ -622,15 +629,14 @@
+@@ -622,15 +632,14 @@
      $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
  
      my $post = "run_udev_" . &FAI::make_device_name($disk, $part_nr);
@@ -62,7 +86,8 @@
      # build a parted command to create the partition
      &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
        "cleared1_$disk", $post );
-     &FAI::push_command( "udevsettle --timeout=10", "run_udev_" . 
+-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_" . 
++    &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
        &FAI::make_device_name($disk, $part_nr), "exist_" .
 -      &FAI::make_device_name($disk, $part_nr) ) if 
 -      $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
@@ -70,7 +95,7 @@
    }
  }
  
-@@ -693,7 +699,7 @@
+@@ -693,7 +702,7 @@
        # get the intermediate partition id
        my $p_other = $FAI::current_config{$disk}{partitions}{$mapped_id_other}{new_id};
        # check for overlap
@@ -79,7 +104,7 @@
          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{end_byte});
        next if($part->{end_byte} <
          $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte});
-@@ -701,7 +707,7 @@
+@@ -701,7 +710,7 @@
        # special care, even though this does not catch all cases (sometimes it
        # will fail nevertheless
        if ($part->{size}->{extended} && $part_other > 4) {
@@ -88,7 +113,7 @@
            $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte}) {
            $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
          }
-@@ -711,7 +717,7 @@
+@@ -711,7 +720,7 @@
          }
        }
        elsif ($part_id > 4 && $part_other_ref->{size}->{extended}) {
@@ -97,7 +122,7 @@
            $FAI::current_config{$disk}{partitions}{$mapped_id_other}{begin_byte}) {
            $deps .= ",resized_" . &FAI::make_device_name($disk, $p_other);
          }
-@@ -753,7 +759,7 @@
+@@ -753,7 +762,7 @@
          &FAI::make_device_name($disk, $p) );
      } else {
        &FAI::push_command( "parted -s $disk resize $p ${start}B ${end}B",
@@ -106,7 +131,7 @@
          &FAI::make_device_name($disk, $p) );
      }
  
-@@ -911,10 +917,13 @@
+@@ -911,10 +920,13 @@
  
    while ($i < $FAI::n_c_i) {
      my $all_matched = 1;
@@ -124,7 +149,7 @@
      }
      if ($all_matched) {
        defined($FAI::commands{$i}{post}) and push @pre_deps, split(/,/, $FAI::commands{$i}{post});
-@@ -932,6 +941,7 @@
+@@ -932,6 +944,7 @@
      &FAI::push_command( $FAI::commands{$i}{cmd}, $FAI::commands{$i}{pre},
        $FAI::commands{$i}{post} );
      delete $FAI::commands{$i};

Modified: people/michael/experimental/patches/setup-storage_liblinux-lvm
===================================================================
--- people/michael/experimental/patches/setup-storage_liblinux-lvm	2008-10-10 10:20:25 UTC (rev 5184)
+++ people/michael/experimental/patches/setup-storage_liblinux-lvm	2008-10-12 08:54:41 UTC (rev 5185)
@@ -191,7 +191,7 @@
 +    # store the physical volumes
 +    my %pv_info = get_physical_volume_information($vg);
 +    @{ $FAI::current_lvm_config{$vg}{physical_volumes} } =
-+      sort keys %{ get_physical_volume_information($vg) };
++      sort keys %pv_info;
    }
 +
  }




More information about the Fai-commit mailing list