steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Steam should use PRETTY_NAME from /etc/os-release when exists

Open nanonyme opened this issue 7 years ago • 31 comments

See https://www.freedesktop.org/software/systemd/man/os-release.html /etc/os-release optionally contains PRETTY_NAME variable which contains preformatted OS name for GUI etc consumption. This should be read and used in Steam UI's where available. (instead of relying on /etc/*-release files) or generating the name oneself. Many if not all distros that use os-release are also filling in PRETTY_NAME.

nanonyme avatar Nov 18 '18 18:11 nanonyme

I feel like this is even more important now that protondb requests the output of Steam's system info yet it doesn't even report the distro. Since Valve is pushing for Linux adoption, I can't imagine that implementing this wouldn't also help drill down on bug issues.

reallygrimm avatar Mar 14 '19 08:03 reallygrimm

/etc/os-release

NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo/Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"

${XDG_DATA_HOME}/Steam/steam.sh:106 (function detect_release())

function detect_release()
{
        if [ -f /etc/lsb-release ]; then
                (. /etc/lsb-release; echo $DISTRIB_RELEASE)
        elif [ -f /etc/os-release ]; then
                (. /etc/os-release; echo $VERSION_ID)
        elif [ -f /etc/debian_version ]; then
                cat /etc/debian_version
        else
                # Generic fallback
                uname -r
        fi
}

failed, no $VERSION_ID

Running Steam on gentoo  64-bit

Also, no lsb_release command available. Anyway, after sys-apps/lsb-release installation I got /etc/lsb-release:

DISTRIB_ID="Gentoo"

:man_shrugging: , no $DISTRIB_RELEASE


P.S. /etc/gentoo-release (/etc/[distro]-release)

Gentoo Base System release 2.6

EDIT: Now (after lsb_release installation) the version information in Steam client displaying as "Gentoo Base System release 2.6" (64-bit) (was Linux (64-bit)).

pchome avatar May 26 '19 11:05 pchome

flatpak run --command=cat com.valvesoftware.Steam /etc/os-release

We don't want host to be advertised. The host is meaningless for statistics, the important thing is the Flatpak runtime.

nanonyme avatar May 26 '19 12:05 nanonyme

If we really need lsb_release, I can create one based on os-release in the wrapper but that's deprecated way to query stuff.

nanonyme avatar May 26 '19 12:05 nanonyme

There is also /proc/version with pretty parsable format: Linux version %kernel version% (%built by user%@%host%) (gcc version %bult using version% (%OS Name% %system gcc version%)) ...

But I'm fine with uname, the problem is that uname -r not even reached. The whole function fails instead, due to "undefined variable" error.

pchome avatar May 26 '19 13:05 pchome

Which variable? We are defining ID and VERSION_ID.

nanonyme avatar May 26 '19 13:05 nanonyme

How are you managing to get host os-version visible? It should not be possible.

nanonyme avatar May 26 '19 13:05 nanonyme

Sorry, maybe I misled you, just reporting similar issue in Gentoo. Not flatpak.

Using PRETTY_NAME or whatever else, instead undefined $VERSION_ID and/or $DISTRIB_RELEASE should fix the issue. Or simply checking variables for existence should help too.

Also, sorry for my bad English.

pchome avatar May 26 '19 14:05 pchome

This is the template for 19.08 https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/master/files/os-release/os-release.in

nanonyme avatar May 26 '19 15:05 nanonyme

18.08 is roughly the same

nanonyme avatar May 26 '19 15:05 nanonyme

DISTRIB_RELEASE is not part of spec for os-release. I'll tweak VERSION_ID a bit still, I think it might have been a mistake to include minor version number there.

nanonyme avatar May 26 '19 15:05 nanonyme

@nanonyme

DISTRIB_RELEASE is not part of spec for os-release.

As you can see (provided detect_release() function code), $DISTRIB_RELEASE queried from /etc/lsb-release. (the code taken from steam.sh Steam client launcher script).

EDIT: Explanation: the next part of provided data

Running Steam on gentoo  64-bit

is the Steam client output in terminal emulator, where "Gentoo" (or so) missed between "gentoo" and "64-bit".

