[Fai-commit] r6321 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Thu Mar 17 21:28:09 UTC 2011
Author: mt
Date: 2011-03-17 21:28:08 +0000 (Thu, 17 Mar 2011)
New Revision: 6321
Modified:
branches/experimental/patches/setup-storage_extended-is-not-last
branches/experimental/patches/setup-storage_gpt-bios-fix
branches/experimental/patches/setup-storage_hardcode-63-sectors
branches/experimental/patches/setup-storage_internals-cleanup
branches/experimental/patches/setup-storage_no-cylinder-boundaries
branches/experimental/patches/setup-storage_user-100-percent
Log:
The Linux kernel doesn't like 512B gaps for logical partitions, 2 sectors are
required instead
Modified: branches/experimental/patches/setup-storage_extended-is-not-last
===================================================================
--- branches/experimental/patches/setup-storage_extended-is-not-last 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_extended-is-not-last 2011-03-17 21:28:08 UTC (rev 6321)
@@ -25,7 +25,7 @@
}
# on gpt, ensure that the partition ends at a sector boundary
-@@ -703,37 +697,45 @@
+@@ -704,37 +698,45 @@
# reference to the current partition
my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
Modified: branches/experimental/patches/setup-storage_gpt-bios-fix
===================================================================
--- branches/experimental/patches/setup-storage_gpt-bios-fix 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_gpt-bios-fix 2011-03-17 21:28:08 UTC (rev 6321)
@@ -6,7 +6,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Sizes.pm
+++ trunk/lib/setup-storage/Sizes.pm
-@@ -674,13 +674,20 @@
+@@ -675,13 +675,20 @@
$min_req_total_space += 33 * $current_disk->{sector_size};
# on gpt-bios we'll need an additional partition to store what doesn't fit
@@ -29,7 +29,7 @@
# set proper defaults
$FAI::partition_pointer->{encrypt} = 0;
$FAI::partition_pointer->{filesystem} = "-";
-@@ -730,6 +737,11 @@
+@@ -731,6 +738,11 @@
# partition done
shift @worklist;
Modified: branches/experimental/patches/setup-storage_hardcode-63-sectors
===================================================================
--- branches/experimental/patches/setup-storage_hardcode-63-sectors 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_hardcode-63-sectors 2011-03-17 21:28:08 UTC (rev 6321)
@@ -7,7 +7,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Sizes.pm
+++ trunk/lib/setup-storage/Sizes.pm
-@@ -640,15 +640,11 @@
+@@ -641,15 +641,11 @@
my $next_start = 0;
if ($FAI::configs{$config}{disklabel} eq "msdos") {
Modified: branches/experimental/patches/setup-storage_internals-cleanup
===================================================================
--- branches/experimental/patches/setup-storage_internals-cleanup 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_internals-cleanup 2011-03-17 21:28:08 UTC (rev 6321)
@@ -81,8 +81,8 @@
$current_disk->{bios_heads})) or
warn "Preserved partition $part_dev_name does not end at a cylinder boundary, parted may fail to restore the partition!\n";
-- # add 512B of disk usage if this is a logical partition
-- $min_req_total_space += 512 if ($part_id > 4);
+- # add two sectors of disk usage if this is a logical partition
+- $min_req_total_space += 2 * $current_disk->{sector_size} if ($part_id > 4);
-
# make sure we don't change extended partitions to ordinary ones and
# vice-versa
@@ -96,7 +96,7 @@
}
################################################################################
-@@ -430,17 +423,15 @@
+@@ -431,17 +424,15 @@
# @param $disk This disk
# @param $next_start Start of the next partition
# @param $block_size Requested alignment
@@ -116,25 +116,25 @@
# reference to the current disk config
my $current_disk = $FAI::current_config{$disk};
-@@ -451,15 +442,8 @@
+@@ -452,15 +443,8 @@
# compute the effective start location on the disk
# msdos specific offset for logical partitions
- if (($FAI::configs{$config}{disklabel} eq "msdos")
- && ($part_id > 4)) {
-
-- # add 512B disk usage if this is a logical partition
-- $min_req_total_space += 512;
+- # add 2 sectors of disk usage if this is a logical partition
+- $min_req_total_space += 2 * $current_disk->{sector_size};
-
- # move the start byte as well
-- $next_start += 512;
+- $next_start += 2 * $current_disk->{sector_size};
- }
-+ $next_start += 512 if (($FAI::configs{$config}{disklabel} eq "msdos")
-+ && ($part_id > 4));
++ $next_start += 2 * $current_disk->{sector_size}
++ if (($FAI::configs{$config}{disklabel} eq "msdos") && ($part_id > 4));
# partition starts at where we currently are + requested alignment, or remains
# fixed in case of resized ntfs
-@@ -567,13 +551,10 @@
+@@ -568,13 +552,10 @@
# write the end byte to the configuration
$part->{end_byte} = $end_byte;
@@ -149,7 +149,7 @@
}
################################################################################
-@@ -633,9 +614,6 @@
+@@ -634,9 +615,6 @@
}
}
@@ -159,7 +159,7 @@
# the start byte for the next partition
my $next_start = 0;
-@@ -643,7 +621,6 @@
+@@ -644,7 +622,6 @@
# on msdos disk labels, the first partitions starts at head #1; well,
# enforce a 63-sectors-per-track layout
$next_start = 63 * $current_disk->{sector_size};
@@ -167,7 +167,7 @@
} elsif ($FAI::configs{$config}{disklabel} eq "gpt") {
# on GPT-EFI disk labels the first 34 and last 33 sectors must be left alone
-@@ -652,31 +629,24 @@
+@@ -653,31 +630,24 @@
# modify the disk to claim the space for the second partition table
$current_disk->{end_byte} -= 33 * $current_disk->{sector_size};
@@ -201,7 +201,7 @@
my ($s, $e) = &FAI::make_range("1-1", $current_disk->{size} . "B");
# enter the range into the hash
$FAI::partition_pointer->{size}->{range} = "$s-$s";
-@@ -684,7 +654,6 @@
+@@ -685,7 +655,6 @@
$FAI::partition_pointer->{start_byte} = $next_start;
$FAI::partition_pointer->{end_byte} = $next_start + $s - 1;
$next_start += $s;
@@ -209,7 +209,7 @@
# set proper defaults
$FAI::partition_pointer->{encrypt} = 0;
$FAI::partition_pointer->{filesystem} = "-";
-@@ -692,7 +661,7 @@
+@@ -693,7 +662,7 @@
}
# the size of a 100% partition (the 100% available to the user)
@@ -218,7 +218,7 @@
# expressed in bytes
$max_avail = "${max_avail}B";
-@@ -746,15 +715,14 @@
+@@ -747,15 +716,14 @@
shift @worklist;
# the partition $part_id must be preserved
} elsif ($part->{size}->{preserve}) {
@@ -238,7 +238,7 @@
# msdos does not support partitions larger than 2TiB
($part->{size}->{eff_size} > (&FAI::convert_unit("2TiB") * 1024.0 *
-@@ -766,8 +734,8 @@
+@@ -767,8 +735,8 @@
}
# check, whether there is sufficient space on the disk
Modified: branches/experimental/patches/setup-storage_no-cylinder-boundaries
===================================================================
--- branches/experimental/patches/setup-storage_no-cylinder-boundaries 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_no-cylinder-boundaries 2011-03-17 21:28:08 UTC (rev 6321)
@@ -15,7 +15,7 @@
* setup-storage.8: Document new align-at option.
* setup-storage/Sizes.pm: Take alignment into account for partition size
computation (thanks Frank Doepper for bringing up this problem). Size of
- extended (partition) boot record is 512B and independent of disk head size.
+ extended (partition) boot record is 2 sectors.
Index: trunk/lib/setup-storage/Sizes.pm
===================================================================
--- trunk.orig/lib/setup-storage/Sizes.pm
@@ -27,8 +27,8 @@
- # add one head of disk usage if this is a logical partition
- $min_req_total_space += $current_disk->{bios_sectors_per_track} *
- $current_disk->{sector_size} if ($part_id > 4);
-+ # add 512B of disk usage if this is a logical partition
-+ $min_req_total_space += 512 if ($part_id > 4);
++ # add two sectors of disk usage if this is a logical partition
++ $min_req_total_space += 2 * $current_disk->{sector_size} if ($part_id > 4);
# make sure we don't change extended partitions to ordinary ones and
# vice-versa
@@ -42,21 +42,22 @@
# initialise the size and the start byte
$part->{size}->{eff_size} = 0;
$part->{start_byte} = -1;
-@@ -418,10 +414,10 @@
+@@ -418,10 +414,11 @@
next if ($p < 5);
$part->{start_byte} = $FAI::configs{$config}{partitions}{$p}{start_byte} -
- $epbr_size if (-1 == $part->{start_byte});
-+ 512 if (-1 == $part->{start_byte});
++ (2 * $current_disk->{sector_size}) if (-1 == $part->{start_byte});
- $part->{size}->{eff_size} += $FAI::configs{$config}{partitions}{$p}{size}{eff_size} +
- $epbr_size;
+ $part->{size}->{eff_size} +=
-+ $FAI::configs{$config}{partitions}{$p}{size}{eff_size} + 512;
++ $FAI::configs{$config}{partitions}{$p}{size}{eff_size} + (2 *
++ $current_disk->{sector_size});
$part->{end_byte} = $FAI::configs{$config}{partitions}{$p}{end_byte};
}
-@@ -436,8 +432,9 @@
+@@ -436,8 +433,9 @@
#
# @param $part_id Partition id within $config
# @param $config Disk config
@@ -67,7 +68,7 @@
# @param $min_req_total_space Minimum space required on disk
# @param $worklist Reference to the remaining partitions
#
-@@ -446,7 +443,7 @@
+@@ -446,7 +444,7 @@
################################################################################
sub do_partition_real {
@@ -76,7 +77,7 @@
# reference to the current disk config
my $current_disk = $FAI::current_config{$disk};
-@@ -456,6 +453,34 @@
+@@ -456,6 +454,34 @@
my ($start, $end) = &FAI::make_range($part->{size}->{range},
$current_disk->{size} . "B");
@@ -85,11 +86,11 @@
+ if (($FAI::configs{$config}{disklabel} eq "msdos")
+ && ($part_id > 4)) {
+
-+ # add 512B disk usage if this is a logical partition
-+ $min_req_total_space += 512;
++ # add 2 sectors of disk usage if this is a logical partition
++ $min_req_total_space += 2 * $current_disk->{sector_size};
+
+ # move the start byte as well
-+ $next_start += 512;
++ $next_start += 2 * $current_disk->{sector_size};
+ }
+
+ # partition starts at where we currently are + requested alignment, or remains
@@ -111,7 +112,7 @@
# check, whether the size is fixed
if ($end != $start) {
-@@ -483,11 +508,8 @@
+@@ -483,11 +509,8 @@
# logical partitions require the space for the EPBR to be left
# out
@@ -120,12 +121,12 @@
- $end_of_range -= $current_disk->{bios_sectors_per_track} *
- $current_disk->{sector_size};
- }
-+ $end_of_range -= 512 if (($FAI::configs{$config}{disklabel} eq "msdos")
-+ && ($p > 4));
++ $end_of_range -= 2 * $current_disk->{sector_size}
++ if (($FAI::configs{$config}{disklabel} eq "msdos") && ($p > 4));
last;
} elsif ($FAI::configs{$config}{partitions}{$p}{size}{extended}) {
next;
-@@ -497,13 +519,11 @@
+@@ -497,13 +520,11 @@
$current_disk->{size} . "B");
# logical partitions require the space for the EPBR to be left
@@ -138,12 +139,12 @@
- $max_size += $current_disk->{bios_sectors_per_track} *
- $current_disk->{sector_size};
+ && ($p != $part_id) && ($p > 4)) {
-+ $min_size += 512;
-+ $max_size += 512;
++ $min_size += 2 * $current_disk->{sector_size};
++ $max_size += 2 * $current_disk->{sector_size};
}
$min_req_space += $min_size;
-@@ -535,48 +555,9 @@
+@@ -535,48 +556,9 @@
$end = $start;
}
@@ -194,7 +195,7 @@
# set $start and $end to the effective values
$start = $end_byte - $next_start + 1;
-@@ -625,6 +606,21 @@
+@@ -625,6 +607,21 @@
# reference to the current disk config
my $current_disk = $FAI::current_config{$disk};
@@ -216,7 +217,7 @@
# at various points the following code highly depends on the desired disk label!
# initialise variables
# the id of the extended partition to be created, if required
-@@ -668,13 +664,12 @@
+@@ -668,13 +665,12 @@
$min_req_total_space += (34 + 33) * $current_disk->{sector_size};
} elsif ($FAI::configs{$config}{disklabel} eq "gpt-bios") {
@@ -235,7 +236,7 @@
# apparently parted insists in having some space left at the end too
# modify the disk to claim the space for the second partition table
-@@ -741,7 +736,7 @@
+@@ -741,7 +737,7 @@
shift @worklist;
} else {
($next_start, $min_req_total_space) = &FAI::do_partition_real($part_id,
Modified: branches/experimental/patches/setup-storage_user-100-percent
===================================================================
--- branches/experimental/patches/setup-storage_user-100-percent 2011-03-16 14:25:49 UTC (rev 6320)
+++ branches/experimental/patches/setup-storage_user-100-percent 2011-03-17 21:28:08 UTC (rev 6321)
@@ -33,7 +33,7 @@
($start > $curr_part->{count_byte} || $end < $curr_part->{count_byte})
and warn "Preserved partition $part_dev_name retains size " .
$curr_part->{count_byte} . "B\n";
-@@ -431,6 +431,7 @@
+@@ -432,6 +432,7 @@
# @param $next_start Start of the next partition
# @param $block_size Requested alignment
# @param $min_req_total_space Minimum space required on disk
@@ -41,7 +41,7 @@
# @param $worklist Reference to the remaining partitions
#
# @return Updated values of ($next_start, $min_req_total_space)
-@@ -438,15 +439,15 @@
+@@ -439,15 +440,15 @@
################################################################################
sub do_partition_real {
@@ -60,7 +60,7 @@
# compute the effective start location on the disk
# msdos specific offset for logical partitions
-@@ -510,8 +511,7 @@
+@@ -511,8 +512,7 @@
next;
} else {
my ($min_size, $max_size) = &FAI::make_range(
@@ -70,7 +70,7 @@
# logical partitions require the space for the EPBR to be left
# out; in fact, even alignment constraints would have to be considered
-@@ -643,6 +643,7 @@
+@@ -644,6 +644,7 @@
# on msdos disk labels, the first partitions starts at head #1
$next_start = $current_disk->{bios_sectors_per_track} *
$current_disk->{sector_size};
@@ -78,7 +78,7 @@
# the MBR requires space, too
$min_req_total_space += $current_disk->{bios_sectors_per_track} *
-@@ -694,6 +695,11 @@
+@@ -695,6 +696,11 @@
$FAI::partition_pointer->{mountpoint} = "-";
}
@@ -90,7 +90,7 @@
# the list of partitions that we need to find start and end bytes for
my @worklist = (&numsort(keys %{ $FAI::configs{$config}{partitions} }));
-@@ -745,13 +751,14 @@
+@@ -746,13 +752,14 @@
# the partition $part_id must be preserved
} elsif ($part->{size}->{preserve}) {
($next_start, $min_req_total_space) = &FAI::do_partition_preserve($part_id,
More information about the Fai-commit
mailing list