From: Lennart Poettering Date: Wed, 19 Aug 2020 15:07:41 +0000 (+0200) Subject: machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env X-Git-Tag: v247-rc1~405^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16792%2Fhead;p=thirdparty%2Fsystemd.git machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env Fixes: #16758 --- diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index f76b82a8a45..90f03db6804 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -44,7 +44,7 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) { fd = safe_close(fd); } - if (isempty(root)) { + if (isempty(root) && running_in_chroot() <= 0) { /* If that didn't work, see if we are running in a container, * and a machine ID was passed in via $container_uuid the way * libvirt/LXC does it */