RFR: 8370719: [Linux] Use /etc/os-release values for font configuration file names
Phil Race
prr at openjdk.org
Tue Nov 4 21:51:02 UTC 2025
On Tue, 4 Nov 2025 00:22:38 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> And for the application - and we are an application - the same documentation says to look at the primary file location - in /etc. And only fall back to the second location if that file does not exist. If the file in /etc exists and differs from the /usr/lib/ file the later should not be used. Which implies that system vendor **can** replace the /etc/os-release file with another one or with link to the place other than /usr/lib/os-release. The /usr/lib/os-release is a fallback location. But we already have a fallback mechanics - we will have generic values set (osName is "Linux" and osVersion id null). Lust look at the usage examples at the bottom of the man page - all examples are using /usr/lib/os-release if /etc/os-release does not exist.
>
>> all examples are using /usr/lib/os-release if /etc/os-release does not exist.
>
> This is what I pointed out, we should follow the spec and check the "/usr/lib/" if the file in /etc/ does not exist, since the spec allows it to be missing.
Applications are encouraged to check the /etc file.
Also all here, someone has a list of which distros / versions contain this file https://github.com/chef/os_release
It is maintained so people can look to see what to expect without having to install, but it seems to me like it is something that we really can depend on.
Also note that all distros we explicitly recognize have this file, and that it is *what we are already doing* for other distros, where we fall back to this file.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28073#discussion_r2492130980
More information about the client-libs-dev
mailing list