aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
AgeCommit message (Collapse)Author
2015-08-29Empty image: package list splitting and iterationAlex Franco
A few short fixes to splitting/iteration done over package lists in license.bbclass, package_manager.py and rootfs.py. [YOCTO #7664] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31license_class: Fix choose_lic_set into incompatible licenseAníbal Limón
Use canonical_license when doing evaluation of license expresion since INCOMPATIBLE_LICENSE are already canonized. [YOCTO #8080] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-21license_class: Add explicity avoid of CLOSED license in validationsAníbal Limón
The CLOSED license isn't a generic license it is a set and can be any closed source license. [YOCTO #7752] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-05-09license_class: license_create_manifest improvmentAníbal Limón
Use image_list_installed_packges instead of open manually the package manifest and iterate over it. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09license: Add support for handle INCOMPATIBLE_LICENSE in manifest creationAníbal Limón
When INCOMPATIBLE_LICENSE's is specified it need to be removed from license.manifest and also avoid copy to target image. Add ManifestVisitor that walk the license string searching for INCOMPATIBLE_LICENSE's if found remove it. [YOCTO #6765] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09license_class: Generalize license_ok functionAníbal Limón
Add dont_want_licenses as parameter to license_ok function and move it to oe.license module in order to use in other modules. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-09license_class: Reimplemented manifest creation in pythonAníbal Limón
Reimplemented license_manifest_create from shell to python for INCOMPATIBLE_LICENSE handle using oe.license module. Optimizations are made to avoid license copy now uses a hardlink and symbolic link this helps to save space during build. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-30license.bbclass: allow copying license not in common licensesJackie Huang
Some package like linux-firmware has many licenses that aren't in any way common, and new ones will be added from time to time, in order to avoid adding bunch of such common license files that are only applicable to a specific package, NO_GENERIC_LICENSE is added to allow copying license not in common licenses, it should be used in the recipe as: NO_GENERIC_LICENSE[<license_name>] = "<license file in fetched source>" e.g. NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENCE.Abilis.txt" Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
2015-03-21license.bbclass: skip license checking if the package contains no fileChen Qi
If the package doesn't contain any file, then the license isn't relevant as far as the final image is concerned. So we skip the license checking in license_create_manifest if such case. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-16license.bbclass: set dirs for do_populate_lic_setsceneRobert Yang
Fixed: ERROR: Build of do_populate_lic failed ERROR: Traceback (most recent call last): File "bitbake/lib/bb/build.py", line 497, in exec_task return _exec_task(fn, task, d, quieterr) File "bitbake/lib/bb/build.py", line 437, in _exec_task exec_func(func, localdata) File "bitbake/lib/bb/build.py", line 212, in exec_func exec_func_python(func, d, runfile, cwd=adir) File "/home/nxadm/nx/ala-blade44.1/builds-2015-03-09-163005/qemuppc_world_oe_bp/bitbake/lib/bb/build.py", line 237, in exec_func_python os.chdir(cwd) OSError: [Errno 2] No such file or directory: 'bitbake_build/tmp/work/ppc7400-wrs-linux/taglib/1.9.1-r0/build' When running setscene, the cwd is $B which maybe removed by autotools.bbclass or cmake.bbclass when rebuild. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-17license.bbclass: fix unexpected operator for LICENSE values with spaceMartin Jansa
* add quotes around pkged_lic so that it works correctly with spaces * fixes following error: run.license_create_manifest.50601: 193: [: GPLv2: unexpected operator Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14oe-pkgdata-util: improve command-line usagePaul Eggleton
* Use argparse instead of optparse for standardised help output, options and a much cleaner code structure * Look up pkgdata directory automatically so the user doesn't have to specify it * Use standard logging NOTE: this does mean a slight change in syntax - if you do want to specify the pkgdata directory (usually only necessary if you're calling it from within the build process) you need to use the parameter -p (or --pkgdata-dir) and specify this before the command, not after it. Examples: oe-pkgdata-util find-path /sbin/mke2fs oe-pkgdata-util lookup-recipe libelf1 oe-pkgdata-util read-value PKGSIZE libc6 oe-pkgdata-util -p /home/user/oe/build/tmp/sysroots/qemux86-64/pkgdata read-value PKGSIZE libc6 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-02-07classes/license: tweak license format messagesPaul Eggleton
Strictly speaking not all of these characters are operators, so reword the message to describe them as separators. Also use the standard "recipename: message" format. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-24license.bbclass: hardlink requires write permissionRobert Yang
Fixed: * The os.link() reqiures write permission on the src file (suppose the src file belongs to another user, then you need write permission to harlink to it since the link count would change) * Print more info when failed to copy The warning was like: WARNING: Could not copy license file COPYING: [Errno 1] Operation not permitted We couldn't know which recipe print the warning from this message. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-24license: Validate if LICENSE is well defined.Aníbal Limón
Add check_license_format function that shows warning if LICENSE don't have valid operators and also if have space separated entries without operator, add check_license_format validation into base class. [YOCTO #6758] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-24license_class: fix license.manifest shows LICENSE field differently to recipeAníbal Limón
Drop removal of [|&()*] operators in pkged_lic because this removal is only needed to validate if license is collected. [YOCTO #6757] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19base/license.bbclass: expand wildcards in INCOMPATIBLE_LICENSEHongxu Jia
The whitelist processing in code in base.bbclass does not play well with wildcards in INCOMPATIBLE_LICENSES. The code expects bad_licenses to contain actual license names, not wildcards. Add incompatible_license_contains to replace bb.utils.contains( "INCOMPATIBLE_LICENSE", **, **, **, d) [YOCTO #5592] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2014-11-04license.bbclass: canonicalise the licenses named with 'X+'Jackie Huang
If INCOMPATIBLE_LICENSE=GPLv3, GPLv3+ should be excluded as well but not now since there is no SPDXLICENSEMAP for licenses named with 'X+', we can add all the SPDXLICENSEMAP settings for licenses named with 'X+' in licenses.conf, but it's more like a duplication, so improve the canonical_license function to auto map for 'X+' if SPDXLICENSEMAP for 'X' is available, so GPLv3+ becomes GPL-3.0+. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-09-16license: Improve disk usageRichard Purdie
Currently copies of the license files are made which wastes disk space and adversely affects performance. We can link these instead in most cases for small performance gains. (From OE-Core rev: 0b0f3631fd22f731b6aeedb73965e367b695028b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19license.bbclass: canonicalise licenses when dealing with INCOMPATIBLE_LICENSERoss Burton
If INCOMPATIBLE_LICENSE=GPL-3.0 but the recipe sets LICENSE=GPLv3, the current code won't trigger because they're different strings. Fix this by attempting to canonicalise every license name to a SPDX name, so both names in this example become GPL-3.0. [ YOCTO #5622 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19license.bbclass: fix indentation in python functionRoxana Ciobanu
If we don't fix this, the fix for bug 6502 will trigger warnings that the write_package_manifest function contains tabs. Related to fix for [YOCTO #6502]. Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-21image.bbclass, license.bbclass: adjust the name of list_installed_packages()Laurentiu Palcu
The old wrapper got renamed to image_list_installed_packages(). Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11license.bbclass: Dont create a manifest when using BUILD_IMAGES_FROM_FEEDSDavid Nyström
Wihtout this patch, FEEDS functionality is broken, and creating a manifest from recipe metadata may be faulty when using FEEDS. Signed-off-by: David Nyström <david.nystrom@enea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11license.bbclass: fix license_create_manifest failedHongxu Jia
While rpm incremental image generation enabled, invoked license_create_manifest failed. ... | ln: failed to create symbolic link 'tmp/work/qemux86_ 64-poky-linux/core-image-base/1.0-r0/rootfs/usr/share/ common-licenses/alsa-conf-base/generic_GPLv2':File exists | WARNING:tmp/work/qemux86_64-poky-linux/core-image-base/ 1.0-r0/temp/run.license_create_manifest.26327:1 exit 1 from | ln -s ../${lic}/home/jiahongxu/yocto/build-20140120- yocto-qemux86-64/tmp/work/qemux86_64-poky-linux/core-image -base/1.0-r0/rootfs/usr/share/common-licenses/${pkg}/${lic} ... Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2014-02-11image.bbclass/license.bbclass: ajustment list_installed_packages invokingHongxu Jia
Since the list_installed_packages() function has refactored in python, do the necessary adjustments to license_create_manifes- t() and write_image_manifest() in license.bbclass and image.bb- class respectively; Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2013-12-18sstate: Get rid of crazy name mappingRichard Purdie
When originally developed, it was thought a task may have more than one associated sstate archive. The way the code has grown that idea is now not possible or needed. We can therefore assume one sstate archive per task and drop the crazy name mapping code. Simpler is better in this case. The downside is that various sstate archives will change name so this forces a cache rebuild. Given the other sstate changes going in at this time, this isn't really a bad thing as things would rebuild anyway. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-09license.bbclass: fix copying license directories failedHongxu Jia
For each recipe, it populated license files to ${LICENSE_DIRECTORY}/${PN}, such as kernel's license dir was ${LICENSE_DIRECTORY}/kernel-3.10.17-yocto-standard; In do_rootfs task, it copied license directories from ${LICENSE_DIRECTORY}/ ${pkg}, and ${pkg} was listed in ${INSTALLED_PKGS}; We got ${INSTALLED_PKGS} by rpm query, such as the kernel were 'kernel-*', but the kernel's PN was linux-yocto, so searching ${LICENSE_DIRECTORY}/ kernel-* failed. Copied license directories from ${LICENSE_DIRECTORY}/${PN} fixed this issue. [YOCTO #5572] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-11-20license.bbclass: fix missing of license files on ubuntu build hostChen Qi
The license_create_manifest function contains bashism, this will lead to unexpected results on ubuntu build host, as sh is linked to dash on ubuntu. Even if COPY_LIC_MANIFEST and COPY_LIC_DIRS are enabled, the license files will still be missing on target. This patch fixes the above problem. [YOCTO #5549] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-11-14classes/license: use "1" to set boolean variablesPaul Eggleton
The expected usage of COPY_LIC_MANIFEST and COPY_LIC_DIRS appears to be to set them to "1" to enable; however the test here is just testing whether they have a value at all, so setting them to "0" would also enable them which is somewhat disingenuous. Actually check if they are set to "1" instead in order to fix this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-14classes/license: fix commentsPaul Eggleton
It's LICENSE_FLAGS, LICENSE_FLAG is invalid. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12insane, license: Trap MalformedUrl exceptions when parsing LIC_FILES_CHKSUMPhil Blundell
bb.fetch.decodeurl() will throw if it doesn't like the look of the URL that it's given. (Bitbake's idea of what constitutes a valid URL is somewhat idiosyncratic so it is fairly easy to trip over this by mistake when writing a recipe.) If these exceptions are allowed to propagate all the way up to better_exec() then we will get a large amount of python stack trace spew when they are finally caught. Avoid that by catching them locally and throwing bb.build.FuncFailed() with a suitable explanation instead. Signed-off-by: Phil Blundell <philb@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04license.bbclass: use shutil instead of bb.utils.copyfileRoss Burton
bb.utils.copyfile is for a specific purpose and more complicated than needed here, so just use shutil.copyfile. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific ↵Richard Purdie
directory Currently we have a hierarchy of pkgdata directories and the code has to put together a search path and look through each in turn until it finds the data it needs. This has lead to a number of hardcoded paths and file globing which is unpredictable and undesirable. Worse, certain tricks that should be easy like a GL specific package architecture become problematic with the curretn search paths. With the modern sstate code, we can do better and construct a single pkgdata directory for each machine in just the same way as we do for the sysroot. This is already tried and well tested. With such a single directory, all the code that iterated through multiple pkgdata directories and simply be removed and give a significant simplification of the code. Even existing build directories adapt to the change well since the package contents doesn't change, just the location they're installed to and the stamp for them. The only complication is the we need a different shlibs directory for each multilib. These are only used by package.bbclass and the simple fix is to add MLPREFIX to the shlib directory name. This means the multilib packages will repackage and the sstate checksum will change but an existing build directory will adapt to the changes safely. It is close to release however I believe the benefits this patch give us are worth consideration for inclusion and give us more options for dealing with problems like the GL one. It also sets the ground work well for shlibs improvements in 1.6. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01meta: Don't use deprecated bitbake APIRichard Purdie
These have been deprecated for a long time, convert the remaining references to the correct modules and prepare for removal of the compatibility support from bitbake. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11license.bbclass: include all licenses in the manifestChristopher Larson
When we don't have a generic license file for the license in question, we can warn, but we should still include it in the manifest, otherwise the manifest doesn't reflect reality. Failing to include a license listed in the recipe in the manifest can't be allowed. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10classes/license: remove outdated commentPaul Eggleton
Package listing was implemented in the deb backend some time ago. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-01license: fix LICENSE_CREATE_PACKAGE to stay disabled by defaultMartin Jansa
* as reported by Enrico on #oe 11:06:50 < ensc|w> JaMa: might this be caused by dc78ef91a2bf01efb8028c9afbe69e506e016265 which checks for 'd.getVar('LICENSE_CREATE_PACKAGE', True)' evaluating to 'True' for every string (including the default 0) (From OE-Core rev: bc42585ad9ca3a9891459ec3234893dff420b95b) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-28license.bbclass: package license texts to PN-lic when LICENSE_CREATE_PACKAGE ↵Martin Jansa
is enabled [YOCTO #3743] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-28license.bbclass: extract functionality to find license files to separate ↵Martin Jansa
function * move it from do_populate_lic to find_license_files so we can reuse it to populate license in package itself [YOCTO #3743] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-18license.bbclass: cleanly handle invalid licenses in incompatible_licenseChristopher Larson
This gives us an error message (bb.fatal) rather than a traceback due to the uncaught LicenseError. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18license: correct re.search/fnmatch indentationChristopher Larson
This was causing it to only obey the last of the elements in INCOMPATIBLE_LICENSE. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-18license.bbclass: check LICENSE_pkg, not LICENSE_pn-pkgChristopher Larson
Recipes define the latter, as that's what goes into the binary packages, not the former. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-11base/license.bbclass: handle multiple INCOMPATIBLE_LICENSEsAndy Ross
Allow INCOMPATIBLE_LICENSE to be a whitespace-separated list of incompatible license strings and/or glob patterns. Also fix wildcarding: the string in INCOMPATIBLE_LICENSE was clearly intended to match with wildcards (e.g. "*GPLv3" to match both GPLv3 and LGPLv3), but this was broken because of a bug in return_spdx() which would die with a runtime error when there was no SPDXLICENSEMAP entry for the string. Signed-off-by: Andy Ross <andy.ross@windriver.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-07license.bbclass: Including locale packagesElizabeth Flanagan
As locale packages are installed on the image, we should be including them in the package/license manifest. This ensures that the manifests are accurate and complete. [ YOCTO #2461 ] Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-06license.bbclass: Avoid grep error messageMark Hatle
Touch a file that is later greped to make sure it exists. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-11-25license.bbclass: Collect LICENSE level packagesFlanagan, Elizabeth
Some bad logic in license.bbclass misses certain package level LICENSEs. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-19license: We need to run this task before do_build, there is no dependency on ↵Richard Purdie
do_package This change means we have more flexibility about when to schedule the license task and if it changes, we don't repackage everything (which is pointless). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-28license.conf/bbclass: Move globals to license.confElizabeth Flanagan
This requires the changes to bitbake.conf that allow parsing of license.conf. As we should now be parsing license.conf, we can move some globals out of license.bblcass and into the conf file. Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-09-28license.bbclass: Variable standardizationElizabeth Flanagan
The variable mentioned in license.conf is LICENSE_PATH. The variable used in license.bbclass is LICENSE_DIR. Conforming to what is in license.conf Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>