I am creating an image containing standard recipes and my owns. I wanted to list the licenses I use in all of the included packages and later check if I can use them for commercial application for example.
I had the bad surprise packagegroups have a LICENSE flag already. I noticed it doing:
bitbake -e -n -v core-image-minimal | grep "LICENSE"
It returns LICENSE=MIT since it is defined in the bb file.
But I have no information about all the included packages. This MIT has been put manually in the core-image-minimal.bb, but I'd be interested in all dependencies. I have the same issue for my .bb file.
Approach 1
A solution would be to put every license as INCOMPATIBLE_LICENSE and then
bitbake -k -n -e -v <recipe> | grep "incompatible with license"
then check which one pops out, add them in LICENSE_FLAGS_WHITELIST and removing them from INCOMPATIBLE_LICENSE and iterate. Problem is, each time it's done, it parses again the whole workspace, and it takes ages.
Is there a script somewhere to check that easily? A python one like Yocto always does.
Approach 2 I edited meta/classes/license.bbclass and added
bb.warn('%s license is %s' %(pn, licenses))
in the for loop of check_license_format function. Now it prints license for each package, but I'd like to have sort of sum up
Good way to do it
So, I couldn't compile my whole recipe since the "package-management" feature doesn't currently work with deb packages (read here). Please adapt your image recipe and use @Roman Khimov's method down there. It's the clean way to do it.