[Fai-commit] r5439 - in trunk: bin debian lib/setup-storage

Michael Tautschnig mt at alioth.debian.org
Sun Jul 19 14:49:42 UTC 2009


Author: mt
Date: 2009-07-19 14:49:39 +0000 (Sun, 19 Jul 2009)
New Revision: 5439

Modified:
   trunk/bin/setup-storage
   trunk/debian/changelog
   trunk/lib/setup-storage/Exec.pm
   trunk/lib/setup-storage/Init.pm
Log:
moved setup-storage_udevsettle into trunk


Modified: trunk/bin/setup-storage
===================================================================
--- trunk/bin/setup-storage	2009-07-19 14:39:42 UTC (rev 5438)
+++ trunk/bin/setup-storage	2009-07-19 14:49:39 UTC (rev 5439)
@@ -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

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-07-19 14:39:42 UTC (rev 5438)
+++ trunk/debian/changelog	2009-07-19 14:49:39 UTC (rev 5439)
@@ -23,6 +23,9 @@
   [ Michael Tautschnig ]
   * setup-storage/Parser.pm: Set the boot flag on partition mounted at /, if
     bootable is not explicitly set.
+  * setup-storage, setup-storage/Exec.pm: 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)
   
  -- Thomas Lange <lange at debian.org>  Sun, 19 Jul 2009 12:08:02 +0200
 

Modified: trunk/lib/setup-storage/Exec.pm
===================================================================
--- trunk/lib/setup-storage/Exec.pm	2009-07-19 14:39:42 UTC (rev 5438)
+++ trunk/lib/setup-storage/Exec.pm	2009-07-19 14:49:39 UTC (rev 5439)
@@ -246,7 +246,8 @@
 ################################################################################
 sub execute_with_udevsettle {
   my ($command, $stdout, $stderr) = @_;
-  return &execute_command("udevsettle --timeout=10 && $command", $stdout,
+  defined ($FAI::udev_settle) or &FAI::internal_error("udev settle command not defined");
+  return &execute_command("$FAI::udev_settle && $command", $stdout,
     $stderr);
 }
 

Modified: trunk/lib/setup-storage/Init.pm
===================================================================
--- trunk/lib/setup-storage/Init.pm	2009-07-19 14:39:42 UTC (rev 5438)
+++ trunk/lib/setup-storage/Init.pm	2009-07-19 14:49:39 UTC (rev 5439)
@@ -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