Skip to content
Snippets Groups Projects
Commit c9b752ed authored by Simon McVittie's avatar Simon McVittie
Browse files

system-info: Add support for reading /run/host/container-manager

See <https://systemd.io/CONTAINER_INTERFACE/

> for details. Recent
versions of flatpak and pressure-vessel support this.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 557132e4
No related branches found
No related tags found
1 merge request!220Improve container detection
......@@ -3467,7 +3467,9 @@ typedef struct
static const ContainerTypeName container_types[] =
{
{ SRT_CONTAINER_TYPE_DOCKER, "docker" }
{ SRT_CONTAINER_TYPE_DOCKER, "docker" },
{ SRT_CONTAINER_TYPE_FLATPAK, "flatpak" },
{ SRT_CONTAINER_TYPE_PRESSURE_VESSEL, "pressure-vessel" },
};
static SrtContainerType
......@@ -3518,6 +3520,17 @@ ensure_container_info (SrtSystemInfo *self)
run_host_path,
NULL);
if (_srt_file_get_contents_in_sysroot (self->sysroot_fd,
"/run/host/container-manager",
&contents, NULL, NULL))
{
g_strchomp (contents);
self->container.type = container_type_from_name (contents);
g_debug ("Type %d based on /run/host/container-manager",
self->container.type);
goto out;
}
if (_srt_file_get_contents_in_sysroot (self->sysroot_fd,
"/run/systemd/container",
&contents, NULL, NULL))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment