[Fai-commit] r5447 - people/michael/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Sun Jul 19 15:35:41 UTC 2009
Author: mt
Date: 2009-07-19 15:35:39 +0000 (Sun, 19 Jul 2009)
New Revision: 5447
Removed:
people/michael/experimental/patches/bugfix-532321
people/michael/experimental/patches/setup-storage_missing-raid-devs
people/michael/experimental/patches/setup-storage_raid-preserve-entry-missing
people/michael/experimental/patches/setup-storage_raid10
Modified:
people/michael/experimental/patches/series
people/michael/experimental/patches/setup-storage_fix-secondary-gpt-size
people/michael/experimental/patches/setup-storage_full-crypto-support
Log:
removed patches that got merged into trunk, refreshed others
Deleted: people/michael/experimental/patches/bugfix-532321
===================================================================
--- people/michael/experimental/patches/bugfix-532321 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/bugfix-532321 2009-07-19 15:35:39 UTC (rev 5447)
@@ -1,43 +0,0 @@
-2009-06-25 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Volumes.pm: Fixed perl syntax error, properly handle existing
- empty volume groups (thanks Brian Kroth and Cajus Pollmeier for debugging
- this). (closes: #532321)
-Index: trunk/lib/setup-storage/Volumes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Volumes.pm
-+++ trunk/lib/setup-storage/Volumes.pm
-@@ -305,23 +305,26 @@
- foreach my $vg (get_volume_group_list()) {
- # initialise the hash entry
- $FAI::current_lvm_config{$vg}{physical_volumes} = ();
-- &FAI::push_command( "true", "", "vg_created_$vg" );
-+ &FAI::push_command("true", "", "vg_created_$vg");
-
- # store the vg size in MB
- my %vg_info = get_volume_group_information($vg);
-- $FAI::current_lvm_config{$vg}{size} =
-- &FAI::convert_unit( $vg_info{alloc_pe_size} .
-- $vg_info{alloc_pe_size_unit} );
-+ if (%vg_info) {
-+ $FAI::current_lvm_config{$vg}{size} = $vg_info{alloc_pe_size} .
-+ $vg_info{alloc_pe_size_unit};
-+ } else {
-+ $FAI::current_lvm_config{$vg}{size} = "0M";
-+ }
-
-- # store the logical volumes and their sizes
-+ # store the logical volumes and their sizes
- my %lv_info = get_logical_volume_information($vg);
- foreach my $lv_name (sort keys %lv_info) {
- my $short_name = $lv_name;
-- $short_name =~ "s{/dev/\Q$vg\E/}{}";
-+ $short_name =~ s{/dev/\Q$vg\E/}{};
- $FAI::current_lvm_config{$vg}{volumes}{$short_name}{size} =
- &FAI::convert_unit($lv_info{$lv_name}->{lv_size} .
- $lv_info{$lv_name}->{lv_size_unit});
-- &FAI::push_command( "true", "", "exist_/dev/$vg/$short_name" );
-+ &FAI::push_command("true", "", "exist_/dev/$vg/$short_name");
- }
-
- # store the physical volumes
Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/series 2009-07-19 15:35:39 UTC (rev 5447)
@@ -7,7 +7,3 @@
bugfix-481871
bugfix-479537
setup-storage_full-crypto-support
-setup-storage_missing-raid-devs
-setup-storage_raid-preserve-entry-missing
-bugfix-532321
-setup-storage_raid10
Modified: people/michael/experimental/patches/setup-storage_fix-secondary-gpt-size
===================================================================
--- people/michael/experimental/patches/setup-storage_fix-secondary-gpt-size 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/setup-storage_fix-secondary-gpt-size 2009-07-19 15:35:39 UTC (rev 5447)
@@ -5,7 +5,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Sizes.pm
+++ trunk/lib/setup-storage/Sizes.pm
-@@ -633,14 +633,14 @@
+@@ -655,14 +655,14 @@
$current_disk->{sector_size};
} elsif ($FAI::configs{$config}{disklabel} eq "gpt") {
@@ -23,7 +23,7 @@
} elsif ($FAI::configs{$config}{disklabel} eq "gpt-bios") {
# on BIOS-style disk labels, the first partitions starts at head #1
-@@ -653,10 +653,10 @@
+@@ -675,10 +675,10 @@
# apparently parted insists in having some space left at the end too
# modify the disk to claim the space for the second partition table
Modified: people/michael/experimental/patches/setup-storage_full-crypto-support
===================================================================
--- people/michael/experimental/patches/setup-storage_full-crypto-support 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/setup-storage_full-crypto-support 2009-07-19 15:35:39 UTC (rev 5447)
@@ -45,7 +45,7 @@
# add entries to crypttab
push @FAI::crypttab, "$enc_dev_short_name\t$device\t$keyfile\tluks";
@@ -203,11 +201,12 @@
- next if $vol->{devices}{$d}{missing};
+ next;
} else {
if ($vol->{devices}->{$d}->{spare}) {
- push @spares, $d;
@@ -91,7 +91,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Fstab.pm
+++ trunk/lib/setup-storage/Fstab.pm
-@@ -160,12 +160,8 @@
+@@ -164,12 +164,8 @@
# skip extended partitions and entries without a mountpoint
next if ($p_ref->{size}->{extended} || $p_ref->{mountpoint} eq "-");
@@ -106,7 +106,7 @@
# if the mount point is / or /boot, the variables should be set, unless
# they are already
-@@ -212,9 +208,7 @@
+@@ -216,9 +212,7 @@
my $device_name = "/dev/$device/$l";
if ($l_ref->{encrypt}) {
@@ -117,7 +117,7 @@
} else {
$device_name = $fstab_key[0];
}
-@@ -244,12 +238,7 @@
+@@ -248,12 +242,7 @@
# skip entries without a mountpoint
next if ($r_ref->{mountpoint} eq "-");
@@ -135,7 +135,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Init.pm
+++ trunk/lib/setup-storage/Init.pm
-@@ -184,6 +184,46 @@
+@@ -183,6 +183,46 @@
return (0, "", -2);
}
Deleted: people/michael/experimental/patches/setup-storage_missing-raid-devs
===================================================================
--- people/michael/experimental/patches/setup-storage_missing-raid-devs 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/setup-storage_missing-raid-devs 2009-07-19 15:35:39 UTC (rev 5447)
@@ -1,173 +0,0 @@
-2009-06-13 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Parser.pm: RAID device parsing: $2 doesn't refer to the
- original expression anymore, store earlier $2 as $opts; don't use options
- sub-hash (thanks Andreas Schockenhoff for lots of testing and feedback).
- * setup-storage/Sizes.pm: Properly deal with missing (as in RAID specs) or
- non-existing (user error) devices in estimate_size; don't do stupid divide
- by 2 in RAID1 setup. (closes: #525138)
- * setup-storage/Commands.pm: Proper use of hash reference when checking for
- "missing" option.
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -470,6 +470,9 @@
- $FAI::configs{RAID}{volumes}{$vol_id}{mode} = $1;
- # initialise the hash of devices
- $FAI::configs{RAID}{volumes}{$vol_id}{devices} = {};
-+ # initialise the preserve flag
-+ defined($FAI::configs{RAID}{volumes}{$vol_id}{preserve}) or
-+ $FAI::configs{RAID}{volumes}{$vol_id}{preserve} = 0;
- # set the reference to the current volume
- # the reference is used by all further processing of this config line
- $FAI::partition_pointer = (\%FAI::configs)->{RAID}->{volumes}->{$vol_id};
-@@ -606,6 +609,8 @@
- &FAI::internal_error("PARSER ERROR");
- # redefine the device string
- $dev = $1;
-+ # store the options
-+ my $opts = $2;
- # make $dev a full path name; can't validate device name yet as it
- # might be created later on
- unless ($dev =~ m{^/}) {
-@@ -618,14 +623,14 @@
- my @candidates = glob($dev);
-
- # options are only valid for RAID
-- defined ($2) and ($FAI::device ne "RAID") and die "Option $2 invalid in a non-RAID context\n";
-+ defined ($opts) and ($FAI::device ne "RAID") and die "Option $opts invalid in a non-RAID context\n";
- if ($FAI::device eq "RAID") {
- # parse all options
- my $spare = 0;
- my $missing = 0;
-- if (defined ($2)) {
-- ($2 =~ /spare/) and $spare = 1;
-- ($2 =~ /missing/) and $missing = 1;
-+ if (defined ($opts)) {
-+ ($opts =~ /spare/) and $spare = 1;
-+ ($opts =~ /missing/) and $missing = 1;
- }
- (($spare == 1 || $missing == 1) && $FAI::partition_pointer->{mode} == 0)
- and die "RAID-0 does not support spares or missing devices\n";
-@@ -640,7 +645,7 @@
- defined ($FAI::partition_pointer->{devices}->{$dev}) and
- die "$dev is already part of the RAID volume\n";
- # set the options
-- $FAI::partition_pointer->{devices}->{$dev}->{options} = {
-+ $FAI::partition_pointer->{devices}->{$dev} = {
- "spare" => $spare,
- "missing" => $missing
- };
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -99,8 +99,9 @@
- # this should be caught later on
- my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
- if (1 == $i_p_d && -1 == $part_no) {
-- defined ($FAI::current_config{$dev}{end_byte})
-- or die "$dev is not a valid block device\n";
-+ (defined ($FAI::current_config{$dev}) &&
-+ defined ($FAI::current_config{$dev}{end_byte}))
-+ or die "$dev is not a valid block device\n";
-
- # the size is known, return it
- return ($FAI::current_config{$dev}{end_byte} -
-@@ -110,14 +111,16 @@
- # try a partition
- elsif (1 == $i_p_d && $part_no > -1) {
- # the size is configured, return it
-- defined ($FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size})
-- and return $FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size} /
-- (1024 * 1024);
-+ defined ($FAI::configs{"PHY_$disk"}) and
-+ defined ($FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size})
-+ and return $FAI::configs{"PHY_$disk"}{partitions}{$part_no}{size}{eff_size} /
-+ (1024 * 1024);
-
- # the size is known from the current configuration on disk, return it
-- defined ($FAI::current_config{$disk}{partitions}{$part_no}{count_byte})
-- and return $FAI::current_config{$disk}{partitions}{$part_no}{count_byte} /
-- (1024 * 1024) unless defined ($FAI::configs{"PHY_$disk"}{partitions});
-+ defined ($FAI::current_config{$disk}) and
-+ defined ($FAI::current_config{$disk}{partitions}{$part_no}{count_byte})
-+ and return $FAI::current_config{$disk}{partitions}{$part_no}{count_byte} /
-+ (1024 * 1024) unless defined ($FAI::configs{"PHY_$disk"}{partitions});
-
- # the size is not known (yet?)
- warn "Cannot determine size of $dev\n";
-@@ -133,23 +136,34 @@
- # the raid level, like raid0, raid5, linear, etc.
- my $level = "";
-
-+ # the number of devices in the volume
-+ my $dev_count = 0;
-+
- # let's see, whether there is a configuration of this volume
-- if (defined ($FAI::configs{RAID}{volumes}{$1}{devices})) {
-- @devs = keys %{ $FAI::configs{RAID}{volumes}{$1}{devices} };
-+ if (defined ($FAI::configs{RAID}{volumes}{$1})) {
-+ my @devcands = keys %{ $FAI::configs{RAID}{volumes}{$1}{devices} };
-+ $dev_count = scalar(@devcands);
-+ # we can only estimate the sizes of existing volumes, assume the missing
-+ # ones aren't smaller
-+ foreach (@devcands) {
-+ next if ($FAI::configs{RAID}{volumes}{$1}{devices}{$_}{missing});
-+ push @devs, $_;
-+ }
- $level = $FAI::configs{RAID}{volumes}{$1}{mode};
-- } elsif (defined ($FAI::current_raid_config{$1}{devices})) {
-+ } elsif (defined ($FAI::current_raid_config{$1})) {
- @devs = $FAI::current_raid_config{$1}{devices};
-+ $dev_count = scalar(@devs);
- $level = $FAI::current_raid_config{$1}{mode};
- } else {
- die "$dev is not a known RAID device\n";
- }
-
-+ # make sure there is at least one non-missing device
-+ (scalar(@devs) > 0) or die "No devices available in /dev/md$1\n";
-+
- # prepend "raid", if the mode is numeric-only
- $level = "raid$level" if ($level =~ /^\d+$/);
-
-- # the number of devices in the volume
-- my $dev_count = scalar (@devs);
--
- # now do the mode-specific size estimations
- if ($level =~ /^raid[015]$/) {
- my $min_size = &estimate_size(shift @devs);
-@@ -158,9 +172,8 @@
- $min_size = $s if ($s < $min_size);
- }
-
-- return $min_size * POSIX::floor($dev_count / 2)
-- if ($level eq "raid1");
- return $min_size * $dev_count if ($level eq "raid0");
-+ return $min_size if ($level eq "raid1");
- return $min_size * ($dev_count - 1) if ($level eq "raid5");
- } else {
-
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -191,14 +191,14 @@
-
- # set proper partition types for RAID
- foreach my $d (@devs) {
-- if ($vol->{devices}{$d}{missing}) {
-+ if ($vol->{devices}->{$d}->{missing}) {
- if ($vol->{devices}->{$d}->{spare}) {
- push @spares, "missing";
- } else {
- push @eff_devs, "missing";
- }
- # skip devices marked missing
-- next if $vol->{devices}{$d}{missing};
-+ next;
- } else {
- if ($vol->{devices}->{$d}->{spare}) {
- push @spares, &FAI::enc_name($d);
Deleted: people/michael/experimental/patches/setup-storage_raid-preserve-entry-missing
===================================================================
--- people/michael/experimental/patches/setup-storage_raid-preserve-entry-missing 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/setup-storage_raid-preserve-entry-missing 2009-07-19 15:35:39 UTC (rev 5447)
@@ -1,21 +0,0 @@
-2009-04-28 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Parser.pm: Ensure that RAID volumes marked preserve don't
- count as extra RAID volumes being defined.
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -465,7 +465,11 @@
- # initialise RAID entry, if it doesn't exist already
- defined ($FAI::configs{RAID}) or $FAI::configs{RAID}{volumes} = {};
- # compute the next available index - the size of the entry
-- my $vol_id = scalar (keys %{ $FAI::configs{RAID}{volumes} });
-+ my $vol_id = 0;
-+ foreach my $ex_vol_id (&FAI::numsort(keys %{ $FAI::configs{RAID}{volumes} })) {
-+ defined ($FAI::configs{RAID}{volumes}{$ex_vol_id}{mode}) or last;
-+ $vol_id++;
-+ }
- # set the RAID type of this volume
- $FAI::configs{RAID}{volumes}{$vol_id}{mode} = $1;
- # initialise the hash of devices
Deleted: people/michael/experimental/patches/setup-storage_raid10
===================================================================
--- people/michael/experimental/patches/setup-storage_raid10 2009-07-19 15:34:03 UTC (rev 5446)
+++ people/michael/experimental/patches/setup-storage_raid10 2009-07-19 15:35:39 UTC (rev 5447)
@@ -1,47 +0,0 @@
-2009-06-13 Michael Tautschnig <mt at debian.org>
-
- * setup-storage/Parser.pm, setup-storage/Sizes.pm: Added support for raid10
- (thanks William Francis for suggesting this).
-Index: trunk/lib/setup-storage/Parser.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Parser.pm
-+++ trunk/lib/setup-storage/Parser.pm
-@@ -458,7 +458,7 @@
- }
-
- volume: /^vg\s+/ name devices vgcreateopt(s?)
-- | /^raid([0156])\s+/
-+ | /^raid([0156]|10)\s+/
- {
- # make sure that this is a RAID configuration
- ($FAI::device eq "RAID") or die "RAID entry invalid in this context\n";
-Index: trunk/lib/setup-storage/Sizes.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Sizes.pm
-+++ trunk/lib/setup-storage/Sizes.pm
-@@ -146,6 +146,7 @@
- # we can only estimate the sizes of existing volumes, assume the missing
- # ones aren't smaller
- foreach (@devcands) {
-+ $dev_count-- if ($FAI::configs{RAID}{volumes}{$1}{devices}{$_}{spare});
- next if ($FAI::configs{RAID}{volumes}{$1}{devices}{$_}{missing});
- push @devs, $_;
- }
-@@ -165,7 +166,7 @@
- $level = "raid$level" if ($level =~ /^\d+$/);
-
- # now do the mode-specific size estimations
-- if ($level =~ /^raid[015]$/) {
-+ if ($level =~ /^raid([0156]|10)$/) {
- my $min_size = &estimate_size(shift @devs);
- foreach (@devs) {
- my $s = &FAI::estimate_size($_);
-@@ -175,6 +176,8 @@
- return $min_size * $dev_count if ($level eq "raid0");
- return $min_size if ($level eq "raid1");
- return $min_size * ($dev_count - 1) if ($level eq "raid5");
-+ return $min_size * ($dev_count - 2) if ($level eq "raid6");
-+ return $min_size * ($dev_count/2) if ($level eq "raid10");
- } else {
-
- # probably some more should be implemented
More information about the Fai-commit
mailing list