[Fai-commit] r6256 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Thu Dec 23 22:19:29 UTC 2010
Author: mt
Date: 2010-12-23 22:19:29 +0000 (Thu, 23 Dec 2010)
New Revision: 6256
Removed:
branches/experimental/patches/setup-storage_boot-device
branches/experimental/patches/setup-storage_cleanup-and-fix-dependencies
branches/experimental/patches/setup-storage_entire-disk-in-volume
branches/experimental/patches/setup-storage_no-useless-rebuild
branches/experimental/patches/setup-storage_pvcreate-old-lvm
Modified:
branches/experimental/patches/series
branches/experimental/patches/setup-storage_cryptsetup-passphrase
branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
branches/experimental/patches/setup-storage_preserve-format-all
Log:
several patches got merged into trunk
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/series 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,7 +1,6 @@
setup-storage_exp-version
logtail
grub-pc
-setup-storage_boot-device
bugfix-313397
bugfix-479537
setup-storage_no-cylinder-boundaries
@@ -9,7 +8,6 @@
fix-eval_cmdline
ainsl_man-page-return-codes
setup-storage_extended-is-not-last
-setup-storage_no-useless-rebuild
setup-storage_preserve-format-all
setup-storage_gpt-bios-fix
setup-storage_user-100-percent
@@ -18,13 +16,10 @@
fcopy_symlinks
setup-storage_cryptsetup-passphrase
setup-storage_no-empty-config
-setup-storage_entire-disk-in-volume
setup-storage_disklist-LOGDIR-defaults
grub-in-target
-setup-storage_pvcreate-old-lvm
setup-storage_hardcode-63-sectors
setup-storage_no-decimal
fcopy-unchanged-uid-gid
setup-storage_man-page-fixes
setup-storage_better-error-msg
-setup-storage_cleanup-and-fix-dependencies
Deleted: branches/experimental/patches/setup-storage_boot-device
===================================================================
--- branches/experimental/patches/setup-storage_boot-device 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_boot-device 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,250 +0,0 @@
-2010-12-03 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/{Fstab.pm,Parser.pm}: Cleanup code for defining BOOT_DEVICE
- (thanks Julien for doing most of the work).
- * simple/scripts/GRUB_PC/10-setup: No need to deal with multiple devices
- anymore, BOOT_DEVICE will always a be single value. Thanks alekibango and
- David Dreezer for lots of testing and debugging.
- * setup-storage: Generate conditional definitions for disk_var.sh such that
- variables will only be set if not previously defined by users.
- * setup-storage.8: Properly document semantics of BOOT_DEVICE and disk_var.sh.
-
-Index: trunk/bin/setup-storage
-===================================================================
---- trunk.orig/bin/setup-storage
-+++ trunk/bin/setup-storage
-@@ -218,14 +218,14 @@
-
- # write variables to $LOGDIR/disk_var.sh
- # debugging
--$FAI::debug and print "$_=$FAI::disk_var{$_}\n"
-+$FAI::debug and print "$_=\${$_:-$FAI::disk_var{$_}}\n"
- foreach (keys %FAI::disk_var);
-
- if ($FAI::no_dry_run)
- {
- open(DISK_VAR, ">$ENV{LOGDIR}/disk_var.sh")
- or die "Unable to write to file $ENV{LOGDIR}/disk_var.sh\n";
-- print DISK_VAR "$_=$FAI::disk_var{$_}\n" foreach (keys %FAI::disk_var);
-+ print DISK_VAR "$_=\${$_:-$FAI::disk_var{$_}}\n" foreach (keys %FAI::disk_var);
- close DISK_VAR;
- }
-
-Index: trunk/lib/setup-storage/Fstab.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Fstab.pm
-+++ trunk/lib/setup-storage/Fstab.pm
-@@ -129,6 +129,57 @@
- }
- }
-
-+################################################################################
-+#
-+# @brief Find the mount point for /boot
-+#
-+# @return mount point for /boot
-+#
-+################################################################################
-+sub find_boot_mnt_point {
-+ my $mnt_point;
-+
-+ # walk through all configured parts
-+ foreach my $c (keys %FAI::configs) {
-+
-+ if ($c =~ /^PHY_(.+)$/) {
-+ foreach my $p (keys %{ $FAI::configs{$c}{partitions} }) {
-+ my $this_mp = $FAI::configs{$c}{partitions}{$p}{mountpoint};
-+
-+ next if (!defined($this_mp));
-+
-+ return $this_mp if ($this_mp eq "/boot");
-+ $mnt_point = $this_mp if ($this_mp eq "/");
-+ }
-+ } elsif ($c =~ /^VG_(.+)$/) {
-+ next if ($1 eq "--ANY--");
-+ foreach my $l (keys %{ $FAI::configs{$c}{volumes} }) {
-+ my $this_mp = $FAI::configs{$c}{volumes}{$l}{mountpoint};
-+
-+ next if (!defined($this_mp));
-+
-+ return $this_mp if ($this_mp eq "/boot");
-+ $mnt_point = $this_mp if ($this_mp eq "/");
-+ }
-+ } elsif ($c eq "RAID" || $c eq "CRYPT") {
-+ foreach my $r (keys %{ $FAI::configs{$c}{volumes} }) {
-+ my $this_mp = $FAI::configs{$c}{volumes}{$r}{mountpoint};
-+
-+ next if (!defined($this_mp));
-+
-+ return $this_mp if ($this_mp eq "/boot");
-+ $mnt_point = $this_mp if ($this_mp eq "/");
-+ }
-+ } elsif ($c eq "TMPFS") {
-+ # not usable for /boot
-+ next;
-+ } else {
-+ &FAI::internal_error("Unexpected key $c");
-+ }
-+ }
-+
-+ return $mnt_point;
-+}
-
- ################################################################################
- #
-@@ -149,6 +200,9 @@
- # the file to be returned, a list of lines
- my @fstab = ();
-
-+ # mount point for /boot
-+ my $boot_mnt_point = &FAI::find_boot_mnt_point();
-+
- # walk through all configured parts
- # the order of entries is most likely wrong, it is fixed at the end
- foreach my $c (keys %$config) {
-@@ -173,15 +227,11 @@
- my $device_name = 0 == $p_ref->{number} ? $device :
- &FAI::make_device_name($device, $p_ref->{number});
-
-- # if the mount point is / or /boot, the variables should be set, unless
-- # they are already
-- if ($p_ref->{mountpoint} eq "/boot" || ($p_ref->{mountpoint} eq "/" &&
-- !defined ($FAI::disk_var{BOOT_PARTITION}))) {
-- # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
-+ # if the mount point the /boot mount point, variables must be set
-+ if ($p_ref->{mountpoint} eq $boot_mnt_point) {
-+ # set the BOOT_DEVICE and BOOT_PARTITION variables
- $FAI::disk_var{BOOT_PARTITION} = $device_name;
-- ($c =~ /^PHY_(.+)$/) or &FAI::internal_error("unexpected mismatch");
-- defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
-- $FAI::disk_var{BOOT_DEVICE} = $1;
-+ $FAI::disk_var{BOOT_DEVICE} = $device;
- }
-
- push @fstab, &FAI::create_fstab_line($p_ref,
-@@ -204,16 +254,9 @@
-
- my $device_name = "/dev/$device/$l";
-
-- # according to http://grub.enbug.org/LVMandRAID, this should work...
-- # if the mount point is / or /boot, the variables should be set, unless
-- # they are already
-- if ($l_ref->{mountpoint} eq "/boot" || ($l_ref->{mountpoint} eq "/" &&
-- !defined ($FAI::disk_var{BOOT_PARTITION}))) {
-- # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
-- $FAI::disk_var{BOOT_PARTITION} = $device_name;
-- defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
-- $FAI::disk_var{BOOT_DEVICE} = $device_name;
-- }
-+ # if the mount point the /boot mount point, variables must be set
-+ $FAI::disk_var{BOOT_DEVICE} = $device_name
-+ if ($l_ref->{mountpoint} eq $boot_mnt_point);
-
- push @fstab, &FAI::create_fstab_line($l_ref,
- &FAI::get_fstab_key($device_name, $config->{"VG_--ANY--"}->{fstabkey}), $device_name);
-@@ -231,16 +274,9 @@
-
- my $device_name = "/dev/md$r";
-
-- # according to http://grub.enbug.org/LVMandRAID, this should work...
-- # if the mount point is / or /boot, the variables should be set, unless
-- # they are already
-- if ($r_ref->{mountpoint} eq "/boot" || ($r_ref->{mountpoint} eq "/" &&
-- !defined ($FAI::disk_var{BOOT_PARTITION}))) {
-- # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
-- $FAI::disk_var{BOOT_PARTITION} = "$device_name";
-- defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
-- $FAI::disk_var{BOOT_DEVICE} = "$device_name";
-- }
-+ # if the mount point the /boot mount point, variables must be set
-+ $FAI::disk_var{BOOT_DEVICE} = $device_name
-+ if ($r_ref->{mountpoint} eq $boot_mnt_point);
-
- push @fstab, &FAI::create_fstab_line($r_ref,
- &FAI::get_fstab_key($device_name, $config->{RAID}->{fstabkey}), $device_name);
-@@ -253,8 +289,7 @@
-
- my $device_name = &FAI::enc_name($c_ref->{device});
-
-- ($c_ref->{mountpoint} eq "/boot" || ($c_ref->{mountpoint} eq "/" &&
-- !defined ($FAI::disk_var{BOOT_PARTITION}))) and
-+ ($c_ref->{mountpoint} eq $boot_mnt_point) and
- die "Boot partition cannot be encrypted\n";
-
- push @fstab, &FAI::create_fstab_line($c_ref, $device_name, $device_name);
-@@ -265,8 +300,7 @@
-
- next if ($c_ref->{mountpoint} eq "-");
-
-- ($c_ref->{mountpoint} eq "/boot" || ($c_ref->{mountpoint} eq "/" &&
-- !defined ($FAI::disk_var{BOOT_PARTITION}))) and
-+ ($c_ref->{mountpoint} eq $boot_mnt_point) and
- die "Boot partition cannot be a tmpfs\n";
-
- if (($c_ref->{mount_options} =~ m/size=/) || ($c_ref->{mount_options} =~ m/nr_blocks=/)) {
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -557,7 +557,6 @@
- $FAI::configs{$FAI::device}{bootable} = $1;
- ($FAI::device =~ /^PHY_(.+)$/) or
- &FAI::internal_error("unexpected device name");
-- $FAI::disk_var{BOOT_DEVICE} .= " $1";
- }
- | 'virtual'
- {
-Index: trunk/man/setup-storage.8
-===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8
-@@ -97,18 +97,19 @@
- .SH FILES
- If
- \fBsetup-storage\fP
--executes successfully an
-+executes successfully, an
- \fBfstab\fP(5)
- file matching the specified configuration is generated as
--$LOGDIR/fstab. Further $LOGDIR/disk_var.sh
--is generated and may be sourced to get the variables
-+$LOGDIR/fstab. Furthermore the file $LOGDIR/disk_var.sh
-+is generated. This file defines the following variables, if not yet set:
- .IR SWAPLIST ,
- .IR ROOT_PARTITION ,
- .IR BOOT_PARTITION
--and
-+(which is only set in case this resides on a disk drive), and
- .IR BOOT_DEVICE .
--The latter two will only be set in case they
--reside on a disk drive.
-+The latter two describe the partition and disk/RAID/LVM device hosting the mount
-+point for /boot. If /boot has no extra mount point, / is used instead.
-+You may source $LOGDIR/disk_var.sh to get the variables set.
- .SH SYNTAX
- This section describes the syntax of disk_config files
-
-Index: trunk/examples/simple/scripts/GRUB_PC/10-setup
-===================================================================
---- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
-+++ trunk/examples/simple/scripts/GRUB_PC/10-setup
-@@ -11,13 +11,14 @@
- [ -z "$BOOT_DEVICE" ] && exit 701
-
- $ROOTCMD grub-mkdevicemap --no-floppy
-+GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
-+# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=606035
-+GROOT=$(echo $GROOT | sed 's:md/:md:g')
-
--for device in $BOOT_DEVICE; do
-- GROOT=$($ROOTCMD grub-probe -tdrive -d $device)
-- $ROOTCMD grub-install --no-floppy --modules="lvm raid" "$GROOT"
-- echo "Grub installed on $device = $GROOT"
--done
-+$ROOTCMD grub-install --no-floppy "$GROOT"
-+echo "Grub installed on $BOOT_DEVICE = $GROOT"
-
- $ROOTCMD update-grub
-
-+
- exit $error
Deleted: branches/experimental/patches/setup-storage_cleanup-and-fix-dependencies
===================================================================
--- branches/experimental/patches/setup-storage_cleanup-and-fix-dependencies 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_cleanup-and-fix-dependencies 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,132 +0,0 @@
-2010-12-17 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: Fix dependencies between disk and LVM commands.
- (closes: #606113)
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -181,13 +181,12 @@
- # as that may be created later on
- (-b $disk) or die "Specified disk $disk does not exist in this system!\n";
- # 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);
-+ return 0 if ($part_no == -1);
- my $pre = "exist_$d";
- $pre .= ",cleared2_$disk" if (defined($FAI::configs{"PHY_$disk"}));
-- &FAI::push_command( $cmd, "$pre", "type_${t}_$d" );
-+ &FAI::push_command( "parted -s $disk set $part_no $t on", $pre, "type_${t}_$d" );
- if (defined($FAI::partition_table_deps{$disk}) &&
-- $FAI::partition_table_deps{$disk} ne "") {
-+ $FAI::partition_table_deps{$disk} ne "") {
- $FAI::partition_table_deps{$disk} .= ",type_${t}_$d";
- } else {
- $FAI::partition_table_deps{$disk} = "type_${t}_$d";
-@@ -411,16 +410,17 @@
- my $devs = "";
- # create all the devices
- foreach my $d (keys %{ $FAI::configs{$config}{devices} }) {
-- my $dev = &FAI::enc_name($d);
--
-- # set proper partition types for LVM
-- my $type_pre = "";
-- $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
--
-- &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
-- "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
-- $devs .= " $dev";
-- $pre_dev .= ",pv_done_$dev";
-+ $d = &FAI::enc_name($d);
-+ my $pre = ",exist_$d";
-+ my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($d);
-+ $pre = ",pt_complete_$disk"
-+ if (&FAI::set_partition_type_on_phys_dev($d, "lvm") &&
-+ defined($FAI::configs{"PHY_$disk"}));
-+
-+ &FAI::push_command( "pvcreate -ff -y $pv_create_options $d",
-+ "all_pv_sigs_removed$pre", "pv_done_$d");
-+ $devs .= " $d";
-+ $pre_dev .= ",pv_done_$d";
- }
- $pre_dev =~ s/^,//;
-
-@@ -445,24 +445,32 @@
- my @new_devices = ();
-
- # create an undefined entry for each device
-+ my $pre_dev = "vg_exists_$vg";
- foreach my $d (keys %{ $FAI::configs{$config}{devices} }) {
- my $denc = &FAI::enc_name($d);
- push @all_devices, $denc;
-- push @new_devices, $denc unless (exists($rm_devs{$denc}));
-+ if (exists($rm_devs{$denc})) {
-+ my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($denc);
-+ $pre_dev .= ($i_p_d && defined($FAI::configs{"PHY_$disk"})) ?
-+ ",pt_complete_$disk" : ",exist_$denc";
-+ } else {
-+ push @new_devices, $denc;
-+ }
- }
-
- # remove remaining devices from the list
- delete $rm_devs{$_} foreach (@all_devices);
-
- # create all the devices
-- my $pre_dev = "vg_exists_$vg";
- foreach my $dev (@new_devices) {
-- # set proper partition types for LVM
-- my $type_pre = "";
-- $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
-+ my $pre = ",exist_$dev";
-+ my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
-+ $pre = ",pt_complete_$disk"
-+ if (&FAI::set_partition_type_on_phys_dev($dev, "lvm") &&
-+ defined($FAI::configs{"PHY_$disk"}));
-
- &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
-- "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
-+ "all_pv_sigs_removed$pre", "pv_done_$dev");
- $pre_dev .= ",pv_done_$dev";
- }
- $pre_dev =~ s/^,//;
-@@ -918,11 +926,15 @@
- my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
- # get the existing id
- my $mapped_id = $part->{maps_to_existing};
-- # get the intermediate partition id
-- my $p = $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id};
-- # anything to be done?
-- $pre_all_resize .= ",exist_" . &FAI::make_device_name($disk, $p) unless
-- $part->{size}->{resize};
-+ # get the intermediate partition id; only available if
-+ # rebuild_preserved_partitions was done
-+ my $p = undef;
-+ if ($needs_resize) {
-+ $p = $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id};
-+ # anything to be done?
-+ $pre_all_resize .= ",exist_" . &FAI::make_device_name($disk, $p) unless
-+ $part->{size}->{resize};
-+ }
- if ($part->{size}->{resize}) {
- warn &FAI::make_device_name($disk, $mapped_id) . " will be resized\n";
- } else {
-@@ -1065,14 +1077,15 @@
- if ($part->{size}->{preserve} || $part->{size}->{resize});
- $fs = "" if ($fs eq "-");
-
-- my $pre = "";
-- $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
-+ my $pre = "cleared2_$disk";
-+ $pre .= ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
- # build a parted command to create the partition
- &FAI::push_command( "parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B",
-- "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
-+ $pre, "exist_" . &FAI::make_device_name($disk, $part_id) );
- $prev_id = $part_id;
- }
-
-+ ($prev_id > -1) or &FAI::internal_error("No partitions created");
- $FAI::partition_table_deps{$disk} = "cleared2_$disk,exist_"
- . &FAI::make_device_name($disk, $prev_id);
-
Modified: branches/experimental/patches/setup-storage_cryptsetup-passphrase
===================================================================
--- branches/experimental/patches/setup-storage_cryptsetup-passphrase 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_cryptsetup-passphrase 2010-12-23 22:19:29 UTC (rev 6256)
@@ -9,7 +9,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -230,7 +230,7 @@
+@@ -232,7 +232,7 @@
$pre_dep = "random_init_$real_dev";
}
@@ -18,7 +18,7 @@
my $keyfile = "$ENV{LOGDIR}/$enc_dev_short_name";
# generate a key for encryption
-@@ -245,9 +245,23 @@
+@@ -247,9 +247,23 @@
"cryptsetup luksOpen $real_dev $enc_dev_short_name --key-file $keyfile",
"crypt_format_$real_dev", "exist_$enc_dev_name" );
Modified: branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
===================================================================
--- branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults 2010-12-23 22:19:29 UTC (rev 6256)
@@ -108,7 +108,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -234,7 +234,7 @@
+@@ -233,7 +233,7 @@
}
if ($mode =~ /^luks(:"([^"]+)")?$/) {
Deleted: branches/experimental/patches/setup-storage_entire-disk-in-volume
===================================================================
--- branches/experimental/patches/setup-storage_entire-disk-in-volume 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_entire-disk-in-volume 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,43 +0,0 @@
-2010-10-12 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: Use proper dependencies when entire disks are
- used as part of a RAID or LVM volume (thanks Peter Kruse for reporting).
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -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";
-@@ -324,12 +327,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";
- }
Deleted: branches/experimental/patches/setup-storage_no-useless-rebuild
===================================================================
--- branches/experimental/patches/setup-storage_no-useless-rebuild 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_no-useless-rebuild 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,35 +0,0 @@
-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
-@@ -870,6 +870,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");
-@@ -880,10 +886,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_preserve-format-all
===================================================================
--- branches/experimental/patches/setup-storage_preserve-format-all 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_preserve-format-all 2010-12-23 22:19:29 UTC (rev 6256)
@@ -447,7 +447,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -1103,6 +1103,16 @@
+@@ -1121,6 +1121,16 @@
} elsif (defined($FAI::configs{$config}{partitions}{0})) {
# no partition table operations
$FAI::partition_table_deps{$disk} = "";
Deleted: branches/experimental/patches/setup-storage_pvcreate-old-lvm
===================================================================
--- branches/experimental/patches/setup-storage_pvcreate-old-lvm 2010-12-23 22:16:44 UTC (rev 6255)
+++ branches/experimental/patches/setup-storage_pvcreate-old-lvm 2010-12-23 22:19:29 UTC (rev 6256)
@@ -1,42 +0,0 @@
-2010-10-29 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: Always run vgchange -a -n, even if no prior LVM
- was detected; run pvcreate with -ff -y. (closes: #606485)
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -417,7 +417,7 @@
- my $type_pre = "";
- $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
-
-- &FAI::push_command( "pvcreate $pv_create_options $dev",
-+ &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
- "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
- $devs .= " $dev";
- $pre_dev .= ",pv_done_$dev";
-@@ -461,7 +461,7 @@
- my $type_pre = "";
- $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
-
-- &FAI::push_command( "pvcreate $pv_create_options $dev",
-+ &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
- "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
- $pre_dev .= ",pv_done_$dev";
- }
-@@ -668,13 +668,12 @@
- sub build_lvm_commands {
-
- # disable volumes if there are pre-existing ones
-- my $all_vg_pre = "";
-+ &FAI::push_command("vgchange -a n", "", "vgchange_a_n");
-+ my $all_vg_pre = "vgchange_a_n";
- if (scalar(keys %FAI::current_lvm_config)) {
-- &FAI::push_command("vgchange -a n", "", "vgchange_a_n");
- foreach my $vg (keys %FAI::current_lvm_config) {
- $all_vg_pre .= ",pv_sigs_removed_$vg" if (&FAI::cleanup_vg($vg));
- }
-- $all_vg_pre =~ s/^,//;
- }
- &FAI::push_command("true", "$all_vg_pre", "all_pv_sigs_removed");
-
More information about the Fai-commit
mailing list