You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claudio,
I started integrating this and only now realized that the data in the os-release file is not about LinuxMint, but about its underlying Ubuntu.
The approach we have in the ld package is to have a precedence between the different data sources: os-release file -> lsb_release command -> distro release file.
As a result, the consolidated accessor functions such as ld.id() or ld.name() will return the Ubuntu data.
ld also provides single source accessor functions to access a particular data source specifically, for example ld.lsb_release_info() will return the LinuxMint data provided by the lsb_release command.
The problem is that a user who wants to write distro-independent code does not know that LinuxMint is special here, and would lean to use the consolidated accessor functions (the ones with the built-in precedence).
Do you see any way to make the distro data provided by LinuxMint consistent between its different data sources, i.e. to change the os-release file to provide LinuxMint data? You can use the ID_LIKE field in the os-release file to state that it is like ubuntu and you can even have multiple IDs in there, separated by blanks, e.g. "ubuntu debian".
It's true, LinuxMint is a Ubuntu with some packages on top of it (the Desktop stuff). Besides that all package names are the same. Even the official-package-repositories.list (within /etc/apt/sources.list.d) point to Ubuntu. In the example of Linux Mint 17.3 there is Ubuntu 14.04 (trusty) in the background.
Now it depends on what you want to achieve. Is it just about the package names to be installed as requirements? Then simply handle LinuxMint like a Ubuntu.
It is about the question how should LinuxMint present itself w.r.t. the distribution information. It does have its own name, id and version, and even its own codename. However, in the os-release file it presents itself as an Ubuntu.
The issue with LSB (although many were fixed) is that it's used for two very different purposes. Some applications use it to show distribution information to the user (and in this case we want them to detect Linux Mint as much as possible), while others use this information to adapt their behaviour (and in this case we want them to think they're running on Ubuntu as much as possible).
The reason we didn't modify os-release from upstream is simply because we tackled pretty much all known issues where apps needed to show presentable info (we recommend they rely on /etc/linuxmint/info) when this is the case, and we didn't want to introduce new compatibility issues with applications relying on behaviour changes based on os-release.
This is an issue we have with lsb also, for instance the Intel drivers installer is perfectly capable of running in Linux Mint, yet it won't work with LSB not returning Ubuntu.
As you can see in both, Mint is special-cased not only for detection but also for collection of info. We also have a special case for Arch in Cinnamon, and post-LSB for Solaris and BSDs in MATE :)
Clement, this is very helpful. I realize that the problem is larger than I thought.
At the end of the day, it comes down to being able (as a package such as ld) for derived distros such as Linux Mint to provide information about both the derived distro, and about the underlying distro. Linux mint will not be the only derived distro for which both its own identity and the identity of the underlying distro is important. Even Ubuntu does that to some extent, with debian...
I'm not afraid of special-casing for Linux Mint, if we do it right.
Thanks for the links to these other projects, I'll have a look at them.
Activity
Napsty commentedon Apr 14, 2016
/etc/os-release:
/etc/lsb-release:
/etc/upstream-release/lsb-release:
/etc/debian_version:
Output of lsb_release -a:
andy-maier commentedon Apr 19, 2016
Claudio,
I started integrating this and only now realized that the data in the os-release file is not about LinuxMint, but about its underlying Ubuntu.
The approach we have in the
ldpackage is to have a precedence between the different data sources: os-release file -> lsb_release command -> distro release file.As a result, the consolidated accessor functions such as
ld.id()orld.name()will return the Ubuntu data.ldalso provides single source accessor functions to access a particular data source specifically, for exampleld.lsb_release_info()will return the LinuxMint data provided by the lsb_release command.The problem is that a user who wants to write distro-independent code does not know that LinuxMint is special here, and would lean to use the consolidated accessor functions (the ones with the built-in precedence).
Do you see any way to make the distro data provided by LinuxMint consistent between its different data sources, i.e. to change the os-release file to provide LinuxMint data? You can use the
ID_LIKEfield in the os-release file to state that it is like ubuntu and you can even have multiple IDs in there, separated by blanks, e.g. "ubuntu debian".andy-maier commentedon Apr 19, 2016
Test cases for LinuxMint have been added in PR #106.
The question on the inconsistency brought up in the previous comment still applies.
Napsty commentedon Apr 19, 2016
It's true, LinuxMint is a Ubuntu with some packages on top of it (the Desktop stuff). Besides that all package names are the same. Even the official-package-repositories.list (within /etc/apt/sources.list.d) point to Ubuntu. In the example of Linux Mint 17.3 there is Ubuntu 14.04 (trusty) in the background.
Now it depends on what you want to achieve. Is it just about the package names to be installed as requirements? Then simply handle LinuxMint like a Ubuntu.
andy-maier commentedon Apr 19, 2016
It is about the question how should LinuxMint present itself w.r.t. the distribution information. It does have its own name, id and version, and even its own codename. However, in the os-release file it presents itself as an Ubuntu.
Napsty commentedon Apr 19, 2016
Good question indeed, for which I don't have an answer. Maybe LinuxMint devs (@clefebvre) can help?
If I can help with output/tests on my install, let me know.
andy-maier commentedon Apr 19, 2016
Maybe
ldneeds some way to deal with such inconsistencies in distros, without relying on the distros to change anything.clefebvre commentedon Apr 19, 2016
Hi,
I'd be happy to chat about this but there's a lot to talk about. I'm on the IRC (irc.spotchat.org #linuxmint-dev) if you want.
You can identify Linux Mint by the presence of the /etc/linuxmint/info file, and this file also gives you "presentable" information. For instance:
RELEASE=18
CODENAME=sarah
EDITION="Cinnamon 64-bit"
DESCRIPTION="Linux Mint 18 Sarah"
DESKTOP=Gnome
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_sarah_cinnamon_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_sarah_cinnamon.php
USER_GUIDE_URL=help:linuxmint
GRUB_TITLE=Linux Mint 18 Cinnamon 64-bit
The issue with LSB (although many were fixed) is that it's used for two very different purposes. Some applications use it to show distribution information to the user (and in this case we want them to detect Linux Mint as much as possible), while others use this information to adapt their behaviour (and in this case we want them to think they're running on Ubuntu as much as possible).
The reason we didn't modify os-release from upstream is simply because we tackled pretty much all known issues where apps needed to show presentable info (we recommend they rely on /etc/linuxmint/info) when this is the case, and we didn't want to introduce new compatibility issues with applications relying on behaviour changes based on os-release.
This is an issue we have with lsb also, for instance the Intel drivers installer is perfectly capable of running in Linux Mint, yet it won't work with LSB not returning Ubuntu.
clefebvre commentedon Apr 19, 2016
This might help also. This is how MATE detects it:
https://github.com/mate-desktop/mate-system-monitor/blob/master/src/sysinfo.cpp#L603
And here's how Cinnamon does it:
https://github.com/linuxmint/Cinnamon/blob/master/files/usr/share/cinnamon/cinnamon-settings/modules/cs_info.py#L89
As you can see in both, Mint is special-cased not only for detection but also for collection of info. We also have a special case for Arch in Cinnamon, and post-LSB for Solaris and BSDs in MATE :)
andy-maier commentedon Apr 19, 2016
Clement, this is very helpful. I realize that the problem is larger than I thought.
At the end of the day, it comes down to being able (as a package such as
ld) for derived distros such as Linux Mint to provide information about both the derived distro, and about the underlying distro. Linux mint will not be the only derived distro for which both its own identity and the identity of the underlying distro is important. Even Ubuntu does that to some extent, with debian...I'm not afraid of special-casing for Linux Mint, if we do it right.
Thanks for the links to these other projects, I'll have a look at them.
clefebvre commentedon Apr 19, 2016
Thanks @andy-maier, don't hesitate to highlight or to contact me if you need help or more info.
andy-maier commentedon Apr 19, 2016
Thanks! :-)
nir0s commentedon Apr 19, 2016
Merged fixes as per #106
If there are additional inconsistencies, we'll reopen.
krayon commentedon Nov 14, 2016
Probably won't get addressed but I raised this: https://bugs.launchpad.net/linuxmint/+bug/1641491