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

mt at alioth.debian.org mt at alioth.debian.org
Fri Feb 6 21:31:14 UTC 2009


Author: mt
Date: 2009-02-06 21:31:13 +0000 (Fri, 06 Feb 2009)
New Revision: 5248

Added:
   people/michael/experimental/patches/aoe-support
   people/michael/experimental/patches/setup-storage_bugfix-virtual
   people/michael/experimental/patches/setup-storage_no-useless-udevsettle
   people/michael/experimental/patches/setup-storage_proper-partition-index
Modified:
   people/michael/experimental/patches/series
Log:
Further bugfixes
- fixed support for virtual configs
- removed redundant calls to udevsettle
- support for AOE devices
- cosmetic fix for user info message



Added: people/michael/experimental/patches/aoe-support
===================================================================
--- people/michael/experimental/patches/aoe-support	                        (rev 0)
+++ people/michael/experimental/patches/aoe-support	2009-02-06 21:31:13 UTC (rev 5248)
@@ -0,0 +1,39 @@
+2009-02-06  Michael Tautschnig  <mt at debian.org>
+
+	* lib/setup-storage/Init.pm, lib/disk-info: Added AOE etherd/ device names to
+		regular expressions (thanks Jean Spirat)
+Index: trunk/lib/disk-info
+===================================================================
+--- trunk.orig/lib/disk-info
++++ trunk/lib/disk-info	
+@@ -21,6 +21,6 @@
+ }
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ # echo a space separated list of devices and their block size
+-egrep ' i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b' /proc/partitions | diskandsize
++egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b' /proc/partitions | diskandsize
+ 
+ 
+Index: trunk/lib/setup-storage/Init.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Init.pm
++++ trunk/lib/setup-storage/Init.pm	
+@@ -168,7 +168,8 @@
+     defined($2) or return (1, "/dev/$1", -1);
+     return (1, "/dev/$1", $2);
+   }
+-  elsif ($dev =~ m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)p(\d+)?$})
++  elsif ($dev =~
++    m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d|etherd/e\d+\.\d+)p(\d+)?$})
+   {
+     defined($2) or return (1, "/dev/$1", -1);
+     return (1, "/dev/$1", $2);
+@@ -190,7 +191,7 @@
+ sub make_device_name {
+   my ($dev, $p) = @_;
+   $dev .= "p" if ($dev =~
+-    m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)$});
++    m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d|etherd/e\d+\.\d+)$});
+   $dev .= $p;
+   internal_error("Invalid device $dev") unless (&FAI::phys_dev($dev))[0];
+   return $dev;

Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series	2009-02-06 16:42:36 UTC (rev 5247)
+++ people/michael/experimental/patches/series	2009-02-06 21:31:13 UTC (rev 5248)
@@ -12,3 +12,7 @@
 setup-storage_proper-vg-existance-handling
 setup-storage_force-disklabel
 setup-storage_raid0-has-no-spares
+setup-storage_proper-partition-index
+setup-storage_no-useless-udevsettle
+aoe-support
+setup-storage_bugfix-virtual

