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

mt at alioth.debian.org mt at alioth.debian.org
Fri Oct 10 10:20:26 UTC 2008


Author: mt
Date: 2008-10-10 10:20:25 +0000 (Fri, 10 Oct 2008)
New Revision: 5184

Added:
   people/michael/experimental/patches/setup-storage_preserve-bugfixes
Modified:
   people/michael/experimental/patches/series
Log:
added patch to fix #501772


Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series	2008-10-01 17:55:37 UTC (rev 5183)
+++ people/michael/experimental/patches/series	2008-10-10 10:20:25 UTC (rev 5184)
@@ -1,3 +1,4 @@
+setup-storage_preserve-bugfixes
 setup-storage_large-partition-check
 setup-storage_parted-error-msgs
 setup-storage_command-dependencies

Added: people/michael/experimental/patches/setup-storage_preserve-bugfixes
===================================================================
--- people/michael/experimental/patches/setup-storage_preserve-bugfixes	                        (rev 0)
+++ people/michael/experimental/patches/setup-storage_preserve-bugfixes	2008-10-10 10:20:25 UTC (rev 5184)
@@ -0,0 +1,56 @@
+2008-10-10  Michael Tautschnig  <mt at debian.org>
+
+	* lib/setup-storage/Parser.pm, lib/setup-storage/Sizes.pm: Warn, if a
+		preserved partition does not match the size specified in the disk_config;
+		fail, if an extended partition is to be created in place of a
+		to-be-preserved partition (closes: #501772)
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm	
+@@ -217,10 +217,11 @@
+       ($extended < 5)
+         or die "Too many primary partitions while creating extended\n";
+ 
+-      # initialize the entry
+-      (\%FAI::configs)->{$FAI::device}->{partitions}->{$extended} = {
+-        size => {}
+-      };
++      # initialize the entry, unless it already exists
++      defined ($FAI::configs{$FAI::device}{partitions}{$extended})
++        or (\%FAI::configs)->{$FAI::device}->{partitions}->{$extended} = {
++          size => {}
++        };
+ 
+       my $part_size =
+         (\%FAI::configs)->{$FAI::device}->{partitions}->{$extended}->{size};
+Index: trunk/lib/setup-storage/Sizes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Sizes.pm
++++ trunk/lib/setup-storage/Sizes.pm	
+@@ -294,6 +294,13 @@
+   ($next_start > $curr_part->{begin_byte})
+     and die "Previous partitions overflow begin of preserved partition $part_id\n";
+ 
++  # get what the user desired
++  my ($start, $end) = &FAI::make_range($part->{size}->{range},
++    $current_disk->{size} . "B");
++  ($start > $curr_part->{count_byte} || $end < $curr_part->{count_byte})
++    and warn "Preserved partition $part_id retains size " .
++      $curr_part->{count_byte} . "\n";
++
+   # set the effective size to the value known already
+   $part->{size}->{eff_size} = $curr_part->{count_byte};
+ 
+@@ -321,6 +328,11 @@
+     $min_req_total_space += $current_disk->{bios_sectors_per_track} *
+       $current_disk->{sector_size} if ($part_id > 4);
+ 
++    # make sure we don't change extended partitions to ordinary ones and
++    # vice-versa
++    ($part->{size}->{extended} == $curr_part->{is_extended})
++      or die "Preserved partition $part_id can't change extended/normal setting\n";
++
+     # extended partitions consume no space
+     if ($part->{size}->{extended}) {
+ 




More information about the Fai-commit mailing list