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

mt at alioth.debian.org mt at alioth.debian.org
Wed Apr 1 13:22:33 UTC 2009


Author: mt
Date: 2009-04-01 13:22:33 +0000 (Wed, 01 Apr 2009)
New Revision: 5300

Added:
   people/michael/experimental/patches/setup-storage_cylinder-boundary
   people/michael/experimental/patches/setup-storage_missing-raid-devs
Modified:
   people/michael/experimental/patches/series
Log:
two more patches:
- fixed bug in Parser that handles missing/spare options for RAID
- changed die to warn on unaligned preserved partitions


Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series	2009-03-26 17:02:02 UTC (rev 5299)
+++ people/michael/experimental/patches/series	2009-04-01 13:22:33 UTC (rev 5300)
@@ -20,3 +20,5 @@
 bugfix-520554
 bugfix-521027
 bugfix-521153
+setup-storage_missing-raid-devs
+setup-storage_cylinder-boundary

Added: people/michael/experimental/patches/setup-storage_cylinder-boundary
===================================================================
--- people/michael/experimental/patches/setup-storage_cylinder-boundary	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_cylinder-boundary	2009-04-01 13:22:33 UTC (rev 5300)
@@ -0,0 +1,24 @@
+2009-04-01  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Sizes.pm: Change die to warn in case a preserved partition is
+		not aligned to cylinder boundaries (Thomas said this was ok...)
+Index: trunk/lib/setup-storage/Sizes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Sizes.pm
++++ trunk/lib/setup-storage/Sizes.pm	
+@@ -323,11 +323,14 @@
+   if ($FAI::configs{$config}{disklabel} eq "msdos") {
+ 
+     # make sure the partition ends at a cylinder boundary
++    # maybe we should make this a warning if ($curr_part->{filesystem} eq
++    # "ntfs")) only, but for now just a warning for everyone; well, it might
++    # also be safe to ignore this, don't know for sure.
+     (0 == ($curr_part->{end_byte} + 1)
+         % ($current_disk->{sector_size} *
+           $current_disk->{bios_sectors_per_track} *
+           $current_disk->{bios_heads})) or 
+-      die "Preserved partition $part_id does not end at a cylinder boundary\n";
++      warn "Preserved partition $part_id does not end at a cylinder boundary, parted may fail to restore the partition!\n";
+ 
+     # add one head of disk usage if this is a logical partition
+     $min_req_total_space += $current_disk->{bios_sectors_per_track} *

Added: people/michael/experimental/patches/setup-storage_missing-raid-devs
===================================================================
--- people/michael/experimental/patches/setup-storage_missing-raid-devs	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_missing-raid-devs	2009-04-01 13:22:33 UTC (rev 5300)
@@ -0,0 +1,36 @@
+2009-04-01  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Parser.pm: $2 doesn't refer to the original expression
+		anymore, store earlier $2 as $opts.
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm	
+@@ -600,6 +600,8 @@
+               &FAI::internal_error("PARSER ERROR");
+             # redefine the device string
+             $dev = $1;
++            # store the options
++            my $opts = $2;
+             # make $dev a full path name; can't validate device name yet as it
+             # might be created later on
+             unless ($dev =~ m{^/}) {
+@@ -612,14 +614,14 @@
+             my @candidates = glob($dev);
+ 
+             # options are only valid for RAID
+-            defined ($2) and ($FAI::device ne "RAID") and die "Option $2 invalid in a non-RAID context\n";
++            defined ($opts) and ($FAI::device ne "RAID") and die "Option $opts invalid in a non-RAID context\n";
+             if ($FAI::device eq "RAID") {
+               # parse all options
+               my $spare = 0;
+               my $missing = 0;
+-              if (defined ($2)) {
+-                ($2 =~ /spare/) and $spare = 1;
+-                ($2 =~ /missing/) and $missing = 1;
++              if (defined ($opts)) {
++                ($opts =~ /spare/) and $spare = 1;
++                ($opts =~ /missing/) and $missing = 1;
+               }
+               (($spare == 1 || $missing == 1) && $FAI::partition_pointer->{mode} == 0)
+                 and die "RAID-0 does not support spares or missing devices\n";




More information about the Fai-commit mailing list