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

Michael Tautschnig mt at alioth.debian.org
Tue Apr 20 11:38:06 UTC 2010


Author: mt
Date: 2010-04-20 11:38:04 +0000 (Tue, 20 Apr 2010)
New Revision: 5773

Added:
   branches/experimental/patches/setup-storage_abs-path
Modified:
   branches/experimental/patches/series
Log:
use absolute path names for devices


Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2010-04-20 08:17:51 UTC (rev 5772)
+++ branches/experimental/patches/series	2010-04-20 11:38:04 UTC (rev 5773)
@@ -12,3 +12,4 @@
 setup-storage_package
 setup-storage_parted2.2
 setup-storage_empty-vg
+setup-storage_abs-path

Added: branches/experimental/patches/setup-storage_abs-path
===================================================================
--- branches/experimental/patches/setup-storage_abs-path	                        (rev 0)
+++ branches/experimental/patches/setup-storage_abs-path	2010-04-20 11:38:04 UTC (rev 5773)
@@ -0,0 +1,46 @@
+2010-04-20  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Volumes.pm: Use absolute path names for devices in volume
+		groups, RAID volumes.
+Index: trunk/lib/setup-storage/Volumes.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Volumes.pm
++++ trunk/lib/setup-storage/Volumes.pm	
+@@ -367,6 +367,7 @@
+ sub get_current_lvm {
+ 
+   use Linux::LVM;
++  use Cwd qw(abs_path);
+ 
+   # get the existing volume groups
+   foreach my $vg (get_volume_group_list()) {
+@@ -396,8 +397,8 @@
+ 
+     # store the physical volumes
+     my %pv_info = get_physical_volume_information($vg);
+-    @{ $FAI::current_lvm_config{$vg}{physical_volumes} } =
+-      sort keys %pv_info;
++    push @{ $FAI::current_lvm_config{$vg}{physical_volumes} },
++      abs_path($_) foreach (sort keys %pv_info);
+   }
+ 
+ }
+@@ -410,6 +411,8 @@
+ ################################################################################
+ sub get_current_raid {
+ 
++  use Cwd qw(abs_path);
++
+   # the list to hold the output of mdadm commands as parsed below
+   my @mdadm_print = ();
+ 
+@@ -445,7 +448,8 @@
+       &FAI::push_command( "true", "", "exist_/dev/md$id" );
+     } elsif ($line =~ /^\s*devices=(\S+)$/) {
+       defined($id) or &FAI::internal_error("mdadm ARRAY line not yet seen");
+-      @{ $FAI::current_raid_config{$id}{devices} } = split (",", $1);
++      push @{ $FAI::current_raid_config{$id}{devices} }, abs_path($_)
++        foreach (split (",", $1));
+     }
+   }
+ }




More information about the Fai-commit mailing list