1. Tizen does not support continer and vm.
2. Resolving Smack error.
==========================================================================================
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322
Jan 01 09:00:19 localhost audit[535]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=535 comm="tlm-sessiond" name="environ" dev="proc" ino=12572
Jan 01 09:00:19 localhost audit[535]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=535 comm="tlm-sessiond" name="sched" dev="proc" ino=12322
Jan 01 09:00:30 localhost audit[949]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=949 comm="systemctl" name="sched" dev="proc" ino=12322
==========================================================================================
Change-Id: I8b947a0de6c030fa7dd4f8d8b080b1f7783a4010
foreach term : ['utmp',
'kdbus',
+ 'virt',
'hibernate',
'environment-d',
'binfmt',
join_paths(systemgeneratordir, exe_name),
join_paths(usergeneratordir, exe_name))
-exe = executable('systemd-detect-virt',
- 'src/detect-virt/detect-virt.c',
- include_directories : includes,
- link_with : [libshared],
- install_rpath : rootlibexecdir,
- install : true)
-public_programs += exe
+if conf.get('ENABLE_VIRT') == 1
+ exe = executable('systemd-detect-virt',
+ 'src/detect-virt/detect-virt.c',
+ include_directories : includes,
+ link_with : [libshared],
+ install_rpath : rootlibexecdir,
+ install : true)
+ public_programs += exe
+endif
exe = executable('systemd-delta',
'src/delta/delta.c',
['blkid'],
['dbus'],
['kdbus'],
+ ['virt'],
['glib'],
['nss-myhostname'],
['nss-mymachines'],
option('kdbus', type : 'boolean', value : 'false',
description : 'kdbus support')
+option('virt', type : 'boolean',
+ description : 'virtualization support')
option('bashcompletiondir', type : 'string',
description : 'directory for bash completion scripts ["no" disables]')
%define WITH_MACHINED 0
%define WITH_DOC 0
%define WITH_HOSTNAMED 0
+%define WITH_VIRT 0
%define build_dir _build
%define dbuspolicydir %{_datadir}/dbus-1
%define _vpath_builddir %{build_dir}
%meson \
-Dkdbus=true \
+%if ! %{?WITH_VIRT}
+ -Dvirt=false \
+%endif
%if ! %{WITH_RANDOMSEED}
-Drandomseed=false \
%endif
chsmack %{_bindir}/systemd-cgls -a "System::Tools"
chsmack %{_bindir}/systemd-cgtop -a "System::Tools"
chsmack %{_bindir}/systemd-delta -a "System::Tools"
-chsmack %{_bindir}/systemd-detect-virt -a "System::Tools"
chsmack %{_bindir}/systemd-inhibit -a "System::Tools"
chsmack %{_bindir}/udevadm -a "System::Tools"
chsmack %{_bindir}/systemd-escape -a "System::Tools"
chsmack %{_bindir}/systemd-path -a "System::Tools"
chsmack %{_prefix}/lib/systemd/* -a "System::Tools"
+%if %{?WITH_VIRT}
+chsmack %{_bindir}/systemd-detect-virt -a "System::Tools"
+%endif
%postun
if [ $1 -ge 1 ] ; then
%{_bindir}/systemd-cgls
%{_bindir}/systemd-cgtop
%{_bindir}/systemd-delta
-%{_bindir}/systemd-detect-virt
%{_bindir}/systemd-inhibit
%{_bindir}/systemd-id128
%{_bindir}/udevadm
%{_prefix}/lib/sysctl.d/*.conf
%{_prefix}/lib/systemd/systemd
%{_prefix}/lib/systemd/system
+%if %{?WITH_VIRT}
+%{_bindir}/systemd-detect-virt
+%endif
%dir %{_prefix}/lib/systemd/system/basic.target.wants
%dir %{_prefix}/lib/systemd/user
['systemd-cgls', ''],
['systemd-cgtop', ''],
['systemd-delta', ''],
- ['systemd-detect-virt', ''],
+ ['systemd-detect-virt', 'ENABLE_VIRT'],
['systemd-nspawn', ''],
['systemd-path', ''],
['systemd-run', ''],
/* Returns a short identifier for the various VM implementations */
int detect_vm(void) {
+#if ENABLE_VIRT
static thread_local int cached_found = _VIRTUALIZATION_INVALID;
bool other = false;
int r, dmi;
cached_found = r;
log_debug("Found VM virtualization %s", virtualization_to_string(r));
return r;
+#else
+ return VIRTUALIZATION_NONE;
+#endif
}
int detect_container(void) {
+#if ENABLE_VIRT
static const struct {
const char *value;
int id;
log_debug("Found container virtualization %s.", virtualization_to_string(r));
cached_found = r;
return r;
+#else
+ return VIRTUALIZATION_NONE;
+#endif
}
int detect_virtualization(void) {