summary refs log tree commit diff
path: root/modules/testing/test-instrumentation.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-29 21:01:36 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-29 21:10:00 +0100
commit1a82024dd868970143a85e3148d3504dfd8dce61 (patch)
tree86b36e89abfe87d051444026d647a5b7427bac50 /modules/testing/test-instrumentation.nix
parent47648483141c16efb9887d8af27871cee20d25ad (diff)
downloadnixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar.gz
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar.bz2
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar.lz
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar.xz
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.tar.zst
nixpkgs-1a82024dd868970143a85e3148d3504dfd8dce61.zip
In the tests, don't start agetty on /dev/ttyS0
Running agetty on ttyS0 interferes with the backdoor, which uses ttyS0
as its standard error.  After agetty starts, writes to the stderr file
descriptor will return EIO (though doing "exec 2>/proc/self/fd/2" will
miracuously fix this).

http://hydra.nixos.org/build/3252782
Diffstat (limited to 'modules/testing/test-instrumentation.nix')
-rw-r--r--modules/testing/test-instrumentation.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix
index efce3153c88..222a10a0043 100644
--- a/modules/testing/test-instrumentation.nix
+++ b/modules/testing/test-instrumentation.nix
@@ -13,9 +13,8 @@ let kernel = config.boot.kernelPackages.kernel; in
 
     boot.systemd.services.backdoor =
       { wantedBy = [ "multi-user.target" ];
-        requires = [ "dev-hvc0.device" ];
-        after = [ "dev-hvc0.device" ];
-
+        requires = [ "dev-hvc0.device" "dev-ttyS0.device" ];
+        after = [ "dev-hvc0.device" "dev-ttyS0.device" ];
         script =
           ''
             export USER=root
@@ -27,10 +26,15 @@ let kernel = config.boot.kernelPackages.kernel; in
             echo "connecting to host..." >&2
             stty -F /dev/hvc0 raw -echo # prevent nl -> cr/nl conversion
             echo
-            PS1= /bin/sh
+            PS1= exec /bin/sh
           '';
       };
 
+    # Prevent agetty from being instantiated on ttyS0, since it
+    # interferes with the backdoor (writes to ttyS0 will randomly fail
+    # with EIO).
+    boot.systemd.services."serial-getty@ttyS0".enable = false;
+
     boot.initrd.postDeviceCommands =
       ''
         # Using acpi_pm as a clock source causes the guest clock to