[Fai-commit] r5417 - people/michael/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Sat Jun 13 14:42:02 UTC 2009
Author: mt
Date: 2009-06-13 14:42:00 +0000 (Sat, 13 Jun 2009)
New Revision: 5417
Added:
people/michael/experimental/patches/setup-storage_udevsettle
Modified:
people/michael/experimental/patches/bugfix-515704
people/michael/experimental/patches/series
people/michael/experimental/patches/setup-storage_missing-raid-devs
Log:
- improved patches for fai-savelog, setup-storage+RAID
- added patch to solve sid's udevsettle problem
Modified: people/michael/experimental/patches/bugfix-515704
===================================================================
--- people/michael/experimental/patches/bugfix-515704 2009-06-10 11:39:51 UTC (rev 5416)
+++ people/michael/experimental/patches/bugfix-515704 2009-06-13 14:42:00 UTC (rev 5417)
@@ -1,7 +1,8 @@
-2009-04-16 Michael Tautschnig <mt at debian.org>
+2009-06-13 Michael Tautschnig <mt at debian.org>
* fai-savelog: Fixed cd to wrong dir when $LOGREMOTEDIR was set (thanks Robin
- Powell for the patch) (closes: #515704)
+ Powell for the patch and Jens Rosenboom for another bugfix)
+ (closes: #515704)
Index: trunk/lib/fai-savelog
===================================================================
--- trunk.orig/lib/fai-savelog
@@ -14,10 +15,10 @@
+ local thislogdir
if [ -n "$LOGREMOTEDIR" ];then
- thislog=$LOGREMOTEDIR/$HOSTNAME/$FAI_ACTION-$fai_rundate
-+ thislog=$LOGREMOTEDIR/$HOSTNAME
++ thislogdir=$LOGREMOTEDIR/$HOSTNAME
else
- thislog=$HOSTNAME/$FAI_ACTION-$fai_rundate
-+ thislog=$HOSTNAME
++ thislogdir=$HOSTNAME
fi
+ local thislog
Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series 2009-06-10 11:39:51 UTC (rev 5416)
+++ people/michael/experimental/patches/series 2009-06-13 14:42:00 UTC (rev 5417)
@@ -12,3 +12,4 @@
setup-storage_missing-raid-devs
bugfix-515704
setup-storage_raid-preserve-entry-missing
+setup-storage_udevsettle
Modified: people/michael/experimental/patches/setup-storage_missing-raid-devs
===================================================================
--- people/michael/experimental/patches/setup-storage_missing-raid-devs 2009-06-10 11:39:51 UTC (rev 5416)
+++ people/michael/experimental/patches/setup-storage_missing-raid-devs 2009-06-13 14:42:00 UTC (rev 5417)
@@ -1,10 +1,13 @@
-2009-04-28 Michael Tautschnig <mt at debian.org>
+2009-06-13 Michael Tautschnig <mt at debian.org>
- * setup-storage/Parser.pm: $2 doesn't refer to the original expression
- anymore, store earlier $2 as $opts.
+ * 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
@@ -47,6 +50,15 @@
}
(($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
@@ -102,7 +114,7 @@
+ # 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}{$_}{options}{missing});
++ next if ($FAI::configs{RAID}{volumes}{$1}{devices}{$_}{missing});
+ push @devs, $_;
+ }
$level = $FAI::configs{RAID}{volumes}{$1}{mode};
@@ -138,3 +150,24 @@
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);
Added: people/michael/experimental/patches/setup-storage_udevsettle
===================================================================
--- people/michael/experimental/patches/setup-storage_udevsettle (rev 0)
+++ people/michael/experimental/patches/setup-storage_udevsettle 2009-06-13 14:42:00 UTC (rev 5417)
@@ -0,0 +1,44 @@
+2009-06-13 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage: auto-detect a proper way to tell udev to settle (udevsettle
+ is used in etch, udevadm settle for sid; thanks
+ matrix.systems at matrix.msu.edu for a first patch). (closes: #530656)
+Index: trunk/bin/setup-storage
+===================================================================
+--- trunk.orig/bin/setup-storage
++++ trunk/bin/setup-storage
+@@ -177,11 +177,15 @@
+ }
+
+ # run the commands (if $FAI::no_dry_run is set)
++# 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"));
++defined($FAI::udev_settle) or die "Failed to find determine a proper way to tell udev to settle; is udev installed?";
+ &FAI::execute_with_udevsettle($FAI::commands{$_}{cmd}) foreach (&numsort(keys %FAI::commands));
+
+ # generate the proposed fstab contents
+ # wait for udev to set up all devices
+-`udevsettle --timeout=10`;
++&FAI::execute_with_udevsettle("true");
+ my @fstab = &FAI::generate_fstab(\%FAI::configs);
+
+ # print fstab
+Index: trunk/lib/setup-storage/Init.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Init.pm
++++ trunk/lib/setup-storage/Init.pm
+@@ -48,6 +48,13 @@
+
+ ################################################################################
+ #
++# @brief The command to tell udev to settle (udevsettle or udevadm settle)
++#
++################################################################################
++$FAI::udev_settle = undef;
++
++################################################################################
++#
+ # @brief The lists of disks of the system
+ #
+ ################################################################################
More information about the Fai-commit
mailing list