aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/lsb.py
AgeCommit message (Collapse)Author
2016-04-13lib/oe/lsb: sanitise the distro identifierRoss Burton
The distribution identifier is often used to create filenames, so it needs to be safe to use as a filename. Whilst most distributions have e.g. Fedora or Debian as their name, it is possible that the name contains special characters. To ensure this doesn't cause a problem strip out any non-alphanumerics from the distribution name before returning it. [ YOCTO #9443 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22lib/oe/lsb.py: Prioritize parsing of /etc/os-releaseEd Bartosh
Moved parsing of /etc/os-release before parsing of /etc/SuSE-release as /etc/SuSE-release is deprecated in recent releases of OpenSuSE. Here is the quote from /etc/SuSE-release: /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14lib/oe/lsb.py: Fix up for dashSaul Wold
Remove the leading -e when using dash which does not use -e with echo Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-07-02lib/oe/lsb.py: fall back to /etc/os-release for host distro IDPaul Eggleton
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 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-29meta/lib/oe/lsb.py: extract only the needed info from lsb-releaseCristian Iorga
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] Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29meta/lib/oe/lsb.py: fix data extraction from /etc/lsb-releaseCristian Iorga
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] Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-12lib/oe/lsb: enable getting distro ID when lsb_release is not installedPaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27distro_identifier: replace slash with hyphenMihai Lindner
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. Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-31lib/oe/lsb.py: Map unknown distributions to 'Unknown'Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-27lib/oe/lsb: Add basic LSB functionsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>