Determining Linux Distribution

Christian Mauderer oss at c-mauderer.de
Thu Sep 10 16:37:28 UTC 2020


On 10/09/2020 18:31, Joel Sherrill wrote:
> 
> 
> On Thu, Sep 10, 2020 at 11:09 AM Christian Mauderer <oss at c-mauderer.de
> <mailto:oss at c-mauderer.de>> wrote:
> 
>     On 10/09/2020 00:25, Chris Johns wrote:
>     > On 10/9/20 8:15 am, Joel Sherrill wrote:
>     >> On Wed, Sep 9, 2020 at 4:06 PM Karel Gardas
>     <karel.gardas at centrum.cz <mailto:karel.gardas at centrum.cz>
>     >> <mailto:karel.gardas at centrum.cz
>     <mailto:karel.gardas at centrum.cz>>> wrote:
>     >>
>     >>     On 9/9/20 11:03 PM, Karel Gardas wrote:
>     >>     > so Debian, Kali and OpenSuSE at least are not well handled
>     by this
>     >>     > script and it's quite fun since simple:
>     >>
>     >>     Can't judge author of the script. The post is from 2008! So I
>     guess
>     >>     /etc/os-release was not so wide spread among the Linuxes at
>     that time...
>     >>
>     >> That looks promising and linux.py in rtems-toolkit should be easy
>     to make do that.
>     >
>     > The code in linux.py that calls platform.dist() should be removed
>     because the
>     > call has been removed from Python 3 after 3.5.
>     >
>     > Chris
> 
>     You have seen that there exists a python pip package to find out the
>     distribution:
> 
>     https://distro.readthedocs.io/en/latest/
> 
> 
> I assume we don't want to assume someone will use pip to load a package
> to use the RSB or rtems-tools.  Copying it into our tree gives us a package
> that will periodically need to be updated.
> 
> Chris.. what do you want to do?
> 
> --joel
>  

If it's not a critical information most likely we can also just do a
`uname` and a `cat /etc/os.release` or similar. That will cover _most_
modern distributions.

Best regards

Christian


More information about the devel mailing list