[Fai-commit] r5287 - people/michael/experimental/patches
mt at alioth.debian.org
mt at alioth.debian.org
Thu Mar 5 12:58:39 UTC 2009
Author: mt
Date: 2009-03-05 12:58:39 +0000 (Thu, 05 Mar 2009)
New Revision: 5287
Added:
people/michael/experimental/patches/setup-storage_gpt-bios
Modified:
people/michael/experimental/patches/series
Log:
Added patch to support GPT+BIOS
Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series 2009-03-05 12:37:15 UTC (rev 5286)
+++ people/michael/experimental/patches/series 2009-03-05 12:58:39 UTC (rev 5287)
@@ -13,3 +13,4 @@
bugfix-313397
bugfix-481871
bugfix-495535
+setup-storage_gpt-bios
Added: people/michael/experimental/patches/setup-storage_gpt-bios
===================================================================
--- people/michael/experimental/patches/setup-storage_gpt-bios (rev 0)
+++ people/michael/experimental/patches/setup-storage_gpt-bios 2009-03-05 12:58:39 UTC (rev 5287)
@@ -0,0 +1,89 @@
+2009-03-05 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage/Parser.pm, setup-storage/Sizes.pm: Added pseudo-disklabel
+ gpt-bios to support GPT on systems with BIOS instead of EFI.
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm
+@@ -824,8 +824,10 @@
+
+ # set the bootable flag, if requested at all
+ if ($FAI::configs{$config}{bootable} > -1) {
++ my $flag = "boot";
++ $flag = "bios_grub" if ($FAI::configs{$config}{disklabel} eq "gpt-bios");
+ &FAI::push_command( "parted -s $disk set " .
+- $FAI::configs{$config}{bootable} . " boot on", "exist_" .
++ $FAI::configs{$config}{bootable} . " $flag on", "exist_" .
+ &FAI::make_device_name($disk, $FAI::configs{$config}{bootable}),
+ "boot_set_$disk" );
+ }
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm
+@@ -431,7 +431,7 @@
+ $FAI::configs{$FAI::device}{partitions}{$_}{size}{resize} = 1 foreach (split(",", $1));
+ $FAI::configs{$FAI::device}{preserveparts} = 1;
+ }
+- | /^disklabel:(msdos|gpt)/
++ | /^disklabel:(msdos|gpt|gpt-bios)/
+ {
+ # set the disk label - actually not only the above, but all types
+ # supported by parted could be allowed, but others are not implemented
+Index: trunk/lib/setup-storage/Sizes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Sizes.pm
++++ trunk/lib/setup-storage/Sizes.pm
+@@ -350,7 +350,8 @@
+ }
+
+ # on gpt, ensure that the partition ends at a sector boundary
+- if ($FAI::configs{$config}{disklabel} eq "gpt") {
++ if ($FAI::configs{$config}{disklabel} eq "gpt" ||
++ $FAI::configs{$config}{disklabel} eq "gpt-bios") {
+ (0 == ($current_disk->{partitions}{$part_id}{end_byte} + 1)
+ % $current_disk->{sector_size})
+ or die "Preserved partition $part_id does not end at a sector boundary\n";
+@@ -545,7 +546,8 @@
+ }
+
+ # on gpt, ensure that the partition ends at a sector boundary
+- if ($FAI::configs{$config}{disklabel} eq "gpt") {
++ if ($FAI::configs{$config}{disklabel} eq "gpt" ||
++ $FAI::configs{$config}{disklabel} eq "gpt-bios") {
+ $end_byte -=
+ ($end_byte + 1) % $current_disk->{sector_size};
+ }
+@@ -629,7 +631,8 @@
+ }
+
+ # on GPT disk labels the first 34 and last 34 sectors must be left alone
+- if ($FAI::configs{$config}{disklabel} eq "gpt") {
++ if ($FAI::configs{$config}{disklabel} eq "gpt" ||
++ $FAI::configs{$config}{disklabel} eq "gpt-bios") {
+ $next_start = 34 * $current_disk->{sector_size};
+
+ # modify the disk to claim the space for the second partition table
+@@ -687,7 +690,7 @@
+
+ # msdos does not support partitions larger than 2TB
+ ($part->{size}->{eff_size} > (&FAI::convert_unit("2TB") * 1024.0 *
+- 1024.0)) and die "msdos disklabel does not support partitions > 2TB, please use disklabel:gpt\n"
++ 1024.0)) and die "msdos disklabel does not support partitions > 2TB, please use disklabel:gpt or gpt-bios\n"
+ if ($FAI::configs{$config}{disklabel} eq "msdos");
+ # partition done
+ shift @worklist;
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8
+@@ -216,7 +216,7 @@
+ .br
+ /* attempt to resize partitions */
+ .br
+- | disklabel:(msdos|gpt)
++ | disklabel:(msdos|gpt|gpt-bios)
+ .br
+ /* write a disklabel - default is msdos */
+ .br
More information about the Fai-commit
mailing list