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

Michael Tautschnig mt at alioth.debian.org
Thu Dec 16 19:06:49 UTC 2010


Author: mt
Date: 2010-12-16 19:06:29 +0000 (Thu, 16 Dec 2010)
New Revision: 6236

Added:
   branches/experimental/patches/setup-storage_better-error-msg
Modified:
   branches/experimental/patches/series
   branches/experimental/patches/setup-storage_boot-device
   branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
   branches/experimental/patches/setup-storage_entire-disk-in-volume
   branches/experimental/patches/setup-storage_man-page-fixes
   branches/experimental/patches/setup-storage_pvcreate-old-lvm
Log:
- further setup-storage man-page improvement
- improved diagnostics for disk_config syntax errors


Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/series	2010-12-16 19:06:29 UTC (rev 6236)
@@ -26,3 +26,4 @@
 setup-storage_no-decimal
 fcopy-unchanged-uid-gid
 setup-storage_man-page-fixes
+setup-storage_better-error-msg

Added: branches/experimental/patches/setup-storage_better-error-msg
===================================================================
--- branches/experimental/patches/setup-storage_better-error-msg	                        (rev 0)
+++ branches/experimental/patches/setup-storage_better-error-msg	2010-12-16 19:06:29 UTC (rev 6236)
@@ -0,0 +1,41 @@
+2010-12-16  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Parser.pm: Fix error message in case of duplicate definitions
+		of a single disk. Sensible diagnostics instead of just printing "Syntax
+    error" for several syntax errors. Thanks Toomas Tamm for reporting this.
+	* setup-storage/Volumes.pm: Proper error reporting for wrong disk names (one
+		die was overridden by yet another die).
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm	
+@@ -128,7 +128,7 @@
+ 
+   # test, whether this is the first disk_config stanza to configure $disk
+   defined ($FAI::configs{$FAI::device})
+-    and die "Duplicate configuration for disk $FAI::disks[ $1-1 ]\n";
++    and die "Duplicate configuration for disk $disk\n";
+ 
+   # Initialise the entry in $FAI::configs
+   $FAI::configs{$FAI::device} = {
+@@ -384,6 +384,7 @@
+     line: <skip: qr/[ \t]*/> "\\n"
+         | <skip: qr/[ \t]*/> comment "\\n"
+         | <skip: qr/[ \t]*/> config "\\n"
++        | <error>
+ 
+     comment: /^\s*#.*/
+ 
+Index: trunk/lib/setup-storage/Volumes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Volumes.pm
++++ trunk/lib/setup-storage/Volumes.pm	
+@@ -534,6 +534,8 @@
+           defined ($FAI::current_config{$1}) or die
+             "Can't preserve $1 because it does not exist\n";
+         } else {
++          defined ($FAI::current_config{$1}) or die
++            "Can't preserve partition on $1 because $1 does not exist\n";
+           defined ($FAI::current_config{$1}{partitions}{$part_id}) or die
+             "Can't preserve ". &FAI::make_device_name($1, $part->{number})
+               . " because it does not exist\n";

Modified: branches/experimental/patches/setup-storage_boot-device
===================================================================
--- branches/experimental/patches/setup-storage_boot-device	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/setup-storage_boot-device	2010-12-16 19:06:29 UTC (rev 6236)
@@ -3,7 +3,8 @@
 	* setup-storage/{Fstab.pm,Parser.pm}: Cleanup code for defining BOOT_DEVICE
 		(thanks Julien for doing most of the work).
 	* simple/scripts/GRUB_PC/10-setup: No need to deal with multiple devices
-		anymore, BOOT_DEVICE will always a be single value.
+		anymore, BOOT_DEVICE will always a be single value. Thanks alekibango and
+    David Dreezer for lots of testing and debugging.
 	* setup-storage: Generate conditional definitions for disk_var.sh such that
 		variables will only be set if not previously defined by users.
 	* setup-storage.8: Properly document semantics of BOOT_DEVICE and disk_var.sh.

Modified: branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
===================================================================
--- branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults	2010-12-16 19:06:29 UTC (rev 6236)
@@ -108,7 +108,7 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Commands.pm
 +++ trunk/lib/setup-storage/Commands.pm	
-@@ -233,7 +233,7 @@
+@@ -234,7 +234,7 @@
        }
  
        if ($mode =~ /^luks(:"([^"]+)")?$/) {

Modified: branches/experimental/patches/setup-storage_entire-disk-in-volume
===================================================================
--- branches/experimental/patches/setup-storage_entire-disk-in-volume	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/setup-storage_entire-disk-in-volume	2010-12-16 19:06:29 UTC (rev 6236)
@@ -6,18 +6,21 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Commands.pm
 +++ trunk/lib/setup-storage/Commands.pm	
-@@ -183,7 +183,9 @@
+@@ -183,8 +183,11 @@
    # set the raid/lvm unless this is an entire disk flag
    my $cmd = "parted -s $disk set $part_no $t on";
    $cmd = "true" if ($part_no == -1);
 -  &FAI::push_command( $cmd, "cleared2_$disk,exist_$d", "type_${t}_$d" );