Added: people/michael/experimental/patches/setup-storage_bugfix-virtual
===================================================================
--- people/michael/experimental/patches/setup-storage_bugfix-virtual	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_bugfix-virtual	2009-02-06 21:31:13 UTC (rev 5248)
@@ -0,0 +1,29 @@
+2009-02-06  Michael Tautschnig  <mt at debian.org>
+
+	* lib/setup-storage/Commands.pm: If the disk config is marked virtual, create
+		dummy commands to tell later commands that the devices exist (closes: #508247)
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm	
+@@ -843,8 +843,18 @@
+     ($config =~ /^PHY_(.+)$/) or &FAI::internal_error("Invalid config $config");
+     my $disk = $1; # the device to be configured
+ 
+-    # create partitions on non-virtual configs
+-    &FAI::setup_partitions($config) unless ($FAI::configs{$config}{virtual});
++    if ($FAI::configs{$config}{virtual}) {
++      foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
++        # reference to the current partition
++        my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
++        # virtual disks always exist
++        &FAI::push_command( "true", "",
++          "exist_" . &FAI::make_device_name($disk, $part_id) );
++      }
++    } else {
++      # create partitions on non-virtual configs
++      &FAI::setup_partitions($config);
++    }
+ 
+     # generate the commands for creating all filesystems
+     foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {

Added: people/michael/experimental/patches/setup-storage_no-useless-udevsettle
===================================================================
--- people/michael/experimental/patches/setup-storage_no-useless-udevsettle	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_no-useless-udevsettle	2009-02-06 21:31:13 UTC (rev 5248)
@@ -0,0 +1,111 @@
+2009-02-06  Michael Tautschnig  <mt at debian.org>
+
+	* lib/setup-storage/Commands.pm: Got rid of all the calls to udevsettle that
+		we don't need anymore (we call udevsettle after before executing each
+		command anyway)
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm	
+@@ -218,26 +218,15 @@
+           $pre_req .= ",exist_$d";
+         }
+       }
+-      my $pre_req_no_comma = $pre_req;
+-      $pre_req_no_comma =~ s/^,//;
+-      # wait for udev to set up all devices
+-      &FAI::push_command( "udevsettle --timeout=10", $pre_req_no_comma,
+-        "settle_for_mdadm_create$id" );
+ 
+       # create the command
+-      if (0 == $id) {
+-        $pre_req = "settle_for_mdadm_create$id$pre_req";
+-      } else {
+-        $pre_req = "settle_for_mdadm_create$id,exist_/dev/md" . ( $id - 1 ) . $pre_req;
+-      }
++      $pre_req = "exist_/dev/md" . ( $id - 1 ) . $pre_req if (0 < $id);
++      $pre_req =~ s/^,//;
+       &FAI::push_command(
+         "yes | mdadm --create /dev/md$id --level=$level --force --run --raid-devices="
+           . scalar(@eff_devs) . (scalar(@spares) !=0 ? " --spare-devices=" . scalar(@spares) : "") . " "
+           . join(" ", @eff_devs) . " " . join(" ", @spares),
+-        "$pre_req", "run_udev_/dev/md$id" );
+-
+-      &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/md$id",
+-        "exist_/dev/md$id" );
++        "$pre_req", "exist_/dev/md$id" );
+ 
+       # create the filesystem on the volume
+       &FAI::build_mkfs_commands("/dev/md$id",
+@@ -428,9 +417,7 @@
+ 
+     # create a new volume
+     &FAI::push_command( "lvcreate -n $lv -L " . $lv_size->{eff_size} . " $vg",
+-      "vg_enabled_$vg,$lv_rm_pre", "run_udev_/dev/$vg/$lv" );
+-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/$vg/$lv",
+-      "exist_/dev/$vg/$lv" );
++      "vg_enabled_$vg,$lv_rm_pre", "exist_/dev/$vg/$lv" );
+ 
+     # create the filesystem on the volume
+     &FAI::build_mkfs_commands("/dev/$vg/$lv",
+@@ -468,15 +455,12 @@
+       }
+     }
+     $type_pre =~ s/^,//;
+-    # wait for udev to set up all devices
+-    &FAI::push_command( "udevsettle --timeout=10", "$type_pre",
+-      "settle_for_vgchange_$vg" );
+ 
+     # create the volume group or add/remove devices
+     &FAI::create_volume_group($config);
+     # enable the volume group
+     &FAI::push_command( "vgchange -a y $vg",
+-      "settle_for_vgchange_$vg,vg_created_$vg", "vg_enabled_$vg" );
++      "$type_pre,vg_created_$vg", "vg_enabled_$vg" );
+ 
+     # perform all necessary operations on the underlying logical volumes
+     &FAI::setup_logical_volumes($config);
+@@ -651,15 +635,12 @@
+     $part_nr++;
+     $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
+ 
+-    my $post = "run_udev_" . &FAI::make_device_name($disk, $part_nr);
++    my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
+     $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
+       $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
+     # 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::make_device_name($disk, $part_nr), "exist_" .
+-      &FAI::make_device_name($disk, $part_nr) );
+   }
+ }
+ 
+@@ -775,12 +756,9 @@
+       my $eff_size = $part->{size}->{eff_size};
+ 
+       # wait for udev to set up all devices
+-      &FAI::push_command( "udevsettle --timeout=10", "rebuilt_" .
+-        &FAI::make_device_name($disk, $p) . $deps, "settle_for_resize_" .
+-        &FAI::make_device_name($disk, $p) );
+       &FAI::push_command( "yes | ntfsresize -s $eff_size " .
+-        &FAI::make_device_name($disk, $p), "settle_for_resize_" .
+-        &FAI::make_device_name($disk, $p), "ntfs_ready_for_rm_" .
++        &FAI::make_device_name($disk, $p), "rebuilt_" .
++        &FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
+         &FAI::make_device_name($disk, $p) );
+       &FAI::push_command( "parted -s $disk rm $p", "ntfs_ready_for_rm_" .
+         &FAI::make_device_name($disk, $p), "resized_" .
+@@ -836,10 +814,7 @@
+     $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
+     # build a parted command to create the partition
+     &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
+-      "cleared2_$disk$pre", "run_udev_" . &FAI::make_device_name($disk, $part_id) );
+-    &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
+-      &FAI::make_device_name($disk, $part_id), "exist_" .
+-      &FAI::make_device_name($disk, $part_id) );
++      "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
+     $prev_id = $part_id;
+   }
+ 

Added: people/michael/experimental/patches/setup-storage_proper-partition-index
===================================================================
--- people/michael/experimental/patches/setup-storage_proper-partition-index	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_proper-partition-index	2009-02-06 21:31:13 UTC (rev 5248)
@@ -0,0 +1,20 @@
+2009-02-06  Michael Tautschnig  <mt at debian.org>
+
+	* lib/setup-storage/Commands.pm: Use the proper id for telling the user about
+		preserved/resized partitions.
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm	
+@@ -706,9 +706,9 @@
+     $pre_all_resize .= ",exist_" . &FAI::make_device_name($disk, $p) unless
+       $part->{size}->{resize};
+     if ($part->{size}->{resize}) {
+-      warn &FAI::make_device_name($disk, $p) . " will be resized\n";
++      warn &FAI::make_device_name($disk, $mapped_id) . " will be resized\n";
+     } else {
+-      warn &FAI::make_device_name($disk, $p) . " will be preserved\n";
++      warn &FAI::make_device_name($disk, $mapped_id) . " will be preserved\n";
+       next;
+     }
+ 




More information about the Fai-commit mailing list