0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

testing-instrumentation: Factor backdoor service out to variable

This commit is contained in:
Will Fancher 2023-09-19 23:30:52 -04:00
parent cfbb29d769
commit f8ba8be54b

View file

@ -7,14 +7,9 @@ with lib;
let let
qemu-common = import ../../lib/qemu-common.nix { inherit lib pkgs; }; qemu-common = import ../../lib/qemu-common.nix { inherit lib pkgs; };
in
{ backdoorService = {
wantedBy = [ "multi-user.target" ];
config = {
systemd.services.backdoor =
{ wantedBy = [ "multi-user.target" ];
requires = [ "dev-hvc0.device" "dev-${qemu-common.qemuSerialDevice}.device" ]; requires = [ "dev-hvc0.device" "dev-${qemu-common.qemuSerialDevice}.device" ];
after = [ "dev-hvc0.device" "dev-${qemu-common.qemuSerialDevice}.device" ]; after = [ "dev-hvc0.device" "dev-${qemu-common.qemuSerialDevice}.device" ];
script = script =
@ -50,6 +45,14 @@ in
serviceConfig.KillSignal = "SIGHUP"; serviceConfig.KillSignal = "SIGHUP";
}; };
in
{
config = {
systemd.services.backdoor = backdoorService
# Prevent agetty from being instantiated on the serial device, since it # Prevent agetty from being instantiated on the serial device, since it
# interferes with the backdoor (writes to it will randomly fail # interferes with the backdoor (writes to it will randomly fail
# with EIO). Likewise for hvc0. # with EIO). Likewise for hvc0.