summaryrefslogtreecommitdiffstats
path: root/documentation/poky-ref-manual/technical-details.xml
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/poky-ref-manual/technical-details.xml')
-rw-r--r--documentation/poky-ref-manual/technical-details.xml159
1 files changed, 159 insertions, 0 deletions
diff --git a/documentation/poky-ref-manual/technical-details.xml b/documentation/poky-ref-manual/technical-details.xml
index 9e40a66008..965d967b05 100644
--- a/documentation/poky-ref-manual/technical-details.xml
+++ b/documentation/poky-ref-manual/technical-details.xml
@@ -568,6 +568,165 @@
568 </section> 568 </section>
569</section> 569</section>
570 570
571<section id="licenses">
572 <title>Licenses</title>
573
574 <para>
575 This section describes the mechanism by which the Yocto Project build system
576 tracks changes to licensing text.
577 The section also describes how to enable commercially licensed receipes,
578 which by default are disabled.
579 </para>
580
581 <section id="usingpoky-configuring-LIC_FILES_CHKSUM">
582 <title>Tracking License Changes</title>
583
584 <para>
585 The license of an upstream project might change in the future. In order to prevent these changes
586 going unnoticed, the Yocto Project provides a
587 <filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link></filename>
588 variable to track changes to the license text. The checksums are validated at the end of the
589 configure step, and if the checksums do not match, the build will fail.
590 </para>
591
592 <section id="usingpoky-specifying-LIC_FILES_CHKSUM">
593 <title>Specifying the <filename>LIC_FILES_CHKSUM</filename> Variable</title>
594
595 <para>
596 The <filename>LIC_FILES_CHKSUM</filename>
597 variable contains checksums of the license text in the source code for the recipe.
598 Following is an example of how to specify <filename>LIC_FILES_CHKSUM</filename>:
599 <literallayout class='monospaced'>
600 LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
601 file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
602 file://licfile2.txt;endline=50;md5=zzzz \
603 ..."
604 </literallayout>
605 </para>
606
607 <para>
608 The Yocto Project uses the
609 <filename><link linkend='var-S'>S</link></filename> variable as the
610 default directory used when searching files listed in
611 <filename>LIC_FILES_CHKSUM</filename>.
612 The previous example employs the default directory.
613 </para>
614
615 <para>
616 You can also use relative paths as shown in the following example:
617 <literallayout class='monospaced'>
618 LIC_FILES_CHKSUM = "file://src/ls.c;startline=5;endline=16;\
619 md5=bb14ed3c4cda583abc85401304b5cd4e"
620 LIC_FILES_CHKSUM = "file://../license.html;md5=5c94767cedb5d6987c902ac850ded2c6"
621 </literallayout>
622 </para>
623
624 <para>
625 In this example, the first line locates a file in
626 <filename><link linkend='var-S'>S</link>/src/ls.c</filename>.
627 The second line refers to a file in
628 <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, which is the parent
629 of <filename>S</filename>.
630 </para>
631 <para>
632 Note that this variable is mandatory for all recipes, unless the
633 <filename>LICENSE</filename> variable is set to "CLOSED".
634 </para>
635 </section>
636
637 <section id="usingpoky-LIC_FILES_CHKSUM-explanation-of-syntax">
638 <title>Explanation of Syntax</title>
639 <para>
640 As mentioned in the previous section, the
641 <filename>LIC_FILES_CHKSUM</filename> variable lists all the
642 important files that contain the license text for the source code.
643 It is possible to specify a checksum for an entire file, or a specific section of a
644 file (specified by beginning and ending line numbers with the "beginline" and "endline"
645 parameters, respectively).
646 The latter is useful for source files with a license notice header,
647 README documents, and so forth.
648 If you do not use the "beginline" parameter, then it is assumed that the text begins on the
649 first line of the file.
650 Similarly, if you do not use the "endline" parameter, it is assumed that the license text
651 ends with the last line of the file.
652 </para>
653
654 <para>
655 The "md5" parameter stores the md5 checksum of the license text.
656 If the license text changes in any way as compared to this parameter
657 then a mismatch occurs.
658 This mismatch triggers a build failure and notifies the developer.
659 Notification allows the developer to review and address the license text changes.
660 Also note that if a mismatch occurs during the build, the correct md5
661 checksum is placed in the build log and can be easily copied to the recipe.
662 </para>
663
664 <para>
665 There is no limit to how many files you can specify using the
666 <filename>LIC_FILES_CHKSUM</filename> variable.
667 Generally, however, every project requires a few specifications for license tracking.
668 Many projects have a "COPYING" file that stores the license information for all the source
669 code files.
670 This practice allows you to just track the "COPYING" file as long as it is kept up to date.
671 </para>
672
673 <tip>
674 If you specify an empty or invalid "md5" parameter, BitBake returns an md5 mis-match
675 error and displays the correct "md5" parameter value during the build.
676 The correct parameter is also captured in the build log.
677 </tip>
678
679 <tip>
680 If the whole file contains only license text, you do not need to use the "beginline" and
681 "endline" parameters.
682 </tip>
683 </section>
684 </section>
685
686 <section id="enabling-commercially-licensed-recipes">
687 <title>Enabling Commercially Licensed Recipes</title>
688
689 <para>
690 By default, the Yocto Project build system disables components that
691 have commercial licensing requirements.
692 The following four statements in the
693 <filename>$HOME/poky/meta/conf/distro/poky.conf</filename> file
694 disable components:
695 <literallayout class='monospaced'>
696 COMMERCIAL_LICENSE ?= "lame gst-fluendo-mp3 libmad mpeg2dec ffmpeg qmmp"
697 COMMERCIAL_AUDIO_PLUGINS ?= ""
698 COMMERCIAL_VIDEO_PLUGINS ?= ""
699 COMMERCIAL_QT ?= "qmmp"
700 </literallayout>
701 </para>
702
703 <para>
704 If you want to enable these components, you can do so by making sure you have
705 the following statements in the configuration file:
706 <literallayout class='monospaced'>
707 COMMERCIAL_AUDIO_PLUGINS = "gst-plugins-ugly-mad \
708 gst-plugins-ugly-mpegaudioparse"
709 COMMERCIAL_VIDEO_PLUGINS = "gst-plugins-ugly-mpeg2dec \
710 gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse"
711 COMMERCIAL_LICENSE = ""
712 COMMERCIAL_QT = ""
713 </literallayout>
714 </para>
715
716 <para>
717 Excluding a package name from the
718 <filename>COMMERCIAL_LICENSE</filename> or
719 <filename>COMMERCIAL_QT</filename> statement enables that package.
720 </para>
721
722 <para>
723 Specifying audio and video plug-ins as part of the
724 <filename>COMMERCIAL_AUDIO_PLUGINS</filename> and
725 <filename>COMMERCIAL_VIDEO_PLUGINS</filename> statements includes
726 the plug-ins into built images - thus adding support for media formats.
727 </para>
728 </section>
729</section>
571</chapter> 730</chapter>
572<!-- 731<!--
573vim: expandtab tw=80 ts=4 732vim: expandtab tw=80 ts=4