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

Michael Tautschnig mt at alioth.debian.org
Wed Apr 28 21:53:58 UTC 2010


Author: mt
Date: 2010-04-28 21:53:58 +0000 (Wed, 28 Apr 2010)
New Revision: 5779

Modified:
   branches/experimental/patches/grub-pc
   branches/experimental/patches/setup-storage_lvm-preserve2
   branches/experimental/patches/setup-storage_preserve-lazy
Log:
- added grub-mkdevicemap call to 10-setup for grub-pc
- don't touch hash entries that might not exist


Modified: branches/experimental/patches/grub-pc
===================================================================
--- branches/experimental/patches/grub-pc	2010-04-28 12:26:29 UTC (rev 5778)
+++ branches/experimental/patches/grub-pc	2010-04-28 21:53:58 UTC (rev 5779)
@@ -41,7 +41,7 @@
 ===================================================================
 --- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
 +++ trunk/examples/simple/scripts/GRUB_PC/10-setup	
-@@ -2,8 +2,22 @@
+@@ -2,8 +2,24 @@
  
  error=0 ; trap "error=$((error|1))" ERR
  
@@ -55,6 +55,8 @@
 +
 +[ -z "$BOOT_DEVICE" ]    && exit 701
 +
++$ROOTCMD grub-mkdevicemap --no-floppy
++
 +for device in $BOOT_DEVICE; do
 +  grub_dev=$(device2grub $device)
 +  if [ -z "$grub_dev" ] ; then

Modified: branches/experimental/patches/setup-storage_lvm-preserve2
===================================================================
--- branches/experimental/patches/setup-storage_lvm-preserve2	2010-04-28 12:26:29 UTC (rev 5778)
+++ branches/experimental/patches/setup-storage_lvm-preserve2	2010-04-28 21:53:58 UTC (rev 5779)
@@ -168,8 +168,8 @@
      if (defined($FAI::configs{"VG_$vg"}{volumes}{$lv}) &&
          $FAI::configs{"VG_$vg"}{volumes}{$lv}{size}{preserve} != 1) {
        $FAI::configs{"VG_$vg"}{volumes}{$lv}{size}{preserve} = 1;
-@@ -479,6 +487,9 @@
-           (defined($FAI::current_config{$1}{partitions}{$part_id}) ? 1 : 0)
+@@ -480,6 +488,9 @@
+               defined($FAI::current_config{$1}{partitions}{$part_id})) ? 1 : 0)
            if (2 == $part->{size}->{preserve});
          next unless ($part->{size}->{preserve} || $part->{size}->{resize});
 +        defined ($FAI::current_config{$1}{partitions}{$part_id}) or die
@@ -178,7 +178,7 @@
          defined ($part->{size}->{range}) or die
            "Can't preserve ". &FAI::make_device_name($1, $part->{number})
              . " because it is not defined in the current config\n";
-@@ -493,10 +504,11 @@
+@@ -495,10 +506,11 @@
            if (2 == $FAI::configs{$config}{volumes}{$l}{size}{preserve});
          next unless ($FAI::configs{$config}{volumes}{$l}{size}{preserve} == 1 ||
            $FAI::configs{$config}{volumes}{$l}{size}{resize} == 1);
@@ -191,7 +191,7 @@
        }
      } elsif ($config eq "RAID") {
        # check for volumes that need to be preserved and preserve the underlying
-@@ -506,6 +518,8 @@
+@@ -508,6 +520,8 @@
            (defined($FAI::current_raid_config{$r}) ? 1 : 0)
            if (2 == $FAI::configs{$config}{volumes}{$r}{preserve});
          next unless ($FAI::configs{$config}{volumes}{$r}{preserve} == 1);

Modified: branches/experimental/patches/setup-storage_preserve-lazy
===================================================================
--- branches/experimental/patches/setup-storage_preserve-lazy	2010-04-28 12:26:29 UTC (rev 5778)
+++ branches/experimental/patches/setup-storage_preserve-lazy	2010-04-28 21:53:58 UTC (rev 5779)
@@ -98,27 +98,29 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Volumes.pm
 +++ trunk/lib/setup-storage/Volumes.pm	
-@@ -475,6 +475,9 @@
+@@ -475,6 +475,10 @@
      if ($config =~ /^PHY_(.+)$/) {
        foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
          my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
 +        $part->{size}->{preserve} =
-+          (defined($FAI::current_config{$1}{partitions}{$part_id}) ? 1 : 0)
++          ((defined($FAI::current_config{$1}) &&
++              defined($FAI::current_config{$1}{partitions}{$part_id})) ? 1 : 0)
 +          if (2 == $part->{size}->{preserve});
          next unless ($part->{size}->{preserve} || $part->{size}->{resize});
          defined ($part->{size}->{range}) or die
            "Can't preserve ". &FAI::make_device_name($1, $part->{number})
-@@ -485,6 +488,9 @@
+@@ -485,6 +489,10 @@
        # check for logical volumes that need to be preserved and preserve the
        # underlying devices recursively
        foreach my $l (keys %{ $FAI::configs{$config}{volumes} }) {
 +        $FAI::configs{$config}{volumes}{$l}{size}{preserve} =
-+          (defined($FAI::current_lvm_config{$1}{volumes}{$l}) ? 1 : 0)
++          ((defined($FAI::current_lvm_config{$1}) &&
++              defined($FAI::current_lvm_config{$1}{volumes}{$l})) ? 1 : 0)
 +          if (2 == $FAI::configs{$config}{volumes}{$l}{size}{preserve});
          next unless ($FAI::configs{$config}{volumes}{$l}{size}{preserve} == 1 ||
            $FAI::configs{$config}{volumes}{$l}{size}{resize} == 1);
          defined ($FAI::configs{$config}{volumes}{$l}{size}{range}) or die
-@@ -496,6 +502,9 @@
+@@ -496,6 +504,9 @@
        # check for volumes that need to be preserved and preserve the underlying
        # devices recursively
        foreach my $r (keys %{ $FAI::configs{$config}{volumes} }) {




More information about the Fai-commit mailing list