Tracking Licenses using LIC_FILES_CHKSUM in Yocto
License of an upstream may change in future. LIC_FILES_CHKSUM is used to avoid these changes getting unnoticed. In do_populate_lic stage, if checksums do not match, the build will fail.
To track the Licenses, the syntax is
LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx"
If your source code has the license information at the beginning, you can use beginline, endline:
LIC_FILES_CHKSUM = "file://hello.c; beginline=5;endline=10;md5=xxxx"
Let's understand by the sample hello world recipe present in poky/meta-skeleton/recipes-kernel/hello-mod/files
COPYING is the file here stores the license information for all the source files. To calculate md5 of the file, use 'md5sum filename' command. You can see from the above md5sum output and md5 value present in LIC_FILES_CHKSUM is same.
Let's see what happens if I modify 'COPYING' file and don't update the md5 value in LIC_FILES_CHKSUM filed of the recipe.
To track the Licenses, the syntax is
LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx"
If your source code has the license information at the beginning, you can use beginline, endline:
LIC_FILES_CHKSUM = "file://hello.c; beginline=5;endline=10;md5=xxxx"
Let's understand by the sample hello world recipe present in poky/meta-skeleton/recipes-kernel/hello-mod/files
COPYING is the file here stores the license information for all the source files. To calculate md5 of the file, use 'md5sum filename' command. You can see from the above md5sum output and md5 value present in LIC_FILES_CHKSUM is same.
Let's see what happens if I modify 'COPYING' file and don't update the md5 value in LIC_FILES_CHKSUM filed of the recipe.
That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
ReplyDeleteContracts App