Container info

Container info — Information about the eventual container that is currently in use

Functions

Properties

SrtBwrapIssues bwrap-issues Read / Write / Construct Only
gchar * bwrap-messages Read / Write / Construct Only
gchar * bwrap-path Read / Write / Construct Only
SrtFlatpakIssues flatpak-issues Read / Write / Construct Only
gchar * flatpak-version Read / Write / Construct Only
gchar * host-directory Read / Write / Construct Only
SrtOsInfo * host-os-info Read / Write / Construct Only
SrtContainerType type Read / Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ╰── SrtContainerType
    GFlags
    ╰── SrtFlatpakIssues
    GObject
    ╰── SrtContainerInfo

Includes

#include <steam-runtime-tools/steam-runtime-tools.h>

Description

Functions

srt_container_info_get_container_type ()

SrtContainerType
srt_container_info_get_container_type (SrtContainerInfo *self);

If the program appears to be running in a container, return what sort of container it is.

Implementation of srt_system_info_get_container_type().

Parameters

self

A SrtContainerInfo object

 

Returns

A recognised container type, or SRT_CONTAINER_TYPE_NONE if a container cannot be detected, or SRT_CONTAINER_TYPE_UNKNOWN if unsure.


srt_container_info_get_container_host_directory ()

const gchar *
srt_container_info_get_container_host_directory
                               (SrtContainerInfo *self);

If the program appears to be running in a container, return the directory where host files can be found. For example, if this function returns /run/host, it might be possible to load the host system's /usr/lib/os-release by reading /run/host/usr/lib/os-release.

The returned directory is usually not complete. For example, in a Flatpak app, /run/host will sometimes contain the host system's /etc and /usr, but only if suitable permissions flags are set.

Implementation of srt_system_info_dup_container_host_directory().

Parameters

self

A SrtContainerInfo object

 

Returns

A path from which at least some host-system files can be loaded, typically /run/host, or NULL if unknown or unavailable.

[type filename][nullable]


srt_container_info_get_container_host_os_info ()

SrtOsInfo *
srt_container_info_get_container_host_os_info
                               (SrtContainerInfo *self);

If the program appears to be running in a container, return information about the host's operating system if possible.

Parameters

self

A SrtContainerInfo object

 

Returns

Information about the host operating system, or NULL if unknown or unavailable.

[transfer none][nullable]


srt_container_info_get_bwrap_issues ()

SrtBwrapIssues
srt_container_info_get_bwrap_issues (SrtContainerInfo *self);

Return any Bubblewrap-specific issues that have been detected.

Parameters

self

A SrtContainerInfo object

 

Returns

Zero or more flags.


srt_container_info_get_bwrap_messages ()

const char *
srt_container_info_get_bwrap_messages (SrtContainerInfo *self);

Return unstructed diagnostic messages related to bwrap(1).

Parameters

self

A SrtContainerInfo object

 

Returns

Diagnostic messages or NULL.

[nullable]


srt_container_info_get_bwrap_path ()

const char *
srt_container_info_get_bwrap_path (SrtContainerInfo *self);

Return the path to bwrap(1).

Parameters

self

A SrtContainerInfo object

 

Returns

A filename, or NULL if not found.

[type filename][nullable]


srt_container_info_get_flatpak_issues ()

SrtFlatpakIssues
srt_container_info_get_flatpak_issues (SrtContainerInfo *self);

If the program appears to be running in a container type SRT_CONTAINER_TYPE_FLATPAK, return any Flatpak-specific issues detected. Otherwise return SRT_FLATPAK_ISSUES_NONE.

Parameters

self

A SrtContainerInfo object

 

Returns

Zero or more flags.


srt_container_info_get_flatpak_version ()

const gchar *
srt_container_info_get_flatpak_version
                               (SrtContainerInfo *self);

If the program appears to be running in a container type SRT_CONTAINER_TYPE_FLATPAK, return the Flatpak version.

