From dc38003af91baa3387eb231f854bc4e89041434f Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 29 May 2016 17:58:55 +0200 Subject: nixos/containers: Create an empty machine-id file Since systemd version 230, it is required to have a machine-id file prior to the startup of the container. If the file is empty, a transient machine ID is generated by systemd-nspawn. See systemd/systemd#3014 for more details on the matter. This unbreaks all of the containers-* NixOS tests. Signed-off-by: aszlig Cc: @edolstra Closes: #15808 --- nixos/modules/virtualisation/containers.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/virtualisation') diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index dc65e4940549..13ecb8e25ed5 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -309,6 +309,10 @@ in touch "$root/etc/os-release" fi + if ! [ -e "$root/etc/machine-id" ]; then + touch "$root/etc/machine-id" + fi + mkdir -p -m 0755 \ "/nix/var/nix/profiles/per-container/$INSTANCE" \ "/nix/var/nix/gcroots/per-container/$INSTANCE" -- cgit 1.4.1