diff mbox

[OSSTEST,v2,10/19] ts-debian-fixup: use correct resume device

Message ID 20171031135203.11537-11-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu Oct. 31, 2017, 1:51 p.m. UTC
See code comment for explanation.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 ts-debian-fixup | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox

Patch

diff --git a/ts-debian-fixup b/ts-debian-fixup
index 288766d..9a63c61 100755
--- a/ts-debian-fixup
+++ b/ts-debian-fixup
@@ -175,6 +175,18 @@  sub otherfixupcfg () {
         $extra .= " iommu=soft";
     }
 
+    # There might be stale entries in /etc/initramfs-tools/conf.d/resume which
+    # get stored in the initramfs. That introduces delay in guest booting which
+    # might cause tests to fail.
+    #
+    # This is particularly prominent in stretch when it tries to scan for the
+    # inexistent device(s) for a long time. See also Debian bug #784810.
+    #
+    # Override that in kernel command line with the correct swap partition.
+    $cfg =~ m/'phy:.+-swap,(xvda\d+),.*'/;
+    $extra .= " resume=/dev/$1";
+    logm("change resume device to $1");
+
     $cfg =~ s/^extra\s*=\s*['"](.*)['"]/extra = '$1 $extra'/mg;
 };