[Fai-commit] r6717 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Sat Oct 22 13:06:00 UTC 2011
Author: mt
Date: 2011-10-22 13:06:00 +0000 (Sat, 22 Oct 2011)
New Revision: 6717
Removed:
branches/experimental/patches/setup-storage_align-first-part-preserve
branches/experimental/patches/setup-storage_dont-create-current-config
branches/experimental/patches/setup-storage_first-part-at-1M
branches/experimental/patches/setup-storage_gpt-100-bugfix
branches/experimental/patches/setup-storage_keep-flags
branches/experimental/patches/setup-storage_loopback-support
branches/experimental/patches/setup-storage_more-verbose-parser
branches/experimental/patches/setup-storage_path-logdir-diskinfo-opts
branches/experimental/patches/setup-storage_preserve-in-place
branches/experimental/patches/setup-storage_softraid-assemble-error
branches/experimental/patches/setup-storage_syntax-check-mode
branches/experimental/patches/setup-storage_udevsettle-before-vol-id
branches/experimental/patches/setup-storage_virtual-bugfix
branches/experimental/patches/setup-storage_wipefs
Modified:
branches/experimental/patches/bugfix-498412
branches/experimental/patches/logtail
branches/experimental/patches/series
Log:
Merged all setup-storage patches into trunk
Modified: branches/experimental/patches/bugfix-498412
===================================================================
--- branches/experimental/patches/bugfix-498412 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/bugfix-498412 2011-10-22 13:06:00 UTC (rev 6717)
@@ -300,8 +300,8 @@
Package: fai-client
Architecture: all
Depends: perl, file, libapt-pkg-perl, iproute
--Recommends: debconf-utils, cfengine2
-+Recommends: debconf-utils, cfengine2, libgraph-perl
+-Recommends: debconf-utils
++Recommends: debconf-utils, libgraph-perl
Suggests: logtail
Description: Fully Automatic Installation client package
FAI is a non-interactive system to install, customize and manage
Modified: branches/experimental/patches/logtail
===================================================================
--- branches/experimental/patches/logtail 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/logtail 2011-10-22 13:06:00 UTC (rev 6717)
@@ -23,7 +23,7 @@
@@ -14,6 +14,7 @@
Architecture: all
Depends: perl, file, libapt-pkg-perl, iproute
- Recommends: debconf-utils, cfengine2
+ Recommends: debconf-utils
+Suggests: logtail
Description: Fully Automatic Installation client package
FAI is a non-interactive system to install, customize and manage
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/series 2011-10-22 13:06:00 UTC (rev 6717)
@@ -11,17 +11,3 @@
fcopy-unchanged-uid-gid
make-fai-nfsroot_add-keys
extrbase-hook
-setup-storage_preserve-in-place
-setup-storage_virtual-bugfix
-setup-storage_dont-create-current-config
-setup-storage_more-verbose-parser
-setup-storage_first-part-at-1M
-setup-storage_loopback-support
-setup-storage_syntax-check-mode
-setup-storage_softraid-assemble-error
-setup-storage_align-first-part-preserve
-setup-storage_udevsettle-before-vol-id
-setup-storage_gpt-100-bugfix
-setup-storage_wipefs
-setup-storage_keep-flags
-setup-storage_path-logdir-diskinfo-opts
Deleted: branches/experimental/patches/setup-storage_align-first-part-preserve
===================================================================
--- branches/experimental/patches/setup-storage_align-first-part-preserve 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_align-first-part-preserve 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,47 +0,0 @@
-2011-06-05 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Sizes.pm: properly handle alignment and preserving first
- partition.
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -625,6 +625,9 @@
- # the start byte for the next partition - first partition starts at 1M as is
- # new default for most systems it seems
- my $next_start = 1024 * 1024;
-+ # force original start if first partition will be preserved
-+ $next_start = $current_disk->{partitions}->{1}->{begin_byte}
-+ if ($FAI::configs{$config}{partitions}{1}{size}{preserve});
-
- if ($FAI::configs{$config}{disklabel} eq "gpt") {
- # modify the disk to claim the space for the second partition table
-@@ -643,13 +646,24 @@
- &FAI::init_part_config("primary");
- $FAI::configs{$config}{gpt_bios_part} =
- (&FAI::phys_dev($FAI::partition_pointer_dev_name))[2];
-- my ($s, $e) = &FAI::make_range("1-1", $current_disk->{size} . "B");
- # enter the range into the hash
-+ my $s = 1024 * 1024;
- $FAI::partition_pointer->{size}->{range} = "$s-$s";
- # retain the free space at the beginning and fix the position
-- $FAI::partition_pointer->{start_byte} = $next_start;
-- $FAI::partition_pointer->{end_byte} = $next_start + $s - 1;
-- $next_start += $s;
-+ if ($FAI::configs{$config}{partitions}{1}{size}{preserve})
-+ {
-+ # try to squeeze it in before first partition
-+ ($next_start - $s > 63 * $current_disk->{sector_size}) or
-+ die "Insufficient space before first and preserved partition to insert gpt-bios partiton\n";
-+ $FAI::partition_pointer->{start_byte} = $next_start - $s;
-+ $FAI::partition_pointer->{end_byte} = $next_start - 1;
-+ }
-+ else
-+ {
-+ $FAI::partition_pointer->{start_byte} = $next_start;
-+ $FAI::partition_pointer->{end_byte} = $next_start + $s - 1;
-+ $next_start += $s;
-+ }
- # set proper defaults
- $FAI::partition_pointer->{encrypt} = 0;
- $FAI::partition_pointer->{filesystem} = "-";
Deleted: branches/experimental/patches/setup-storage_dont-create-current-config
===================================================================
--- branches/experimental/patches/setup-storage_dont-create-current-config 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_dont-create-current-config 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,69 +0,0 @@
-2011-04-16 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/{Volumes,Sizes}.pm: Do not unintentionally create entries in
- current_config and properly test before using it (user may have missed to
- add the disks to $disklist). Thanks Alexander Swen for describing the
- problem.
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -584,6 +584,8 @@
- # test, whether $disk is a block special device
- (-b $disk) or die "$disk is not a valid device name\n";
- # reference to the current disk config
-+ defined ($FAI::current_config{$disk}) or
-+ &FAI::internal_error("Device $disk missing in \$disklist - check buggy");
- my $current_disk = $FAI::current_config{$disk};
-
- # align to sector boundary by default
-Index: trunk/lib/setup-storage/Volumes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Volumes.pm
-+++ trunk/lib/setup-storage/Volumes.pm
-@@ -506,12 +506,14 @@
- if (1 == $i_p_d) {
- if (defined($FAI::configs{"PHY_$disk"}) &&
- defined($FAI::configs{"PHY_$disk"}{partitions}{$part_no})) {
-- defined ($FAI::current_config{$disk}{partitions}{$part_no}) or die
-+ (defined ($FAI::current_config{$disk}) &&
-+ defined ($FAI::current_config{$disk}{partitions}{$part_no})) or die
- "Can't preserve $device_name because it does not exist\n";
- $FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{preserve} = 1;
- $FAI::configs{"PHY_$disk"}{preserveparts} = 1;
- } elsif (0 == $missing) {
-- defined ($FAI::current_config{$disk}{partitions}{$part_no}) or die
-+ (defined ($FAI::current_config{$disk}) &&
-+ defined ($FAI::current_config{$disk}{partitions}{$part_no})) or die
- "Can't preserve $device_name because it does not exist\n";
- }
- } elsif ($device_name =~ m{^/dev/md[\/]?(\d+)$}) {
-@@ -562,21 +564,20 @@
- foreach my $config (keys %FAI::configs) {
-
- if ($config =~ /^PHY_(.+)$/) {
-+ defined ($FAI::current_config{$1}) or
-+ die "Device $1 was not specified in \$disklist\n";
-+ defined ($FAI::current_config{$1}{partitions}) or
-+ &FAI::internal_error("Missing key \"partitions\"");
-+
- foreach my $part_id (&numsort(keys %{ $FAI::configs{$config}{partitions} })) {
- my $part = (\%FAI::configs)->{$config}->{partitions}->{$part_id};
- $part->{size}->{preserve} =
-- ((defined($FAI::current_config{$1}) &&
-- defined($FAI::current_config{$1}{partitions}{$part_id})) ? 1 : 0)
-+ (defined($FAI::current_config{$1}{partitions}{$part_id}) ? 1 : 0)
- if (2 == $part->{size}->{preserve});
- next unless ($part->{size}->{preserve} || $part->{size}->{resize});
- ($part->{size}->{extended}) and die
- "Preserving extended partitions is not supported; mark all logical partitions instead\n";
-- if (0 == $part_id) {
-- defined ($FAI::current_config{$1}) or die
-- "Can't preserve $1 because it does not exist\n";
-- } else {
-- defined ($FAI::current_config{$1}) or die
-- "Can't preserve partition on $1 because $1 does not exist\n";
-+ if (0 != $part_id) {
- defined ($FAI::current_config{$1}{partitions}{$part_id}) or die
- "Can't preserve ". &FAI::make_device_name($1, $part_id)
- . " because it does not exist\n";
Deleted: branches/experimental/patches/setup-storage_first-part-at-1M
===================================================================
--- branches/experimental/patches/setup-storage_first-part-at-1M 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_first-part-at-1M 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,41 +0,0 @@
-2011-05-23 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Sizes.pm: Have first partition start at 1M on all disk labels;
- this is in consistency with other partitioning tools and operating systems.
- Yet it may result in unexpected overlapping-partition errors.
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -622,27 +622,15 @@
- }
- }
-
-- # the start byte for the next partition
-- my $next_start = 0;
--
-- if ($FAI::configs{$config}{disklabel} eq "msdos") {
-- # on msdos disk labels, the first partitions starts at head #1; well,
-- # enforce a 63-sectors-per-track layout
-- $next_start = 63 * $current_disk->{sector_size};
--
-- } elsif ($FAI::configs{$config}{disklabel} eq "gpt") {
-- # on GPT-EFI disk labels the first 34 and last 33 sectors must be left alone
-- $next_start = 34 * $current_disk->{sector_size};
-+ # the start byte for the next partition - first partition starts at 1M as is
-+ # new default for most systems it seems
-+ my $next_start = 1024 * 1024;
-
-+ if ($FAI::configs{$config}{disklabel} eq "gpt") {
- # modify the disk to claim the space for the second partition table
- $current_disk->{end_byte} -= 33 * $current_disk->{sector_size};
-
- } elsif ($FAI::configs{$config}{disklabel} eq "gpt-bios") {
-- # the MBR requires space, too
-- $next_start = $current_disk->{sector_size};
-- # not too sure whether this is needed: standard GPT partition table space
-- $next_start += 33 * $current_disk->{sector_size};
--
- # apparently parted insists in having some space left at the end too
- # modify the disk to claim the space for the second partition table
- $current_disk->{end_byte} -= 33 * $current_disk->{sector_size};
Deleted: branches/experimental/patches/setup-storage_gpt-100-bugfix
===================================================================
--- branches/experimental/patches/setup-storage_gpt-100-bugfix 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_gpt-100-bugfix 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,27 +0,0 @@
-2011-06-29 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Sizes.pm: Use (virtual) end of disk for 100% size computation
- instead of disk size to fix 100%-on-gpt configuration issue
- (closes: #619136).
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -460,7 +460,7 @@
- $next_start;
-
- if (1 == $part_id) {
-- $max_avail = $current_disk->{size} - $next_start;
-+ $max_avail = $current_disk->{end_byte} + 1 - $next_start;
- $max_avail = "${max_avail}B";
- }
- my ($start, $end) = &FAI::make_range($part->{size}->{range}, $max_avail);
-@@ -671,7 +671,7 @@
- }
-
- # the size of a 100% partition (the 100% available to the user)
-- my $max_avail = $current_disk->{size} - $next_start;
-+ my $max_avail = $current_disk->{end_byte} + 1 - $next_start;
- # expressed in bytes
- $max_avail = "${max_avail}B";
-
Deleted: branches/experimental/patches/setup-storage_keep-flags
===================================================================
--- branches/experimental/patches/setup-storage_keep-flags 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_keep-flags 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,170 +0,0 @@
-2011-10-22 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/{Volumes.pm,Commands.pm}: retain partition flags of preserved
- partitions.
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -165,14 +165,14 @@
-
- ################################################################################
- #
--# @brief Set the partition type $t on a device $d. This is a no-op if $d is not
-+# @brief Set the partition flag $t on a device $d. This is a no-op if $d is not
- # a physical device
- #
- # @param $d Device name
--# @param $t Type (e.g., lvm or raid)
-+# @param $t Flag (e.g., lvm or raid)
- #
- ################################################################################
--sub set_partition_type_on_phys_dev {
-+sub set_partition_flag_on_phys_dev {
-
- my ($d, $t) = @_;
- my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($d);
-@@ -185,12 +185,12 @@
- (defined($FAI::configs{"PHY_$disk"}) && $FAI::configs{"PHY_$disk"}{virtual}));
- my $pre = "exist_$d";
- $pre .= ",cleared2_$disk" if (defined($FAI::configs{"PHY_$disk"}));
-- &FAI::push_command( "parted -s $disk set $part_no $t on", $pre, "type_${t}_$d" );
-+ &FAI::push_command( "parted -s $disk set $part_no $t on", $pre, "flag_${t}_$d" );
- if (defined($FAI::partition_table_deps{$disk}) &&
- $FAI::partition_table_deps{$disk} ne "") {
-- $FAI::partition_table_deps{$disk} .= ",type_${t}_$d";
-+ $FAI::partition_table_deps{$disk} .= ",flag_${t}_$d";
- } else {
-- $FAI::partition_table_deps{$disk} = "type_${t}_$d";
-+ $FAI::partition_table_deps{$disk} = "flag_${t}_$d";
- }
- return 1;
- }
-@@ -349,7 +349,7 @@
- $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")) {
-+ } elsif (&FAI::set_partition_flag_on_phys_dev($d, "raid")) {
- $pre_req .= defined($FAI::configs{"PHY_$disk"}) ?
- ",pt_complete_$disk" :
- ",exist_$d";
-@@ -432,7 +432,7 @@
- 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") &&
-+ if (&FAI::set_partition_flag_on_phys_dev($d, "lvm") &&
- defined($FAI::configs{"PHY_$disk"}));
-
- &FAI::push_command( "pvcreate -ff -y $pv_create_options $d",
-@@ -484,7 +484,7 @@
- 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") &&
-+ if (&FAI::set_partition_flag_on_phys_dev($dev, "lvm") &&
- defined($FAI::configs{"PHY_$disk"}));
-
- &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
-@@ -1169,30 +1169,25 @@
- $cmd = "losetup -o $start $dn $disk" if ((&FAI::loopback_dev($disk))[0]);
- &FAI::push_command($cmd, "prep2_$dn", "exist_$dn");
-
-+ # (re-)set all flags
-+ my $flags = "";
-+ $flags = $FAI::current_config{$disk}{partitions}{$mapped_id}{flags}
-+ if ($part->{size}->{preserve} || $part->{size}->{resize});
-+ # set the bootable flag, if requested at all
-+ $flags .= ",boot" if($FAI::configs{$config}{bootable} == $part_id);
-+ # set the bios_grub flag on BIOS compatible GPT tables
-+ $flags .= ",bios_grub" if($FAI::configs{$config}{disklabel} eq "gpt-bios"
-+ && $FAI::configs{$config}{gpt_bios_part} == $part_id);
-+ $flags =~ s/^,//;
-+ &FAI::set_partition_flag_on_phys_dev($dn, $_)
-+ foreach (split(',', $flags));
-+
- $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);
--
-- # set the bootable flag, if requested at all
-- if ($FAI::configs{$config}{bootable} > -1) {
-- &FAI::push_command( "parted -s $disk set " .
-- $FAI::configs{$config}{bootable} . " boot on", "exist_" .
-- &FAI::make_device_name($disk, $FAI::configs{$config}{bootable}),
-- "boot_set_$disk" );
-- $FAI::partition_table_deps{$disk} .= ",boot_set_$disk";
-- }
--
-- # set the bios_grub flag on BIOS compatible GPT tables
-- if ($FAI::configs{$config}{disklabel} eq "gpt-bios") {
-- &FAI::push_command( "parted -s $disk set " .
-- $FAI::configs{$config}{gpt_bios_part} . " bios_grub on", "exist_" .
-- &FAI::make_device_name($disk, $FAI::configs{$config}{gpt_bios_part}),
-- "bios_grub_set_$disk" );
-- $FAI::partition_table_deps{$disk} .= ",bios_grub_set_$disk";
-- }
- }
-
-
-@@ -1293,6 +1288,10 @@
-
- # build a parted command to create the partition
- &FAI::execute_command("parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B");
-+
-+ # re-set all flags
-+ &FAI::execute_command("parted -s $disk set $part_id $_ on")
-+ foreach (split(',', $curr_part->{flags}));
- }
- warn "Partition table of disk $disk has been restored\n";
- }
-Index: trunk/lib/setup-storage/Volumes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Volumes.pm
-+++ trunk/lib/setup-storage/Volumes.pm
-@@ -249,6 +249,11 @@
- };
- $col_start += $col_width;
- }
-+
-+ defined ($cols{"Flags"}{"start"})
-+ or &FAI::internal_error("Column Flags not found in parted output");
-+ ($col_start == $cols{"Flags"}{"start"} + $cols{"Flags"}{"length"})
-+ or &FAI::internal_error("Flags column is not last");
- } else { # one of the partitions
-
- # we must have seen the header, otherwise probably the format has
-@@ -264,6 +269,9 @@
- my $fs_cols_before = $cols{"File system"}{"start"};
- my $fs_col_width = $cols{"File system"}{"length"};
-
-+ # the info for the flags column
-+ my $flags_cols_before = $cols{"Flags"}{"start"};
-+
- # get the partition number, if any
- $line =~ /^.{$num_cols_before}(.{$num_col_width})/;
- my $id = $1;
-@@ -290,6 +298,19 @@
-
- # store the information in the hash
- $FAI::current_config{$disk}{partitions}{$id}{filesystem} = $fs;
-+
-+ # extract the file system information
-+ my $flags = "";
-+ if (length ($line) > $flags_cols_before) {
-+ $line =~ /^.{$flags_cols_before}(.+)$/;
-+ $flags = $1;
-+ }
-+
-+ # remove any space
-+ $flags =~ s/\s//g;
-+
-+ # store the information in the hash
-+ $FAI::current_config{$disk}{partitions}{$id}{flags} = $flags;
- }
- }
-
Deleted: branches/experimental/patches/setup-storage_loopback-support
===================================================================
--- branches/experimental/patches/setup-storage_loopback-support 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_loopback-support 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,127 +0,0 @@
-2011-06-05 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: setup loopback devices when working on
- /dev/loop*.
- * setup-storage/Init.pm: explicit handling of /dev/loop*.
- * setup-storage/Parser.pm: check for losetup being available in case
- /dev/loop* is used.
- * setup-storage/Volumes.pm: support x.ykB as sector size when printed by
- parted.
-Index: trunk/lib/setup-storage/Init.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Init.pm
-+++ trunk/lib/setup-storage/Init.pm
-@@ -197,6 +197,22 @@
-
- ################################################################################
- #
-+# @brief Test whether device is a loopback device and, if so, extract the
-+# numeric device id
-+#
-+# @param $dev Device name of disk
-+#
-+# @return 1, iff it is a loopback device, and device id as second item
-+#
-+################################################################################
-+sub loopback_dev {
-+ my ($dev) = @_;
-+ return (1, $1) if ($dev =~ m{^/dev/loop(\d+)$});
-+ return (0, -1);
-+}
-+
-+################################################################################
-+#
- # @brief Check, whether $dev is a physical device, and extract sub-parts
- #
- # @param $dev Device string
-@@ -218,6 +234,11 @@
- defined($2) or return (1, "/dev/$1", -1);
- return (1, "/dev/$1", $3);
- }
-+ elsif ((&FAI::loopback_dev($dev))[0])
-+ {
-+ # we can't tell whether this is a disk of its own or a partition
-+ return (1, $dev, -1);
-+ }
- return (0, "", -2);
- }
-
-@@ -293,6 +314,11 @@
- my ($dev, $p) = @_;
- $dev .= "p" if ($dev =~
- m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d|etherd/e\d+\.\d+)$});
-+ if ((&FAI::loopback_dev($dev))[0])
-+ {
-+ $p += (&FAI::loopback_dev($dev))[1];
-+ $dev = "/dev/loop"
-+ }
- $dev .= $p;
- internal_error("Invalid device $dev") unless (&FAI::phys_dev($dev))[0];
- return $dev;
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -917,12 +917,16 @@
- $part_nr++;
- $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
-
-- my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
-- $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
-- $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
- # build a parted command to create the partition
-+ my $dn = &FAI::make_device_name($disk, $part_nr);
- &FAI::push_command( "parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B",
-- "cleared1_$disk", $post );
-+ "cleared1_$disk", "prep1_$dn" );
-+ my $post = "exist_$dn";
-+ $post .= ",rebuilt_$dn" if
-+ $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
-+ my $cmd = "true";
-+ $cmd = "losetup -o $start $dn $disk" if ((&FAI::loopback_dev($disk))[0]);
-+ &FAI::push_command($cmd, "prep1_$dn", $post);
- }
- }
-
-@@ -1131,8 +1135,13 @@
- 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
-+ my $dn = &FAI::make_device_name($disk, $part_id);
- &FAI::push_command( "parted -s $disk mkpart $part_type \"$fs\" ${start}B ${end}B",
-- $pre, "exist_" . &FAI::make_device_name($disk, $part_id) );
-+ $pre, "prep2_$dn");
-+ my $cmd = "true";
-+ $cmd = "losetup -o $start $dn $disk" if ((&FAI::loopback_dev($disk))[0]);
-+ &FAI::push_command($cmd, "prep2_$dn", "exist_$dn");
-+
- $prev_id = $part_id;
- }
-
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -123,6 +123,9 @@
-
- $disk = &FAI::resolve_disk_shortname($disk);
-
-+ &FAI::in_path("losetup") or die "losetup not found in PATH\n"
-+ if ((&FAI::loopback_dev($disk))[0]);
-+
- # prepend PHY_
- $FAI::device = "PHY_$disk";
-
-Index: trunk/lib/setup-storage/Volumes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Volumes.pm
-+++ trunk/lib/setup-storage/Volumes.pm
-@@ -348,7 +348,7 @@
- # find the BIOS geometry that looks like this:
- # BIOS cylinder,head,sector geometry: 10011,255,63. Each cylinder is 8225kB.
- if ($line =~
-- /^BIOS cylinder,head,sector geometry:\s*(\d+),(\d+),(\d+)\.\s*Each cylinder is \d+kB\.$/) {
-+ /^BIOS cylinder,head,sector geometry:\s*(\d+),(\d+),(\d+)\.\s*Each cylinder is \d+(\.\d+)?kB\.$/) {
- $FAI::current_config{$disk}{bios_cylinders} = $1;
- $FAI::current_config{$disk}{bios_heads} = $2;
- $FAI::current_config{$disk}{bios_sectors_per_track} = $3;
Deleted: branches/experimental/patches/setup-storage_more-verbose-parser
===================================================================
--- branches/experimental/patches/setup-storage_more-verbose-parser 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_more-verbose-parser 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,26 +0,0 @@
-2011-04-18 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Parser.pm: Clarified error message in case of invalid string X
- in disklabel:X.
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -650,12 +650,15 @@
- }
- $FAI::configs{$FAI::device}{preserveparts} = 1;
- }
-- | /^disklabel:(msdos|gpt-bios|gpt)/
-+ | /^disklabel:(\S+)/
- {
-+ my $dl = $1;
-+ ($dl =~ /^(msdos|gpt-bios|gpt)$/) or die
-+ "Invalid disk label $dl; use one of msdos|gpt-bios|gpt\n";
- # set the disk label - actually not only the above, but all types
- # supported by parted could be allowed, but others are not implemented
- # yet
-- $FAI::configs{$FAI::device}{disklabel} = $1;
-+ $FAI::configs{$FAI::device}{disklabel} = $dl;
- }
- | /^bootable:(\d+)/
- {
Deleted: branches/experimental/patches/setup-storage_path-logdir-diskinfo-opts
===================================================================
--- branches/experimental/patches/setup-storage_path-logdir-diskinfo-opts 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_path-logdir-diskinfo-opts 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,152 +0,0 @@
-2011-10-22 Michael Tautschnig <mt at debian.org>
-
- * setup-storage: Added new options -D <disks>, -L <logdir> to override
- disklist/LOGDIR variable values. Updated man-page accordingly.
- * setup-storage: Use disk-info, fai-vol_id with full path.
-Index: trunk/bin/setup-storage
-===================================================================
---- trunk.orig/bin/setup-storage
-+++ trunk/bin/setup-storage
-@@ -59,8 +59,8 @@
- use Getopt::Std;
- $main::VERSION = $version;
- $Getopt::Std::STANDARD_HELP_VERSION = 1;
--our ($opt_X, $opt_f, $opt_h, $opt_d, $opt_s); # the variables for getopt
--(&getopts('Xf:hds') && !$opt_h) || die <<EOF;
-+our ($opt_X, $opt_f, $opt_h, $opt_d, $opt_s, $opt_D, $opt_L); # the variables for getopt
-+(&getopts('Xf:hdsD:L:') && !$opt_h) || die <<EOF;
- setup-storage version $version
-
- USAGE: [-X] no test, your harddisks will be formated
-@@ -68,6 +68,8 @@
- [-f<config-filename>] default: parse classes
- [-d] enable debug output (equivalent to debug=1)
- [-s] perform syntax check only and exit
-+ [-D<disks>] override disklist variable by space-separated <disks>
-+ [-L<logdir>] use <logdir> instead of LOGDIR variable
- [-h] print this help message
- EOF
-
-@@ -92,19 +94,21 @@
- $opt_s and $FAI::check_only = 1;
-
- # Find out whether $LOGDIR is usable or default to /tmp/fai
-+$opt_L and $FAI::DATADIR = $opt_L;
- if (! -d $FAI::DATADIR) {
-- defined ($ENV{LOGDIR}) and die
-+ !defined($opt_L) and defined ($ENV{LOGDIR}) and die
- "Environment variable LOGDIR is set, but $FAI::DATADIR is not a directory\n";
- mkdir $FAI::DATADIR or die
- "Failed to create directory $FAI::DATADIR\n";
-- warn "\$LOGDIR not set in environment; created data directory $FAI::DATADIR\n";
-+ warn "Created data directory $FAI::DATADIR\n";
- }
-
- # $disklist may be provided by the environment
- my $disklist = $ENV{disklist};
-+$opt_D and $disklist = $opt_D;
- if (! defined($disklist)) {
-- &FAI::in_path("disk-info") or die "disk-info not found in PATH\n";
-- $disklist = `disk-info | sort`;
-+ &FAI::in_path("/usr/lib/fai/disk-info") or die "/usr/lib/fai/disk-info not found\n";
-+ $disklist = `/usr/lib/fai/disk-info | sort`;
- }
-
- @FAI::disks = split( /[\n ]/, $disklist);
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -64,6 +64,9 @@
- # ignored in syntax-check mode
- return 1 if ($FAI::check_only);
-
-+ # check full path names first
-+ ($cmd =~ /^\//) and return (-x "$cmd");
-+
- # split $PATH into its components, search all of its components
- # and test for $cmd being executable
- (-x "$_/$cmd") and return 1 foreach (split (":", $ENV{PATH}));
-Index: trunk/lib/setup-storage/Fstab.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Fstab.pm
-+++ trunk/lib/setup-storage/Fstab.pm
-@@ -101,8 +101,9 @@
- # or labels, use these if available
- my @uuid = ();
- `$FAI::udev_settle`;
-+ &FAI::in_path("/usr/lib/fai/fai-vol_id") or die "/usr/lib/fai/fai-vol_id not found\n";
- &FAI::execute_ro_command(
-- "fai-vol_id -u $device_name", \@uuid, 0);
-+ "/usr/lib/fai/fai-vol_id -u $device_name", \@uuid, 0);
-
- # every device must have a uuid, otherwise this is an error (unless we
- # are testing only)
-@@ -116,7 +117,7 @@
- my @label = ();
- `$FAI::udev_settle`;
- &FAI::execute_ro_command(
-- "fai-vol_id -l $device_name", \@label, 0);
-+ "/usr/lib/fai/fai-vol_id -l $device_name", \@label, 0);
-
- # print uuid and label to console
- warn "$device_name UUID=$uuid[0]" if @uuid;
-Index: trunk/man/setup-storage.8
-===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8
-@@ -9,6 +9,9 @@
- [\fB\-f\fP \fIfilename\fP]
- [\fB\-d\fP]
- [\fB\-h\fP]
-+[\fB\-s\fP]
-+[\fB\-D\fP \fIdisks\fP]
-+[\fB\-L\fP \fIdirectory\fP]
- .SH DESCRIPTION
- Using FAI disk_config files,
- \fBsetup-storage\fP
-@@ -61,6 +64,20 @@
- .IR debug
- set to a non-zero value. See below for further details.
-
-+.TP
-+\fB\-s\fP
-+Perform syntax check of disk_config file only and exit.
-+
-+.TP
-+\fB\-D\fP \fIdisks\fP
-+Specify the list of disk drives to be configured using
-+\fBsetup-storage\fP. Overrides
-+.IR disklist.
-+
-+.TP
-+\fB\-L\fP \fIdirectory\fP
-+Use the specified directory instead of
-+.IR LOGDIR.
-
- .TP
- \fB\-h\fP
-@@ -70,9 +87,11 @@
- will use the following environment variables:
- .TP
- .B disklist
--The
-+If option
-+\fB\-D\fP
-+is not used, the
- .IR disklist
--variable may contain a newline separated list of disk drives available in the
-+variable may contain a space separated list of disk drives available in the
- system. Their order matters as they may be referred to as disk1, etc. in
- disk_config. If unset, disk-info will be called to determine the list.
- .TP
-@@ -93,6 +112,9 @@
- \fBsetup-storage\fP
- generates disk_var.sh, fstab, and possibly crypttab (see below) in this
- directory. Defaults to /tmp/fai if unset.
-+Option
-+\fB\-L\fP
-+overrides this.
- .TP
- .B flag_initial
- This variable determines if partitions should be preserved when they
Deleted: branches/experimental/patches/setup-storage_preserve-in-place
===================================================================
--- branches/experimental/patches/setup-storage_preserve-in-place 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_preserve-in-place 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,135 +0,0 @@
-2011-04-15 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Parser.pm: Permit :preserve_* after size specification to
- specify preserving a partition in place. Thanks Edgar Fuß for the patch.
- * setup-storage.8: Update grammar.
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -372,6 +372,40 @@
- return $val;
- }
-
-+################################################################################
-+#
-+# @brief Fill the "size" key of a partition or volume entry
-+#
-+# @param $range Actual size
-+# @param $options Additional options such as preserve or resize
-+#
-+################################################################################
-+sub set_volume_size
-+{
-+ my ($range, $options) = @_;
-+
-+ # convert the units, if necessary
-+ my ($min, $max) = split (/-/, $range);
-+ $min .= "MiB" if ($min =~ /\d\s*$/);
-+ $min = &FAI::convert_unit($min);
-+ $max .= "MiB" if ($max =~ /\d\s*$/);
-+ $max = &FAI::convert_unit($max);
-+ # enter the range into the hash
-+ $FAI::partition_pointer->{size}->{range} = "$min-$max";
-+ # set the resize or preserve flag, if required
-+ if (defined ($options)) {
-+ $FAI::configs{$FAI::device}{preserveparts} = 1;
-+ $FAI::partition_pointer->{size}->{resize} = 1 if ($options =~ /^:resize/);
-+ $FAI::partition_pointer->{size}->{preserve} = 1 if ($options =~ /^:preserve_always/);
-+ $FAI::partition_pointer->{size}->{preserve} = 1
-+ if ($FAI::reinstall && $options =~ /^:preserve_reinstall/);
-+ if ($options =~ /^:preserve_lazy/) {
-+ $FAI::configs{$FAI::device}{preserveparts} = 2;
-+ $FAI::partition_pointer->{size}->{preserve} = 2;
-+ }
-+ }
-+}
-+
- # have RecDescent do proper error reporting
- $::RD_HINT = 1;
-
-@@ -862,7 +896,7 @@
- 1;
- }
-
-- size: /^((RAM:\d+%|\d+[kKMGTP%iB]*)(-(RAM:\d+%|\d+[kKMGTP%iB]*)?)?)(:resize)?/
-+ size: /^((RAM:\d+%|\d+[kKMGTP%iB]*)(-(RAM:\d+%|\d+[kKMGTP%iB]*)?)?)(:resize|:preserve_(always|reinstall|lazy))?/
- {
- # complete the size specification to be a range in all cases
- my $range = $1;
-@@ -876,41 +910,14 @@
- {
- # range has no upper limit, assume the whole disk
- $range = "${range}100%";
-- }
--
-- # convert the units, if necessary
-- my ($min, $max) = split (/-/, $range);
-- $min .= "MiB" if ($min =~ /\d\s*$/);
-- $min = &FAI::convert_unit($min);
-- $max .= "MiB" if ($max =~ /\d\s*$/);
-- $max = &FAI::convert_unit($max);
-- $range = "$min-$max";
-- # enter the range into the hash
-- $FAI::partition_pointer->{size}->{range} = $range;
-- # set the resize flag, if required
-- if (defined ($5)) {
-- $FAI::partition_pointer->{size}->{resize} = 1;
-- $FAI::configs{$FAI::device}{preserveparts} = 1;
- }
-+
-+ &FAI::set_volume_size($range, $5);
- }
-- | /^(-(RAM:\d+%|\d+[kKMGTP%iB]*))(:resize)?\s+/
-+ | /^(-(RAM:\d+%|\d+[kKMGTP%iB]*))(:resize|:preserve_(always|reinstall|lazy))?\s+/
- {
- # complete the range by assuming 0 as the lower limit
-- my $range = "0$1";
-- # convert the units, if necessary
-- my ($min, $max) = split (/-/, $range);
-- $min .= "MiB" if ($min =~ /\d\s*$/);
-- $min = &FAI::convert_unit($min);
-- $max .= "MiB" if ($max =~ /\d\s*$/);
-- $max = &FAI::convert_unit($max);
-- $range = "$min-$max";
-- # enter the range into the hash
-- $FAI::partition_pointer->{size}->{range} = $range;
-- # set the resize flag, if required
-- if (defined ($3)) {
-- $FAI::partition_pointer->{size}->{resize} = 1;
-- $FAI::configs{$FAI::device}{preserveparts} = 1;
-- }
-+ &FAI::set_volume_size("0$1", $3);
- }
- | <error: invalid partition size near "$text">
-
-Index: trunk/man/setup-storage.8
-===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8
-@@ -596,13 +596,13 @@
- * multiplier */
-
-
--size ::= <sizespec>(-(<sizespec>)?)?(:resize)?
-+size ::= <sizespec>(-(<sizespec>)?)?(:resize|:preserve_(always|reinstall|lazy))?
- .br
- /* size, possibly given as a range; physical partitions or lvm logical
- .br
- * volumes only */
- .br
-- | -<sizespec>(:resize)?
-+ | -<sizespec>(:resize|:preserve_(always|reinstall|lazy))?
- .br
- /* size given as upper limit; physical partitions or lvm logical
- .br
-@@ -663,7 +663,8 @@
- and bootable. preserve_always is equivalent to the previous preserveX option,
- whereas preserve_reinstall preserves the partition unless "initial" is given as
- one of the FAI_FLAGS. preserve_lazy allows to preserve partitions only if these
--exist already. Otherwise they are created.
-+exist already. Otherwise they are created. Yet, all preserve_* options may also
-+be given with the size specification, as in: 200M:preserve_lazy.
- .IP \(bu
- The "always_format" option overrides preserving filesystems (via one of the
- "preserveX" options), like the "format" option in setup_harddisks.
Deleted: branches/experimental/patches/setup-storage_softraid-assemble-error
===================================================================
--- branches/experimental/patches/setup-storage_softraid-assemble-error 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_softraid-assemble-error 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,23 +0,0 @@
-2011-06-05 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: stop RAID arrays before re-assembling. Thanks
- David Dreezer for testing.
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -292,8 +292,12 @@
- sub build_raid_commands {
-
- # check RAID arrays if there are pre-existing ones
-- &FAI::push_command("mdadm --assemble --scan --config=$FAI::DATADIR/mdadm-from-examine.conf",
-- "", "mdadm_startall_examined") if (scalar(keys %FAI::current_raid_config));
-+ if (scalar(keys %FAI::current_raid_config))
-+ {
-+ &FAI::push_command("mdadm --stop --scan", "", "stop_for_assemble");
-+ &FAI::push_command("mdadm --assemble --scan --config=$FAI::DATADIR/mdadm-from-examine.conf",
-+ "stop_for_assemble", "mdadm_startall_examined");
-+ }
- foreach my $id (keys %FAI::current_raid_config) {
- my $md = "/dev/md$id";
- my $pre_deps_cl = "mdadm_startall_examined";
Deleted: branches/experimental/patches/setup-storage_syntax-check-mode
===================================================================
--- branches/experimental/patches/setup-storage_syntax-check-mode 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_syntax-check-mode 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,97 +0,0 @@
-2011-06-05 Michael Tautschnig <mt at debian.org>
-
- * setup-storage: added option -s to perform syntax check only
- (closes: #627913)
- * setup-storage/{Init.pm,Parser.pm}: ignore several checks if doing syntax
- check only.
-
-Index: trunk/bin/setup-storage
-===================================================================
---- trunk.orig/bin/setup-storage
-+++ trunk/bin/setup-storage
-@@ -59,14 +59,15 @@
- use Getopt::Std;
- $main::VERSION = $version;
- $Getopt::Std::STANDARD_HELP_VERSION = 1;
--our ($opt_X, $opt_f, $opt_h, $opt_d); # the variables for getopt
--(&getopts('Xf:hd') && !$opt_h) || die <<EOF;
-+our ($opt_X, $opt_f, $opt_h, $opt_d, $opt_s); # the variables for getopt
-+(&getopts('Xf:hds') && !$opt_h) || die <<EOF;
- setup-storage version $version
-
- USAGE: [-X] no test, your harddisks will be formated
- default: only test, no real formating
- [-f<config-filename>] default: parse classes
- [-d] enable debug output (equivalent to debug=1)
-+ [-s] perform syntax check only and exit
- [-h] print this help message
- EOF
-
-@@ -87,6 +88,9 @@
- $opt_X and $FAI::no_dry_run = 1;
- warn "setup-storage is running in test-only mode\n" unless ($FAI::no_dry_run);
-
-+# syntactic checks only
-+$opt_s and $FAI::check_only = 1;
-+
- # Find out whether $LOGDIR is usable or default to /tmp/fai
- if (! -d $FAI::DATADIR) {
- defined ($ENV{LOGDIR}) and die
-@@ -137,6 +141,12 @@
- # make sure there are no empty disk_config stanzas
- &FAI::check_config;
-
-+if ($FAI::check_only)
-+{
-+ print "Syntax ok\n";
-+ exit 0;
-+}
-+
- # first find the proper way to tell udev to settle
- $FAI::udev_settle = "udevadm settle --timeout=10" if (&FAI::in_path("udevadm"));
- $FAI::udev_settle = "udevsettle --timeout=10" if (&FAI::in_path("udevsettle"));
-Index: trunk/lib/setup-storage/Init.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Init.pm
-+++ trunk/lib/setup-storage/Init.pm
-@@ -64,6 +64,13 @@
-
- ################################################################################
- #
-+# @brief Perform syntactic checks only if set to 1
-+#
-+################################################################################
-+$FAI::check_only = 0;
-+
-+################################################################################
-+#
- # @brief The command to tell udev to settle (udevsettle or udevadm settle)
- #
- ################################################################################
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -61,6 +61,9 @@
- # initialize the parameter
- my ($cmd) = @_;
-
-+ # ignored in syntax-check mode
-+ return 1 if ($FAI::check_only);
-+
- # split $PATH into its components, search all of its components
- # and test for $cmd being executable
- (-x "$_/$cmd") and return 1 foreach (split (":", $ENV{PATH}));
-@@ -82,9 +85,11 @@
- sub resolve_disk_shortname {
- my ($disk) = @_;
-
-+ $disk = "sdx" . chr(ord('a') + $disk - 1)
-+ if ($FAI::check_only && $disk =~ /^\d+$/);
-+
- # test $disk for being numeric
- if ($disk =~ /^\d+$/) {
--
- # $disk-1 must be a valid index in the map of all disks in the system
- (scalar(@FAI::disks) >= $disk)
- or die "this system does not have a physical disk $disk\n";
Deleted: branches/experimental/patches/setup-storage_udevsettle-before-vol-id
===================================================================
--- branches/experimental/patches/setup-storage_udevsettle-before-vol-id 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_udevsettle-before-vol-id 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,48 +0,0 @@
-2011-06-06 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Fstab.pm: call udevsettle before reading volume id to avoid
- race condition.
- * fai-vol_id: disable use of cache when calling blkid to fix problems when
- file systems are changed.
-Index: trunk/lib/setup-storage/Fstab.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Fstab.pm
-+++ trunk/lib/setup-storage/Fstab.pm
-@@ -100,6 +100,7 @@
- # write the device name as the first entry; if the user prefers uuids
- # or labels, use these if available
- my @uuid = ();
-+ `$FAI::udev_settle`;
- &FAI::execute_ro_command(
- "fai-vol_id -u $device_name", \@uuid, 0);
-
-@@ -113,6 +114,7 @@
- # get the label -- this is likely empty; exit code 3 if no label, but that is
- # ok here
- my @label = ();
-+ `$FAI::udev_settle`;
- &FAI::execute_ro_command(
- "fai-vol_id -l $device_name", \@label, 0);
-
-Index: trunk/lib/fai-vol_id
-===================================================================
---- trunk.orig/lib/fai-vol_id
-+++ trunk/lib/fai-vol_id
-@@ -10,7 +10,7 @@
- get_uuid() {
-
- if [ -z $vol_id ] ; then
-- $blkid -s UUID -o value $1
-+ $blkid -c /dev/null -s UUID -o value $1
- exit $?
- fi
-
-@@ -21,7 +21,7 @@
- get_label() {
-
- if [ -z $vol_id ] ; then
-- $blkid -s LABEL -o value $1
-+ $blkid -c /dev/null -s LABEL -o value $1
- exit $?
- fi
-
Deleted: branches/experimental/patches/setup-storage_virtual-bugfix
===================================================================
--- branches/experimental/patches/setup-storage_virtual-bugfix 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_virtual-bugfix 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,19 +0,0 @@
-2011-04-15 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: Virtual disks don't have partition types.
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -180,8 +180,9 @@
- # make sure this device really exists (we can't check for the partition
- # 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
-- return 0 if ($part_no == -1);
-+ # set the raid/lvm unless this is an entire disk flag or a virtual disk
-+ return 0 if ($part_no == -1 ||
-+ (defined($FAI::configs{"PHY_$disk"}) && $FAI::configs{"PHY_$disk"}{virtual}));
- my $pre = "exist_$d";
- $pre .= ",cleared2_$disk" if (defined($FAI::configs{"PHY_$disk"}));
- &FAI::push_command( "parted -s $disk set $part_no $t on", $pre, "type_${t}_$d" );
Deleted: branches/experimental/patches/setup-storage_wipefs
===================================================================
--- branches/experimental/patches/setup-storage_wipefs 2011-10-22 13:04:43 UTC (rev 6716)
+++ branches/experimental/patches/setup-storage_wipefs 2011-10-22 13:06:00 UTC (rev 6717)
@@ -1,95 +0,0 @@
-2011-08-31 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Commands.pm: Use wipefs to purge RAID and other signatures
- from devices before removing/reusing them.
- * setup-storage.8: Remove now obsolete RAID caveat.
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -664,8 +664,11 @@
- }
- }
-
-- &FAI::push_command( "lvremove -f $vg/$lv",
-+ &FAI::push_command( "wipefs -a $vg/$lv",
- "vgchange_a_n_VG_$vg$pre_deps_cl",
-+ "wipefs_$vg/$lv");
-+ &FAI::push_command( "lvremove -f $vg/$lv",
-+ "wipefs_$vg/$lv",
- "lv_rm_$vg/$lv,self_cleared_/dev/$vg/$lv");
- $vg_setup_pre .= ",lv_rm_$vg/$lv";
- }
-@@ -686,8 +689,11 @@
- join(",self_cleared_", @{ $FAI::current_dev_children{"/dev/$vg/$lv"} })
- if (defined($FAI::current_dev_children{"/dev/$vg/$lv"}) &&
- scalar(@{ $FAI::current_dev_children{"/dev/$vg/$lv"} }));
-- &FAI::push_command( "lvremove -f $vg/$lv",
-+ &FAI::push_command( "wipefs -a $vg/$lv",
- "vgchange_a_n_VG_$vg$pre_deps_cl",
-+ "wipefs_$vg/$lv");
-+ &FAI::push_command( "lvremove -f $vg/$lv",
-+ "wipefs_$vg/$lv",
- "lv_rm_$vg/$lv,self_cleared_/dev/$vg/$lv");
- $vg_destroy_pre .= ",lv_rm_$vg/$lv";
- }
-@@ -697,8 +703,15 @@
- my $devices = "";
- $devices .= " " . &FAI::enc_name($_) foreach
- (@{ $FAI::current_lvm_config{$vg}{physical_volumes} });
-+ ($devices =~ /^\s*$/) and &FAI::internal_error("Empty PV device set");
- $FAI::debug and print "Erased devices:$devices\n";
-- &FAI::push_command( "pvremove $devices", "vg_removed_$vg", "pv_sigs_removed_$vg" );
-+ &FAI::push_command( "pvremove $devices", "vg_removed_$vg", "pvremove_$vg");
-+ my $post_wipe = "pvremove_$vg";
-+ foreach my $d (split (" ", $devices)) {
-+ $post_wipe .= ",pv_sigs_removed_wipe_${d}_$vg";
-+ &FAI::push_command( "wipefs -a $d", "pvremove_$vg", "pv_sigs_removed_wipe_${d}_$vg");
-+ }
-+ &FAI::push_command( "true", $post_wipe, "pv_sigs_removed_$vg" );
- return 1;
- }
-
-@@ -961,7 +974,7 @@
- # A new disk label may only be written if no partitions need to be
- # preserved
- (($label eq $FAI::current_config{$disk}{disklabel})
-- || (scalar (@to_preserve) == 0))
-+ || (scalar (@to_preserve) == 0))
- or die "Can't change disklabel, partitions are to be preserved\n";
-
- # write the disklabel to drop the previous partition table
-@@ -971,6 +984,16 @@
- join(",self_cleared_", @{ $FAI::current_dev_children{$c} })
- if (defined($FAI::current_dev_children{$c}) &&
- scalar(@{ $FAI::current_dev_children{$c} }));
-+ my ($i_p_d, $d, $part_no) = &FAI::phys_dev($c);
-+ ($i_p_d && $d eq $disk) or &FAI::internal_error("Invalid dev children entry");
-+ my $wipe_cmd = "wipefs -a $c";
-+ foreach my $part_id (@to_preserve) {
-+ # get the existing id
-+ my $mapped_id = $FAI::configs{$config}{partitions}{$part_id}{maps_to_existing};
-+ $wipe_cmd = "true" if ($mapped_id == $part_no);
-+ }
-+ &FAI::push_command($wipe_cmd, "exist_$disk$pre_deps", "wipefs_$c");
-+ $pre_deps .= ",wipefs_$c";
- }
- &FAI::push_command( ($needs_resize ? "parted -s $disk mklabel $label" : "true"),
- "exist_$disk$pre_deps", "cleared1_$disk" );
-Index: trunk/man/setup-storage.8
-===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8
-@@ -675,12 +675,6 @@
-
- .SH CAVEATS
- .IP \(bu
--Partition UUID cannot be obtained: In case a partition was previously used as
--part of a software RAID volume and now is intended as swap space, udev fails
--when asked for a UUID. This happens because mkswap does not overwrite the
--previous RAID superblock. You can remove it using mdadm \-\-zero-superblock
--<device>.
--.IP \(bu
- Machine does not boot because not partition is marked as bootable: If the
- bootable option is not specified, not partition will be marked as such. Modern
- BIOSes don't seem to require such markers anymore, but for some systems it may
More information about the Fai-commit
mailing list