pchome avatar May 26 '19 16:05 pchome

Yes, but we don't ship /etc/lsb-release at all so it doesn't matter. We only ship os-release and it's not part of the spec.

nanonyme avatar May 26 '19 16:05 nanonyme

Note. The "Running..." already is outputting the right thing. Our currently problem is that Steam survey has different data. Why? No one knows.

nanonyme avatar May 26 '19 17:05 nanonyme

"Running..." seems used only for for logging. At the early beginning, likely to detect system from the reported log files.

Steam "system info"(under the Help menu), so likely survey too, uses lsb_release command (and many others). I saw error sh: lsb_release: command not found in output, directly after "system info" dialog window was shown. Also there was only "Linux" and many "Unknown" in the produced "system info" result, so uname -s and the "Unknown" string was used as placeholders.

So, the OS info collected in ${XDG_DATA_HOME}/Steam/steam.sh have nothing common with Steam survey. Commands for Steam survey likely called directly from the Steam client's code.

Better would be to use bundled lsb_release (or so), modified to satisfy both, the launcher script and the Steam survey (and "system info").

pchome avatar May 26 '19 18:05 pchome

Sorry for comments I just deleted comments, I totally misread the repo. I'm still surprised if there's two completely different mechanisms for getting OS data. I'm just implementing a shim lsb_release, scratch build available at https://github.com/flathub/com.valvesoftware.Steam/pull/363

nanonyme avatar May 26 '19 19:05 nanonyme

This would also fix the issue on NixOS (https://github.com/NixOS/nixpkgs/issues/63839)!

@kisak-valve why is the Steam Client not open source? Then we would probably already have a Pull request you only have to merge. This issue shouldn't take so long to fix!!!

davidak avatar Jul 04 '19 02:07 davidak

fix this problem is easy, not should take 1 year...

pruebahola avatar Sep 30 '19 17:09 pruebahola

How about just using lsb_release -ds ? (after testing for lsb_release using which lsb_release >/dev/null for example).

baryluk avatar Oct 28 '19 21:10 baryluk

@baryluk How about not using lsb_release at all? It's not a "standard" utility and it should not be expected to be available.

gasinvein avatar Oct 28 '19 21:10 gasinvein

@gasinvein I addressed this exact concern in my comment. It is short, read again.

baryluk avatar Oct 28 '19 21:10 baryluk

Not every distro have the command lsb_release installed by default. Almost all modern distros use /etc/os-release (Debian, Ubuntu, openSUSE, Fedora, Arch, ...). Please use that instead.

itaranto avatar Feb 01 '20 22:02 itaranto

please valve.... this issue not should take 2years...

pruebahola avatar Mar 30 '20 14:03 pruebahola

bump

a8underscore avatar Jun 07 '20 20:06 a8underscore

OpenSUSE Tumbleweed user reporting in. /etc/os-release has PRETTY_NAME="openSUSE Tumbleweed"

zaggynl avatar Jun 07 '20 21:06 zaggynl

News about this?

chardinson avatar Dec 25 '21 00:12 chardinson

Valve is taking their sweet time fixing this lol

nyabinary avatar Nov 03 '23 13:11 nyabinary

2025™

Tiagoquix avatar Nov 28 '25 18:11 Tiagoquix

Out of curiosity, I have done a test in 6 fresh installations of distributions using virtual machines.

The conclusion is that all outputs of Description in lsb_release -a match PRETTY_NAME from /etc/os-release, but I do not know if it's a coincidence.

In the Steam Client, Help -> System Report shows /etc/os-release being read, but for the purposes of the hardware survey, it seems Help -> System Information is used instead (according to https://github.com/NixOS/nixpkgs/pull/65822).

Here are my tests. Respectively: Arch Linux / Linux Mint (Ubuntu-based) / Pop OS Beta / Pop OS Stable / Ubuntu LTS / Zorin OS

Image Image Image Image Image Image

Tiagoquix avatar Nov 28 '25 19:11 Tiagoquix

And here's a screenshot from my main PC as well:

Image

Tiagoquix avatar Nov 28 '25 19:11 Tiagoquix