[Fai-commit] r6464 - branches/experimental/patches

Michael Tautschnig mt at alioth.debian.org
Sat Apr 16 08:03:25 UTC 2011


Author: mt
Date: 2011-04-16 08:03:15 +0000 (Sat, 16 Apr 2011)
New Revision: 6464

Added:
   branches/experimental/patches/setup-storage_more-verbose-parser
Modified:
   branches/experimental/patches/series
Log:
Added patch to catch disklabel:X with invalid X more properly


Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2011-04-16 07:26:22 UTC (rev 6463)
+++ branches/experimental/patches/series	2011-04-16 08:03:15 UTC (rev 6464)
@@ -14,3 +14,4 @@
 setup-storage_preserve-in-place
 setup-storage_virtual-bugfix
 setup-storage_dont-create-current-config
+setup-storage_more-verbose-parser

Added: branches/experimental/patches/setup-storage_more-verbose-parser
===================================================================
--- branches/experimental/patches/setup-storage_more-verbose-parser	                        (rev 0)
+++ branches/experimental/patches/setup-storage_more-verbose-parser	2011-04-16 08:03:15 UTC (rev 6464)
@@ -0,0 +1,26 @@
+2011-04-16  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Parser.pm: Clarified error message in case of invalid string X
+		in disklabel:X.
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm
+@@ -620,12 +620,15 @@
+           }
+           $FAI::configs{$FAI::device}{preserveparts} = 1;
+         }
+-        | /^disklabel:(msdos|gpt-bios|gpt)/
++        | /^disklabel:(\S+)/
+         {
++          my $dl = $1;
++          ($dl =~ /^(msdos|gpt-bios|gpt)$/) or die
++            "Invalid disk label $dl; use one of msdos|gpt-bios|gpt\n";
+           # set the disk label - actually not only the above, but all types 
+           # supported by parted could be allowed, but others are not implemented
+           # yet
+-          $FAI::configs{$FAI::device}{disklabel} = $1;
++          $FAI::configs{$FAI::device}{disklabel} = $dl;
+         }
+         | /^bootable:(\d+)/
+         {




More information about the Fai-commit mailing list