From 0daf901b5be2c1e3ac7e4c274b293e4679ecc10d Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Thu, 20 Feb 2020 21:27:33 +0100 Subject: ref-manual: Add a tips on how to achieve whitelisting of licenses It is sometimes more appropriate to define the licenses that are allowed to be used rather than the ones that are not permitted. This adds a tips on how this can be achieved by using AVAILABLE_LICENSES and some Python set arithmetics. (From yocto-docs rev: dd26d8a9f89402a9828bf02f2e65054d4c0f406f) Signed-off-by: Peter Kjellerstedt Signed-off-by: Richard Purdie --- documentation/ref-manual/ref-variables.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'documentation/ref-manual/ref-variables.xml') diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml index 9e6d37ec0d..7ab37de317 100644 --- a/documentation/ref-manual/ref-variables.xml +++ b/documentation/ref-manual/ref-variables.xml @@ -6774,6 +6774,25 @@ components that are required to produce a functional system image. + + Tips + It is possible to define a list of licenses that are allowed + to be used instead of the licenses that are excluded. To do + this, define a + variable COMPATIBLE_LICENSES with the + names of the licences that are allowed. Then + define INCOMPATIBLE_LICENSE as: + + INCOMPATIBLE_LICENSE = "${@' '.join(sorted(set(d.getVar('AVAILABLE_LICENSES').split()) - set(d.getVar('COMPATIBLE_LICENSES').split())))}" + + This will result + in INCOMPATIBLE_LICENSE containing the + names of all licences + from AVAILABLE_LICENSES + except the ones specified + in COMPATIBLE_LICENSES, thus only + allowing the latter licences to be used. + -- cgit v1.2.3-54-g00ecf