MESON_ARGS+=(-Db_lundef=false -Dfuzz-tests=true)
if [[ "$phase" == "RUN_CLANG_ASAN_UBSAN_NO_DEPS" ]]; then
- MESON_ARGS+=(--auto-features=disabled)
+ MESON_ARGS+=(--auto-features=disabled -Dnspawn=enabled)
fi
fi
MESON_ARGS+=(--fatal-meson-warnings)
'ENABLE_NETWORKD'],
['systemd-networkd.service', '8', ['systemd-networkd'], 'ENABLE_NETWORKD'],
['systemd-notify', '1', [], ''],
- ['systemd-nspawn', '1', [], ''],
+ ['systemd-nspawn', '1', [], 'ENABLE_NSPAWN'],
['systemd-nsresourced.service',
'8',
['systemd-nsresourced'],
['systemd.net-naming-scheme', '7', [], ''],
['systemd.netdev', '5', [], 'ENABLE_NETWORKD'],
['systemd.network', '5', [], 'ENABLE_NETWORKD'],
- ['systemd.nspawn', '5', [], ''],
+ ['systemd.nspawn', '5', [], 'ENABLE_NSPAWN'],
['systemd.offline-updates', '7', [], ''],
['systemd.path', '5', [], ''],
['systemd.pcrlock', '5', ['systemd.pcrlock.d'], ''],
]>
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
-<refentry id="systemd-nspawn"
+<refentry id="systemd-nspawn" conditional="ENABLE_NSPAWN"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
feature = get_option('vmspawn').disable_auto_if(conf.get('BUILD_MODE_DEVELOPER') == 0)
conf.set10('ENABLE_VMSPAWN', feature.allowed())
+feature = get_option('nspawn')
+conf.set10('ENABLE_NSPAWN', feature.allowed())
+
conf.set10('DEFAULT_MOUNTFSD_TRUSTED_DIRECTORIES', get_option('default-mountfsd-trusted-directories'))
foreach term : ['analyze',
['machined'],
['mountfsd'],
['networkd'],
+ ['nspawn'],
['nsresourced'],
['nss-myhostname'],
['nss-mymachines'],
description : 'support for the rfkill tools')
option('xdg-autostart', type : 'boolean',
description : 'install the xdg-autostart-generator and unit')
+option('nspawn', type : 'feature',
+ description : 'build and install systemd-nspawn')
option('man', type : 'feature', deprecated : { 'true' : 'enabled', 'false' : 'disabled' },
value : 'disabled',
description : 'build and install man pages')
['systemd-delta', ''],
['systemd-detect-virt', ''],
['systemd-id128', ''],
- ['systemd-nspawn', ''],
+ ['systemd-nspawn', 'ENABLE_NSPAWN'],
['systemd-path', ''],
['systemd-run', ''],
['systemd-vpick', ''],
# SPDX-License-Identifier: LGPL-2.1-or-later
+if conf.get('ENABLE_NSPAWN') != 1
+ subdir_done()
+endif
+
libnspawn_core_sources = files(
'nspawn-bind-user.c',
'nspawn-cgroup.c',
},
nspawn_test_template + {
'sources' : files('test-nspawn-tables.c'),
+ 'conditions' : ['ENABLE_NSPAWN'],
},
nspawn_test_template + {
'sources' : files('test-nspawn-util.c'),
+ 'conditions' : ['ENABLE_NSPAWN'],
},
nspawn_fuzz_template + {
'sources' : files('fuzz-nspawn-settings.c'),
+ 'conditions' : ['ENABLE_NSPAWN'],
},
nspawn_fuzz_template + {
'sources' : files('fuzz-nspawn-oci.c'),
+ 'conditions' : ['ENABLE_NSPAWN'],
},
]
'fuzzers',
' '.join(fuzz_c_args + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
' '.join(fuzz_cpp_args + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
- '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ --auto-features=@2@'.format(
+ '-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined -Dnspawn=enabled --optimization=@0@ @1@ --auto-features=@2@'.format(
get_option('optimization'),
get_option('werror') ? '--werror' : '',
sanitize_auto_features
exit 77
fi
+if ! command -v systemd-nspawn >/dev/null; then
+ echo "no systemd-nspawn" >/skipped
+ exit 77
+fi
+
# shellcheck source=test/units/test-control.sh
. "$(dirname "$0")"/test-control.sh
'file' : 'systemd-networkd.socket',
'conditions' : ['ENABLE_NETWORKD'],
},
- { 'file' : 'systemd-nspawn@.service.in' },
+ {
+ 'file' : 'systemd-nspawn@.service.in',
+ 'conditions' : ['ENABLE_NSPAWN'],
+ },
{
'file' : 'systemd-vmspawn@.service.in',
'conditions' : ['ENABLE_VMSPAWN'],