+-  if (defined($FAI::partition_table_deps{$disk})) {
 +  my $pre = "exist_$d";
 +  $pre .= ",cleared2_$disk" if (defined($FAI::configs{"PHY_$disk"}));
 +  &FAI::push_command( $cmd, "$pre", "type_${t}_$d" );
-   if (defined($FAI::partition_table_deps{$disk})) {
++  if (defined($FAI::partition_table_deps{$disk}) &&
++    $FAI::partition_table_deps{$disk} ne "") {
      $FAI::partition_table_deps{$disk} .= ",type_${t}_$d";
    } else {
-@@ -324,12 +326,15 @@
+     $FAI::partition_table_deps{$disk} = "type_${t}_$d";
+@@ -324,12 +327,15 @@
          }
  
          $d = &FAI::enc_name($d);

Modified: branches/experimental/patches/setup-storage_man-page-fixes
===================================================================
--- branches/experimental/patches/setup-storage_man-page-fixes	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/setup-storage_man-page-fixes	2010-12-16 19:06:29 UTC (rev 6236)
@@ -43,11 +43,13 @@
  .SH FILES
  If
  \fBsetup-storage\fP
-@@ -111,9 +114,207 @@
+@@ -111,9 +114,209 @@
  The latter two describe the partition and disk/RAID/LVM device hosting the mount
  point for /boot. If /boot has no extra mount point, / is used instead.
  You may source $LOGDIR/disk_var.sh to get the variables set.
 -Furthermore, if encryption was configured, a proper
++The example config space shipped with FAI sources this file in
++scripts/GRUB_PC/10-setup and files/boot/grub/menu.lst/postinst.
 +If encryption was configured, a proper
  \fBcrypttab\fP(5)
  file plus keyfiles will be generated.
@@ -252,7 +254,7 @@
  .SH SYNTAX
  This section describes the syntax of disk_config files
  
-@@ -236,13 +437,19 @@
+@@ -236,13 +439,19 @@
  .br
             | preserve_always:([[:digit:]]+(,[[:digit:]]+)*|all)
  .br
@@ -274,7 +276,7 @@
  .br
             | preserve_lazy:([[:digit:]]+(,[[:digit:]]+)*|all)
  .br
-@@ -434,17 +641,20 @@
+@@ -434,17 +643,20 @@
  .SH MIGRATION FROM SETUP_HARDDISKS
  The major differences to the prior configuration syntax are:
  .IP \(bu
@@ -300,7 +302,7 @@
  .IP \(bu
  The "preserveX" and "boot" options are one of the options now given on the
  disk_config line, using preserve_reinstall, preserve_always, or preserve_lazy,
-@@ -459,140 +669,6 @@
+@@ -459,140 +671,6 @@
  Support for LVM and RAID is completely new
  .IP \(bu
  Resizing partitions and filesystems is supported
@@ -441,7 +443,7 @@
  
  .SH CAVEATS
  .IP \(bu
-@@ -612,7 +688,7 @@
+@@ -612,7 +690,7 @@
  reasons why a system may fail to boot.
  .IP \(bu
  Crypto support requires some site-specific changes: If you use cryptsetup
@@ -450,7 +452,7 @@
  (unless you used the passphrase option). The key files are left in /tmp/fai; you
  will want to copy these to some removable media. To make encrypted root devices
  actually usable, you need to add busybox (and initramfs-tools) to your package
-@@ -621,7 +697,7 @@
+@@ -621,7 +699,7 @@
  This program is part of FAI (Fully Automatic Installation).
  The FAI homepage is http://fai-project.org.
  

Modified: branches/experimental/patches/setup-storage_pvcreate-old-lvm
===================================================================
--- branches/experimental/patches/setup-storage_pvcreate-old-lvm	2010-12-14 16:30:45 UTC (rev 6235)
+++ branches/experimental/patches/setup-storage_pvcreate-old-lvm	2010-12-16 19:06:29 UTC (rev 6236)
@@ -6,7 +6,7 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Commands.pm
 +++ trunk/lib/setup-storage/Commands.pm	
-@@ -416,7 +416,7 @@
+@@ -417,7 +417,7 @@
        my $type_pre = "";
        $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
  
@@ -15,7 +15,7 @@
          "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
        $devs .= " $dev";
        $pre_dev .= ",pv_done_$dev";
-@@ -460,7 +460,7 @@
+@@ -461,7 +461,7 @@
      my $type_pre = "";
      $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
  
@@ -24,7 +24,7 @@
        "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
      $pre_dev .= ",pv_done_$dev";
    }
-@@ -667,13 +667,12 @@
+@@ -668,13 +668,12 @@
  sub build_lvm_commands {
  
    # disable volumes if there are pre-existing ones




More information about the Fai-commit mailing list