Parameters

self

A SrtContainerInfo object

 

Returns

A filename, or NULL if the container type is not SRT_CONTAINER_TYPE_FLATPAK or if it was not able to identify the Flatpak version.

[type filename][nullable]

Types and Values

enum SrtContainerType

A type of container.

Members

SRT_CONTAINER_TYPE_NONE

No container detected

 

SRT_CONTAINER_TYPE_FLATPAK

Running in a Flatpak app (see flatpak.org)

 

SRT_CONTAINER_TYPE_PRESSURE_VESSEL

Running in a Steam Runtime container using pressure-vessel

 

SRT_CONTAINER_TYPE_DOCKER

Running in a Docker container (see docker.com)

 

SRT_CONTAINER_TYPE_PODMAN

Running in a Podman container (see podman.io)

 

SRT_CONTAINER_TYPE_SNAP

Running in a Snap app (see snapcraft.io)

 

SRT_CONTAINER_TYPE_UNKNOWN

Unknown container type

 

enum SrtFlatpakIssues

Flags describing problems with the Flatpak sandboxing framework and its ability to create new "sub-sandboxes" for the Steam Linux Runtime.

Members

SRT_FLATPAK_ISSUES_UNKNOWN

An internal error occurred while checking Flatpak sandbox capabilities, or an unknown issue flag was encountered in a JSON report, or no Flatpak container was detected

 

SRT_FLATPAK_ISSUES_TOO_OLD

The version of Flatpak is too old for full functionality.

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_NOT_CHECKED

The diagnostic tool was unable to check for the ability to create a Flatpak subsandbox.

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_UNAVAILABLE

The diagnostic tool was unable to create a Flatpak subsandbox by using the equivalent of flatpak-spawn(1).

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_TIMED_OUT

A timeout was encountered while trying to launch a Flatpak subsandbox.

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_LIMITED_BY_SETUID_BWRAP

The ability to create a Flatpak subsandbox was limited by a setuid bwrap(1) on the host system.

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_DID_NOT_INHERIT_DISPLAY

The ability to create a Flatpak subsandbox was limited by misconfiguration of the D-Bus or systemd activation environment.

 

SRT_FLATPAK_ISSUES_SUBSANDBOX_OUTPUT_CORRUPTED

The Flatpak subsandbox adds unwanted text on standard output.

 

SRT_FLATPAK_ISSUES_NONE

None of the above

 

Property Details

The “bwrap-issues” property

  “bwrap-issues”             SrtBwrapIssues

Any Bubblewrap-related problems that have been detected.

Flags: Read / Write / Construct Only

Default value: SRT_BWRAP_ISSUES_UNKNOWN


The “bwrap-messages” property

  “bwrap-messages”           gchar *

Diagnostic messages generated by Bubblewrap.

Flags: Read / Write / Construct Only

Default value: NULL


The “bwrap-path” property

  “bwrap-path”               gchar *

Path to bwrap(1) executable.

Flags: Read / Write / Construct Only

Default value: NULL


The “flatpak-issues” property

  “flatpak-issues”           SrtFlatpakIssues

Any Flatpak-related problems that have been detected.

Flags: Read / Write / Construct Only

Default value: SRT_FLATPAK_ISSUES_UNKNOWN


The “flatpak-version” property

  “flatpak-version”          gchar *

Which Flatpak version, if any, is in use.

Flags: Read / Write / Construct Only

Default value: NULL


The “host-directory” property

  “host-directory”           gchar *

Absolute path where important files from the host system can be found.

Flags: Read / Write / Construct Only

Default value: NULL


The “host-os-info” property

  “host-os-info”             SrtOsInfo *

Information about the OS of the host-directory if available.

Flags: Read / Write / Construct Only


The “type” property

  “type”                     SrtContainerType

Which container type is currently in use.

Flags: Read / Write / Construct Only

Default value: SRT_CONTAINER_TYPE_UNKNOWN