[Fai-commit] r6243 - trunk/lib/setup-storage
Michael Tautschnig
mt at alioth.debian.org
Fri Dec 17 14:16:37 UTC 2010
Author: mt
Date: 2010-12-17 14:16:37 +0000 (Fri, 17 Dec 2010)
New Revision: 6243
Modified:
trunk/lib/setup-storage/Commands.pm
Log:
setup-storage/Commands.pm: Use proper dependencies when entire disks are used as
part of a RAID or LVM volume
Thanks: Peter Kruse
Modified: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk/lib/setup-storage/Commands.pm 2010-12-17 14:14:27 UTC (rev 6242)
+++ trunk/lib/setup-storage/Commands.pm 2010-12-17 14:16:37 UTC (rev 6243)
@@ -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}) &&
+ $FAI::partition_table_deps{$disk} ne "") {
$FAI::partition_table_deps{$disk} .= ",type_${t}_$d";
} else {
$FAI::partition_table_deps{$disk} = "type_${t}_$d";
@@ -310,12 +313,15 @@
}
$d = &FAI::enc_name($d);
- if ($vol->{preserve}) {
- $pre_req .= (&FAI::phys_dev($d))[0] ?
- ",pt_complete_" . (&FAI::phys_dev($d))[1] :
- ",exist_$d";
+ my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($d);
+ if ($vol->{preserve}) {
+ $pre_req .= ($i_p_d && defined($FAI::configs{"PHY_$disk"})) ?
+ ",pt_complete_$disk" :
+ ",exist_$d";
} elsif (&FAI::set_partition_type_on_phys_dev($d, "raid")) {
- $pre_req .= ",pt_complete_" . (&FAI::phys_dev($d))[1];
+ $pre_req .= defined($FAI::configs{"PHY_$disk"}) ?
+ ",pt_complete_$disk" :
+ ",exist_$d";
} else {
$pre_req .= ",exist_$d";
}
More information about the Fai-commit
mailing list