From 4702662bb8d74c149503fdaaf85c58574f5e350d Mon Sep 17 00:00:00 2001 From: Lucas Savva Date: Sun, 5 Jul 2026 00:56:26 +0100 Subject: [PATCH] nixos/tests/machinectl: Create /usr directory Since #488508 was merged, systemd nspawn now expects /usr to exist in the rootfs before it will start a container. Create the /usr directory in the relevant containers throughout this test. --- nixos/tests/systemd-machinectl.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/tests/systemd-machinectl.nix b/nixos/tests/systemd-machinectl.nix index 4b6c8febbb04..8a525a036977 100644 --- a/nixos/tests/systemd-machinectl.nix +++ b/nixos/tests/systemd-machinectl.nix @@ -106,6 +106,8 @@ let } ]; + extraCommands = "mkdir -p usr"; + contents = [ { source = containerSystem + "/etc/os-release"; @@ -171,6 +173,7 @@ in systemd.tmpfiles.rules = [ "d /var/lib/machines/shared-decl 0755 root root - -" + "d /var/lib/machines/shared-decl/usr 0755 root root - -" ]; systemd.nspawn.shared-decl = { execConfig = { @@ -228,7 +231,7 @@ in machine.wait_until_succeeds("systemctl -M shared-decl is-active default.target"); machine.succeed("machinectl stop shared-decl"); - machine.succeed("mkdir -p ${containerRoot}"); + machine.succeed("mkdir -p ${containerRoot}/usr"); # start container with shared nix store by using same arguments as for systemd-nspawn@.service machine.succeed("systemd-run systemd-nspawn --machine=${containerName} --network-veth -U --bind-ro=/nix/store ${containerSystem}/init")