diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c index 1903cdc8b143ccacd1235cb79cf6fb2a3fdc5135..3e96520108fc45ea7590b03cd5636b61a65a051c 100644 --- a/steam-runtime-tools/system-info.c +++ b/steam-runtime-tools/system-info.c @@ -3467,7 +3467,10 @@ 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_PODMAN, "podman" }, + { SRT_CONTAINER_TYPE_PRESSURE_VESSEL, "pressure-vessel" }, }; static SrtContainerType @@ -3518,6 +3521,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)) @@ -3553,6 +3567,14 @@ ensure_container_info (SrtSystemInfo *self) goto out; } + if (_srt_file_test_in_sysroot (self->sysroot, self->sysroot_fd, + "/run/.containerenv", G_FILE_TEST_EXISTS)) + { + self->container.type = SRT_CONTAINER_TYPE_PODMAN; + g_debug ("Podman based on /run/.containerenv"); + goto out; + } + if (_srt_file_get_contents_in_sysroot (self->sysroot_fd, "/proc/1/cgroup", &contents, NULL, NULL)) diff --git a/steam-runtime-tools/system-info.h b/steam-runtime-tools/system-info.h index 63f1b800899132d022f8cf5d5144e25d30e4896a..4c57ec8cd69d4f54b4c5fe1331a5b3fe227f81dc 100644 --- a/steam-runtime-tools/system-info.h +++ b/steam-runtime-tools/system-info.h @@ -82,6 +82,7 @@ typedef enum * @SRT_CONTAINER_TYPE_PRESSURE_VESSEL: Running in a Steam Runtime container * using pressure-vessel * @SRT_CONTAINER_TYPE_DOCKER: Running in a Docker container + * @SRT_CONTAINER_TYPE_PODMAN: Running in a Podman container * * A type of container. */ @@ -91,6 +92,7 @@ typedef enum SRT_CONTAINER_TYPE_FLATPAK, SRT_CONTAINER_TYPE_PRESSURE_VESSEL, SRT_CONTAINER_TYPE_DOCKER, + SRT_CONTAINER_TYPE_PODMAN, SRT_CONTAINER_TYPE_UNKNOWN = -1 } SrtContainerType;