diff options
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 1c89550c01..fa50832284 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -749,20 +749,50 @@ so that there are some definite steps on how to do this. I need more detail her | |||
749 | <section id="usingpoky-modifing-packages"> | 749 | <section id="usingpoky-modifing-packages"> |
750 | <title>Modifying Package Source Code</title> | 750 | <title>Modifying Package Source Code</title> |
751 | <para> | 751 | <para> |
752 | Although the Yocto Project is usually used to build software, you can use it to modify software. | 752 | Although the Yocto Project is typically used to build software, you might |
753 | find it helpful during development to modify the temporary package source code | ||
754 | found within the | ||
755 | <link linkend='yocto-project-build-directory'>Yocto Project's Build Directory</link>. | ||
756 | For example, suppose you are developing a patch and you need to experiment a bit | ||
757 | to figure out your solution. | ||
758 | After you have initially built the package, you can iteratively tweak the | ||
759 | source code, which is located in the Yocto Project build directory, and then | ||
760 | you can force a re-compile and test your altered code. | ||
761 | Once you settle on a solution, you can then copy the updated source code | ||
762 | to its more permanent location. | ||
753 | </para> | 763 | </para> |
754 | 764 | ||
755 | <para> | 765 | <para> |
756 | During a build, source is available in the | 766 | During a build, this temporary source code is available in the Yocto |
757 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-WORKDIR'>WORKDIR</ulink></filename> directory. | 767 | Project build directory, which is defined by the <filename>TMPDIR</filename> variable. |
758 | The actual location depends on the type of package and the architecture of the target device. | 768 | The actual location within the build directory |
759 | For a standard recipe not related to | 769 | for the package source code depends on the package name and |
760 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-MACHINE'>MACHINE</ulink></filename>, the location is | 770 | the architecture of the target device. |
761 | <filename>tmp/work/PACKAGE_ARCH-poky-TARGET_OS/PN-PV-PR/</filename>. | 771 | Here is the source code location for packages that are not target device-dependent: |
762 | For target device-dependent packages, you should use the <filename>MACHINE</filename> | 772 | <literallayout class='monospaced'> |
763 | variable instead of | 773 | ${TMPDIR}/work/${PACKAGE_ARCH}-poky-${TARGET_OS}/${PN}-${PV}-${PR} |
764 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PACKAGE_ARCH'>PACKAGE_ARCH</ulink></filename> | 774 | </literallayout> |
765 | in the directory name. | 775 | Assuming a Yocto Project Files top-level directory named <filename>poky</filename> |
776 | and a default Yocto Project build directory of <filename>poky/build</filename>, here | ||
777 | is an example temporary package source code location for the | ||
778 | <filename>v86d</filename> package: | ||
779 | <literallayout class='monospaced'> | ||
780 | ~/poky/build/tmp/work/qemux86-poky-linux/v86-01.9-r0 | ||
781 | </literallayout> | ||
782 | </para> | ||
783 | |||
784 | <para> | ||
785 | If your package is target device-dependent, the source code location varies slightly: | ||
786 | <literallayout class='monospaced'> | ||
787 | ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}-${PV}-${PR} | ||
788 | </literallayout> | ||
789 | Again, assuming a Yocto Project Files top-level directory named <filename>poky</filename> | ||
790 | and a default Yocto Project build directory of <filename>poky/build</filename>, here | ||
791 | is an example temporary package source code location for the | ||
792 | <filename>acl</filename> package that is dependent upon a MIPS-based device: | ||
793 | <literallayout class='monospaced'> | ||
794 | ~/poky/build/tmp/work/mips-poky-linux/acl-2.2.51-r2 | ||
795 | </literallayout> | ||
766 | </para> | 796 | </para> |
767 | 797 | ||
768 | <tip> | 798 | <tip> |
@@ -772,21 +802,19 @@ so that there are some definite steps on how to do this. I need more detail her | |||
772 | </tip> | 802 | </tip> |
773 | 803 | ||
774 | <para> | 804 | <para> |
775 | After building a package, you can modify the package source code without problems. | 805 | Once you have modified the package source code, the easiest way to test your changes |
776 | The easiest way to test your changes is by calling the | 806 | is by calling the <filename>compile</filename> task as shown in the following example: |
777 | <filename>compile</filename> task as shown in the following example: | ||
778 | <literallayout class='monospaced'> | 807 | <literallayout class='monospaced'> |
779 | $ bitbake -c compile -f NAME_OF_PACKAGE | 808 | $ bitbake -c compile -f <name_of_package> |
780 | </literallayout> | 809 | </literallayout> |
781 | </para> | 810 | </para> |
782 | 811 | ||
783 | <para> | 812 | <para> |
784 | The <filename>-f</filename> or <filename>--force</filename> | 813 | The <filename>-f</filename> or <filename>--force</filename> |
785 | option forces re-execution of the specified task. | 814 | option forces re-execution of the specified task. |
786 | You can call other tasks this way as well. | 815 | You can call other tasks this way as well. |
787 | But note that all the modifications in | 816 | <note>All the modifications you make to the temporary package source code |
788 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-WORKDIR'>WORKDIR</ulink></filename> | 817 | disappear once you <filename>-c clean</filename> for the package.</note> |
789 | are gone once you execute <filename>-c clean</filename> for a package. | ||
790 | </para> | 818 | </para> |
791 | </section> | 819 | </section> |
792 | 820 | ||