[Fai-commit] r5825 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Thu Jul 1 22:31:00 UTC 2010
Author: mt
Date: 2010-07-01 22:31:00 +0000 (Thu, 01 Jul 2010)
New Revision: 5825
Added:
branches/experimental/patches/setup-storage_no-useless-rebuild
Modified:
branches/experimental/patches/series
branches/experimental/patches/setup-storage_always-format
branches/experimental/patches/setup-storage_external-journal
branches/experimental/patches/setup-storage_lvm-preserve2
branches/experimental/patches/setup-storage_resize2fs
branches/experimental/patches/setup-storage_tmpfs
Log:
- fixed possible dependency problem in LVM preserve
- added patch to avoid useless duplicate rebuild of partition table
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/series 2010-07-01 22:31:00 UTC (rev 5825)
@@ -23,3 +23,4 @@
setup-storage_better-parser-errors
setup-storage_extended-is-not-last
setup-storage_exit-codes
+setup-storage_no-useless-rebuild
Modified: branches/experimental/patches/setup-storage_always-format
===================================================================
--- branches/experimental/patches/setup-storage_always-format 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/setup-storage_always-format 2010-07-01 22:31:00 UTC (rev 5825)
@@ -40,7 +40,7 @@
next;
}
-@@ -1043,8 +1055,9 @@
+@@ -1041,8 +1053,9 @@
my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
# skip preserved/resized/extended partitions
Modified: branches/experimental/patches/setup-storage_external-journal
===================================================================
--- branches/experimental/patches/setup-storage_external-journal 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/setup-storage_external-journal 2010-07-01 22:31:00 UTC (rev 5825)
@@ -70,7 +70,7 @@
# possibly tune the file system - this depends on whether the file system
# supports tuning at all
-@@ -985,12 +1018,14 @@
+@@ -983,12 +1016,14 @@
}
}
Modified: branches/experimental/patches/setup-storage_lvm-preserve2
===================================================================
--- branches/experimental/patches/setup-storage_lvm-preserve2 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/setup-storage_lvm-preserve2 2010-07-01 22:31:00 UTC (rev 5825)
@@ -361,17 +361,17 @@
# perform all necessary operations on the underlying logical volumes
&FAI::setup_logical_volumes($config);
-@@ -754,7 +803,9 @@
+@@ -754,8 +803,8 @@
or die "Can't change disklabel, partitions are to be preserved\n";
# write the disklabel to drop the previous partition table
- &FAI::push_command( "parted -s $disk mklabel $label", "exist_$disk",
-+ my $pre = "exist_$disk";
-+ $pre .= ",vgchange_a_n" if (scalar(keys %FAI::current_lvm_config));
-+ &FAI::push_command( "parted -s $disk mklabel $label", $pre,
- "cleared1_$disk" );
+- "cleared1_$disk" );
++ &FAI::push_command( "parted -s $disk mklabel $label",
++ "exist_$disk,all_pv_sigs_removed", "cleared1_$disk" );
&FAI::rebuild_preserved_partitions($config, \@to_preserve);
+
Index: trunk/lib/setup-storage/Volumes.pm
===================================================================
--- trunk.orig/lib/setup-storage/Volumes.pm
Added: branches/experimental/patches/setup-storage_no-useless-rebuild
===================================================================
--- branches/experimental/patches/setup-storage_no-useless-rebuild (rev 0)
+++ branches/experimental/patches/setup-storage_no-useless-rebuild 2010-07-01 22:31:00 UTC (rev 5825)
@@ -0,0 +1,35 @@
+2010-07-02 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage/Commands.pm: Rebuild partition table only once, unless
+ necessary for resizing (thanks Toomas Tamm <tt-fai at kky.ttu.ee> for
+ insisting).
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm
+@@ -858,6 +858,12 @@
+
+ # the list of partitions that must be preserved
+ my @to_preserve = &FAI::get_preserved_partitions($config);
++ # resize needed?
++ my $needs_resize = 0;
++ foreach my $part_id (@to_preserve) {
++ $needs_resize = 1 if ($FAI::configs{$config}{partitions}{$part_id}{size}{resize});
++ last if ($needs_resize);
++ }
+
+ my $label = $FAI::configs{$config}{disklabel};
+ $label = "gpt" if ($label eq "gpt-bios");
+@@ -868,10 +874,10 @@
+ or die "Can't change disklabel, partitions are to be preserved\n";
+
+ # write the disklabel to drop the previous partition table
+- &FAI::push_command( "parted -s $disk mklabel $label",
++ &FAI::push_command( ($needs_resize ? "parted -s $disk mklabel $label" : "true"),
+ "exist_$disk,all_pv_sigs_removed", "cleared1_$disk" );
+
+- &FAI::rebuild_preserved_partitions($config, \@to_preserve);
++ &FAI::rebuild_preserved_partitions($config, \@to_preserve) if ($needs_resize);
+
+ my $pre_all_resize = "";
+
Modified: branches/experimental/patches/setup-storage_resize2fs
===================================================================
--- branches/experimental/patches/setup-storage_resize2fs 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/setup-storage_resize2fs 2010-07-01 22:31:00 UTC (rev 5825)
@@ -68,7 +68,7 @@
"exist_/dev/$vg/$lv" );
# create the filesystem on the volume
-@@ -880,25 +900,42 @@
+@@ -878,25 +898,42 @@
my $start = $part->{start_byte};
my $end = $part->{end_byte};
Modified: branches/experimental/patches/setup-storage_tmpfs
===================================================================
--- branches/experimental/patches/setup-storage_tmpfs 2010-07-01 21:50:26 UTC (rev 5824)
+++ branches/experimental/patches/setup-storage_tmpfs 2010-07-01 22:31:00 UTC (rev 5825)
@@ -32,7 +32,7 @@
($config =~ /^VG_(.+)$/) or &FAI::internal_error("Invalid config $config");
next if ($1 eq "--ANY--");
my $vg = $1; # the volume group
-@@ -1031,8 +1031,8 @@
+@@ -1029,8 +1029,8 @@
# loop through all configs
foreach my $config ( keys %FAI::configs ) {
More information about the Fai-commit
mailing list