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:
parent
cfbb29d769
commit
f8ba8be54b
1 changed files with 39 additions and 36 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue