[Fai-commit] r4867 - people/michael/features/setup_harddisks_2/implementation/lib

mt at alioth.debian.org mt at alioth.debian.org
Wed Apr 9 23:17:32 UTC 2008


Author: mt
Date: 2008-04-09 23:17:31 +0000 (Wed, 09 Apr 2008)
New Revision: 4867

Modified:
   people/michael/features/setup_harddisks_2/implementation/lib/commands.pm
   people/michael/features/setup_harddisks_2/implementation/lib/exec.pm
   people/michael/features/setup_harddisks_2/implementation/lib/fstab.pm
Log:
- properly handle "-" as filesystem specs during mkpart
- fixed further missing "p"s in case of cciss et al.


Modified: people/michael/features/setup_harddisks_2/implementation/lib/commands.pm
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/lib/commands.pm	2008-04-09 12:45:38 UTC (rev 4866)
+++ people/michael/features/setup_harddisks_2/implementation/lib/commands.pm	2008-04-09 23:17:31 UTC (rev 4867)
@@ -621,11 +621,13 @@
     }
     
     my $fs = $part->{filesystem};
+    $fs = "" unless defined($fs);
     $fs = "linux-swap" if ($fs eq "swap");
     $fs = "fat32" if ($fs eq "vfat");
     $fs = "fat16" if ($fs eq "msdos");
     $fs = $FAI::current_config{$disk}{partitions}{$mapped_id}{filesystem}
       if ($part->{size}->{preserve} || $part->{size}->{resize});
+    $fs = "" if ($fs eq "-");
 
     # build a parted command to create the partition
     push @FAI::commands, "parted -s $disk mkpart $part_type $fs ${start}B ${end}B";
@@ -668,8 +670,11 @@
       next if ($part->{size}->{preserve} == 1
         || $part->{size}->{resize} == 1 || $part->{size}->{extended} == 1);
 
-      # create the filesystem on $disk$part_id
-      &FAI::build_mkfs_commands( "$disk$part_id", $part );
+      # create the filesystem on the device
+      my $dev = $disk;
+      $dev = "${dev}p" if ($dev =~ m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)$});
+      $dev = $dev . $part_id;
+      &FAI::build_mkfs_commands( $dev, $part );
     }
   }
 }

Modified: people/michael/features/setup_harddisks_2/implementation/lib/exec.pm
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/lib/exec.pm	2008-04-09 12:45:38 UTC (rev 4866)
+++ people/michael/features/setup_harddisks_2/implementation/lib/exec.pm	2008-04-09 23:17:31 UTC (rev 4867)
@@ -101,7 +101,7 @@
   {
     error        => "parted_6",
     message      => "Parted was unable to read the partition table\n",
-    stderr_regex => "No Implementation: Partition \d+ isn't aligned to cylinder boundaries",
+    stderr_regex => "No Implementation: Partition \\d+ isn't aligned to cylinder boundaries",
     stdout_regex => "",
     program      => "parted",
     response     => "die",

Modified: people/michael/features/setup_harddisks_2/implementation/lib/fstab.pm
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/lib/fstab.pm	2008-04-09 12:45:38 UTC (rev 4866)
+++ people/michael/features/setup_harddisks_2/implementation/lib/fstab.pm	2008-04-09 23:17:31 UTC (rev 4867)
@@ -102,6 +102,7 @@
     # entry is a physical device
     if ($c =~ /^PHY_(.+)$/) {
       my $device = $1;
+      $device = "${device}p" if ($device =~ m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)$});
 
       # make sure the desired fstabkey is defined at all
       defined ($config->{$c}->{fstabkey})




More information about the Fai-commit mailing list