diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c index 4862b6fda54ede86858651ace8e99a953f21e663..3e96520108fc45ea7590b03cd5636b61a65a051c 100644 --- a/steam-runtime-tools/system-info.c +++ b/steam-runtime-tools/system-info.c @@ -3469,6 +3469,7 @@ static const ContainerTypeName container_types[] = { { SRT_CONTAINER_TYPE_DOCKER, "docker" }, { SRT_CONTAINER_TYPE_FLATPAK, "flatpak" }, + { SRT_CONTAINER_TYPE_PODMAN, "podman" }, { SRT_CONTAINER_TYPE_PRESSURE_VESSEL, "pressure-vessel" }, }; @@ -3566,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;