Skip to content

Testcase for Linux Mint is missing #78

Closed

Description

@andy-maier

Linux Mint (ID: linuxmint) is one of the distros with a reliable ID. A testcase should be added.

If you want to help, it is sufficient to post to this issue:

  • The content of the /etc/os-release file, if any.
  • The file names and content of the /etc/*release and /etc/*version files, if any.
  • The output of the command: lsb_release -a, if available.

Activity

  1. Napsty commented on Apr 14, 2016

    @Napsty

    /etc/os-release:

    $ cat /etc/os-release 
    NAME="Ubuntu"
    VERSION="14.04.3 LTS, Trusty Tahr"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 14.04.3 LTS"
    VERSION_ID="14.04"
    HOME_URL="http://www.ubuntu.com/"
    SUPPORT_URL="http://help.ubuntu.com/"
    BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
    

    /etc/lsb-release:

    $ cat /etc/lsb-release
    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=17.3
    DISTRIB_CODENAME=rosa
    DISTRIB_DESCRIPTION="Linux Mint 17.3 Rosa"
    

    /etc/upstream-release/lsb-release:

    $ cat /etc/upstream-release/lsb-release 
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=14.04
    DISTRIB_CODENAME=trusty
    DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
    

    /etc/debian_version:

    $ cat /etc/debian_version
    jessie/sid
    

    Output of lsb_release -a:

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: LinuxMint
    Description:    Linux Mint 17.3 Rosa
    Release:    17.3
    Codename:   rosa
    
  2. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    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".

  3. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    Test cases for LinuxMint have been added in PR #106.
    The question on the inconsistency brought up in the previous comment still applies.

  4. Napsty commented on Apr 19, 2016

    @Napsty

    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.

  5. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    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.

  6. Napsty commented on Apr 19, 2016

    @Napsty

    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.

  7. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    Maybe ld needs some way to deal with such inconsistencies in distros, without relying on the distros to change anything.

  8. clefebvre commented on Apr 19, 2016

    @clefebvre

    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.

  9. clefebvre commented on Apr 19, 2016

    @clefebvre

    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 :)

  10. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    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.

  11. clefebvre commented on Apr 19, 2016

    @clefebvre

    Thanks @andy-maier, don't hesitate to highlight or to contact me if you need help or more info.

  12. andy-maier commented on Apr 19, 2016

    @andy-maier
    CollaboratorAuthor

    Thanks! :-)

  13. nir0s commented on Apr 19, 2016

    @nir0s
    Collaborator

    Merged fixes as per #106

    If there are additional inconsistencies, we'll reopen.

  14. reopened this on Apr 19, 2016
  15. krayon commented on Nov 14, 2016

    @krayon

    Probably won't get addressed but I raised this: https://bugs.launchpad.net/linuxmint/+bug/1641491

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions