Commit Graph

7 Commits

Author SHA1 Message Date
Paul Eggleton 785b49e5c2 lib/oe/lsb.py: fall back to /etc/os-release for host distro ID
The new standard for host distribution identification [1] is
/etc/os-release, and a number of newer distributions provide this file,
so add support for this in order to pick up more distributions.
Additionally, handle "rolling release" style distributions that don't
report a version number, e.g. Arch Linux.

With this change we can identify the most common distributions, so this
should satisfy [YOCTO #4271]. Note that this doesn't imply support for
these distros as build hosts, just that we can identify them.

[1] http://www.freedesktop.org/software/systemd/man/os-release.html

(From OE-Core rev: bff50b747cde04007ead65dde4207b16a8e1bf08)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-02 22:23:48 +01:00
Cristian Iorga e9866ee0ff meta/lib/oe/lsb.py: extract only the needed info from lsb-release
Instead of running lsb_release -a, a lsb_release -ir will be run.
This will prevent issue with distros that don't have all the needed
info in /etc/lsb-release file, in which case lsb_release won't generate
an error code.

Partial fix for [YOCTO #4071]

(From OE-Core rev: 79a2252545ab50c79e00e02c328191c1163f917d)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-30 09:08:11 +00:00
Cristian Iorga bacdb99a42 meta/lib/oe/lsb.py: fix data extraction from /etc/lsb-release
In some cases, /etc/lsb-release file is used to extract
info about poky build host machine. But the strings are
not stripped of end of line special characters. As such,
when this info is concatenated and used as a directory
entry in sstate_cache, this is an issue.
Usually, this issue is masked by the fact that distro
related info is extracted from the output of lsb_release
command. In case of Yocto Linux, running "lsb_release -a"
will give an error code because CODENAME info is not present.
As such, bitbake will extract the info from /etc/lsb-release,
running into the above issue.
Consequence is that building under BA will crash.

Partial fix for [YOCTO #4071]

(From OE-Core rev: 5d0839bef631dceb4395fcf204779a76966a1061)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29 09:37:38 +00:00
Paul Eggleton 062a5f6c69 lib/oe/lsb: enable getting distro ID when lsb_release is not installed
If lsb_release is not installed (as it may not be on headless/minimal
installations on distros whose LSB package has a long list of
dependencies) we need to gather the information directly from files in
/etc.

Fixes [YOCTO #4012].

(From OE-Core rev: 106a7bcdb5ad9956f1d78f508408bfbcf7ff5120)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-14 16:37:09 +00:00
Mihai Lindner b4e48cc66c distro_identifier: replace slash with hyphen
Use "-" instead of "/" in "n/a" strings ("Distributor ID" and/or
"Release"), provided by `lsb_release`.
This leads to directories and subdirectories created in ./sstate-cache/
e.g. Distro-n/a/ where "Distro-n" is dir and "a" is subdir.

(From OE-Core rev: c2a9f0c330f0da82792f87e3860b06c25b986983)

Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27 09:44:59 +01:00
Richard Purdie 4f31d21bcb lib/oe/lsb.py: Map unknown distributions to 'Unknown'
(From OE-Core rev: e12df2ca5c71ad672ebbfefbc47cabbac3333d61)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-31 08:02:11 +01:00
Richard Purdie f295e29b2e lib/oe/lsb: Add basic LSB functions
This code was written by Christopher Larson <chris_larson@mentor.com> and
allows generation of the LSB release data based upon the lsb_release
command. It also includes a helper function to generate a string
representing a given distribution.

(From OE-Core rev: 458bdfe1cc4872e901ea3c38f497bfea6cf4c8cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-28 09:20:52 +01:00