Skip to content

Provide /etc/amd, /var/tmp, /run/host/etc, /run/gfx/etc in container

Simon McVittie requested to merge wip/etc-amd into master
  • pressure-vessel: Expose host /etc in /run/host/etc

    There are three user-space Vulkan driver stacks for recent AMD GPUs:

    • Mesa RADV, open-source drivers from the Mesa community
    • AMDVLK, open-source drivers from AMD
    • AMDGPU-PRO, proprietary drivers from AMD (presumably based on AMDVLK)

    At least one of the two AMD-maintained drivers requires files that are installed in /etc/amd.

    Partially addresses https://github.com/ValveSoftware/steam-runtime/issues/313.

  • pressure-vessel: Expose graphics provider /etc in /run/gfx/etc

    Similar to the previous commit, if the graphics stack provider is not the host, we want to put its /etc in /run/gfx/etc, alongside /run/gfx/usr.

    Partially addresses https://github.com/ValveSoftware/steam-runtime/issues/313.

  • pressure-vessel: Share host /etc/hosts, etc., according to a table

    We take the same action for each of these files, so let's make the code more data-driven.

  • runtime: Only open provider as fd once

    We'll use this in more places in a subsequent commit.

  • runtime: Mount graphics stack provider's /etc/amd in container

    We could make a symlink /etc/amd -> /run/host/etc/amd or /run/gfx/etc/amd, as appropriate, but this seems neater.

    Resolves: https://github.com/ValveSoftware/steam-runtime/issues/313

  • runtime: Don't create a separate tmpfs for /tmp and /var

    The root filesystem of the container is a tmpfs anyway, so we don't need a separate tmpfs. This is consistent with what Flatpak does.

  • runtime: Make sure /var/tmp exists

    Normally it does, so applications might misbehave if they can't create files and directories inside it without needing to create it first.

  • pressure-vessel: Share /var/tmp with host if not using a fake $HOME

    We share /tmp with the host, and it seems odd to share /tmp but put /var/tmp on our private tmpfs, particularly when /var/tmp is traditionally longer-lived and more spacious than /tmp (for example, /tmp on a small tmpfs and /var/tmp on a large disk is common).

    In the unusual case where we are using a fake $HOME, we mount its ~/.cache/tmp on our container's /var/tmp, consistent with Flatpak. That doesn't change here, and it's still persistent unless explicitly deleted.

    Prompted by https://github.com/ValveSoftware/steam-runtime/issues/313#issuecomment-766526963

Merge request reports