Don't set the --read-only flag for nspawn containers if just the root partition is read-only.
Don't set the --volatile=overlay flag for images created with usr-only or a generated root.
If the --volatile=overlay flag is set the container won't find the shell or init program.
cmdline = [nspawn_executable(), "--quiet", target]
- if config.read_only:
- cmdline += ["--read-only"]
-
# If we copied in a .nspawn file, make sure it's actually honoured
if config.nspawn_settings is not None:
cmdline += ["--settings=trusted"]
if nspawn_knows_arg(console_arg):
cmdline += [console_arg]
- if is_generated_root(config) or config.verity:
- cmdline += ["--volatile=overlay"]
-
if config.netdev:
if ensure_networkd(config):
cmdline += ["--network-veth"]