Commit a18407da authored by Frederic Danis's avatar Frederic Danis

platformize: Fix systemd-nspawn error when running in gitlab CI

When running in gitlab CI the following error may occur:
platformize | Failed to register machine: Unit machine-root.scope already exists.

This can be fixed by preventing the systemd-nspawn container to register
with systemd-machined, as wrote in systemd-nspawn's man page:
--register=
  Controls whether the container is registered with systemd-machined(8).
  Takes a boolean argument, which defaults to "yes". This option should be
  enabled when the container runs a full Operating System (more
  specifically: a system and service manager as PID 1), and is useful to
  ensure that the container is accessible via machinectl(1) and shown by
  tools such as ps(1). If the container does not run a service manager, it
  is recommended to set this option to "no".
Signed-off-by: Frederic Danis's avatarFrédéric Danis <frederic.danis@collabora.com>
parent 5052d921
......@@ -54,7 +54,7 @@ in_chroot () {
done
systemd-nspawn --directory="$sysroot" --as-pid2 --tmpfs=/run/lock \
env DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes \
--register=no env DEBIAN_FRONTEND=noninteractive SUDO_FORCE_REMOVE=yes \
"$@"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment