bitbake-user-manual-hello.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  2. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  3. <appendix id='hello-world-example'>
  4. <title>Hello World Example</title>
  5. <section id='bitbake-hello-world'>
  6. <title>BitBake Hello World</title>
  7. <para>
  8. The simplest example commonly used to demonstrate any new
  9. programming language or tool is the
  10. "<ulink url="http://en.wikipedia.org/wiki/Hello_world_program">Hello World</ulink>"
  11. example.
  12. This appendix demonstrates, in tutorial form, Hello
  13. World within the context of BitBake.
  14. The tutorial describes how to create a new project
  15. and the applicable metadata files necessary to allow
  16. BitBake to build it.
  17. </para>
  18. </section>
  19. <section id='example-obtaining-bitbake'>
  20. <title>Obtaining BitBake</title>
  21. <para>
  22. See the
  23. "<link linkend='obtaining-bitbake'>Obtaining BitBake</link>"
  24. section for information on how to obtain BitBake.
  25. Once you have the source code on your machine, the BitBake directory
  26. appears as follows:
  27. <literallayout class='monospaced'>
  28. $ ls -al
  29. total 100
  30. drwxrwxr-x. 9 wmat wmat 4096 Jan 31 13:44 .
  31. drwxrwxr-x. 3 wmat wmat 4096 Feb 4 10:45 ..
  32. -rw-rw-r--. 1 wmat wmat 365 Nov 26 04:55 AUTHORS
  33. drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 bin
  34. drwxrwxr-x. 4 wmat wmat 4096 Jan 31 13:44 build
  35. -rw-rw-r--. 1 wmat wmat 16501 Nov 26 04:55 ChangeLog
  36. drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 classes
  37. drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 conf
  38. drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 contrib
  39. -rw-rw-r--. 1 wmat wmat 17987 Nov 26 04:55 COPYING
  40. drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 doc
  41. -rw-rw-r--. 1 wmat wmat 69 Nov 26 04:55 .gitignore
  42. -rw-rw-r--. 1 wmat wmat 849 Nov 26 04:55 HEADER
  43. drwxrwxr-x. 5 wmat wmat 4096 Jan 31 13:44 lib
  44. -rw-rw-r--. 1 wmat wmat 195 Nov 26 04:55 MANIFEST.in
  45. -rw-rw-r--. 1 wmat wmat 2887 Nov 26 04:55 TODO
  46. </literallayout>
  47. </para>
  48. <para>
  49. At this point, you should have BitBake cloned to
  50. a directory that matches the previous listing except for
  51. dates and user names.
  52. </para>
  53. </section>
  54. <section id='setting-up-the-bitbake-environment'>
  55. <title>Setting Up the BitBake Environment</title>
  56. <para>
  57. First, you need to be sure that you can run BitBake.
  58. Set your working directory to where your local BitBake
  59. files are and run the following command:
  60. <literallayout class='monospaced'>
  61. $ ./bin/bitbake --version
  62. BitBake Build Tool Core version 1.23.0, bitbake version 1.23.0
  63. </literallayout>
  64. The console output tells you what version you are running.
  65. </para>
  66. <para>
  67. The recommended method to run BitBake is from a directory of your
  68. choice.
  69. To be able to run BitBake from any directory, you need to add the
  70. executable binary to your binary to your shell's environment
  71. <filename>PATH</filename> variable.
  72. First, look at your current <filename>PATH</filename> variable
  73. by entering the following:
  74. <literallayout class='monospaced'>
  75. $ echo $PATH
  76. </literallayout>
  77. Next, add the directory location for the BitBake binary to the
  78. <filename>PATH</filename>.
  79. Here is an example that adds the
  80. <filename>/home/scott-lenovo/bitbake/bin</filename> directory
  81. to the front of the <filename>PATH</filename> variable:
  82. <literallayout class='monospaced'>
  83. $ export PATH=/home/scott-lenovo/bitbake/bin:$PATH
  84. </literallayout>
  85. You should now be able to enter the <filename>bitbake</filename>
  86. command from the command line while working from any directory.
  87. </para>
  88. </section>
  89. <section id='the-hello-world-example'>
  90. <title>The Hello World Example</title>
  91. <para>
  92. The overall goal of this exercise is to build a
  93. complete "Hello World" example utilizing task and layer
  94. concepts.
  95. Because this is how modern projects such as OpenEmbedded and
  96. the Yocto Project utilize BitBake, the example
  97. provides an excellent starting point for understanding
  98. BitBake.
  99. </para>
  100. <para>
  101. To help you understand how to use BitBake to build targets,
  102. the example starts with nothing but the <filename>bitbake</filename>
  103. command, which causes BitBake to fail and report problems.
  104. The example progresses by adding pieces to the build to
  105. eventually conclude with a working, minimal "Hello World"
  106. example.
  107. </para>
  108. <para>
  109. While every attempt is made to explain what is happening during
  110. the example, the descriptions cannot cover everything.
  111. You can find further information throughout this manual.
  112. Also, you can actively participate in the
  113. <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'></ulink>
  114. discussion mailing list about the BitBake build tool.
  115. </para>
  116. <note>
  117. This example was inspired by and drew heavily from
  118. <ulink url="http://www.mail-archive.com/yocto@yoctoproject.org/msg09379.html">Mailing List post - The BitBake equivalent of "Hello, World!"</ulink>.
  119. </note>
  120. <para>
  121. As stated earlier, the goal of this example
  122. is to eventually compile "Hello World".
  123. However, it is unknown what BitBake needs and what you have
  124. to provide in order to achieve that goal.
  125. Recall that BitBake utilizes three types of metadata files:
  126. <link linkend='configuration-files'>Configuration Files</link>,
  127. <link linkend='classes'>Classes</link>, and
  128. <link linkend='recipes'>Recipes</link>.
  129. But where do they go?
  130. How does BitBake find them?
  131. BitBake's error messaging helps you answer these types of questions
  132. and helps you better understand exactly what is going on.
  133. </para>
  134. <para>
  135. Following is the complete "Hello World" example.
  136. </para>
  137. <orderedlist>
  138. <listitem><para><emphasis>Create a Project Directory:</emphasis>
  139. First, set up a directory for the "Hello World" project.
  140. Here is how you can do so in your home directory:
  141. <literallayout class='monospaced'>
  142. $ mkdir ~/hello
  143. $ cd ~/hello
  144. </literallayout>
  145. This is the directory that BitBake will use to do all of
  146. its work.
  147. You can use this directory to keep all the metafiles needed
  148. by BitBake.
  149. Having a project directory is a good way to isolate your
  150. project.
  151. </para></listitem>
  152. <listitem><para><emphasis>Run BitBake:</emphasis>
  153. At this point, you have nothing but a project directory.
  154. Run the <filename>bitbake</filename> command and see what
  155. it does:
  156. <literallayout class='monospaced'>
  157. $ bitbake
  158. The BBPATH variable is not set and bitbake did not
  159. find a conf/bblayers.conf file in the expected location.
  160. Maybe you accidentally invoked bitbake from the wrong directory?
  161. DEBUG: Removed the following variables from the environment:
  162. GNOME_DESKTOP_SESSION_ID, XDG_CURRENT_DESKTOP,
  163. GNOME_KEYRING_CONTROL, DISPLAY, SSH_AGENT_PID, LANG, no_proxy,
  164. XDG_SESSION_PATH, XAUTHORITY, SESSION_MANAGER, SHLVL,
  165. MANDATORY_PATH, COMPIZ_CONFIG_PROFILE, WINDOWID, EDITOR,
  166. GPG_AGENT_INFO, SSH_AUTH_SOCK, GDMSESSION, GNOME_KEYRING_PID,
  167. XDG_SEAT_PATH, XDG_CONFIG_DIRS, LESSOPEN, DBUS_SESSION_BUS_ADDRESS,
  168. _, XDG_SESSION_COOKIE, DESKTOP_SESSION, LESSCLOSE, DEFAULTS_PATH,
  169. UBUNTU_MENUPROXY, OLDPWD, XDG_DATA_DIRS, COLORTERM, LS_COLORS
  170. </literallayout>
  171. The majority of this output is specific to environment variables
  172. that are not directly relevant to BitBake.
  173. However, the very first message regarding the
  174. <filename>BBPATH</filename> variable and the
  175. <filename>conf/bblayers.conf</filename> file
  176. is relevant.</para>
  177. <para>
  178. When you run BitBake, it begins looking for metadata files.
  179. The
  180. <link linkend='var-bb-BBPATH'><filename>BBPATH</filename></link>
  181. variable is what tells BitBake where to look for those files.
  182. <filename>BBPATH</filename> is not set and you need to set it.
  183. Without <filename>BBPATH</filename>, BitBake cannot
  184. find any configuration files (<filename>.conf</filename>)
  185. or recipe files (<filename>.bb</filename>) at all.
  186. BitBake also cannot find the <filename>bitbake.conf</filename>
  187. file.
  188. </para></listitem>
  189. <listitem><para><emphasis>Setting <filename>BBPATH</filename>:</emphasis>
  190. For this example, you can set <filename>BBPATH</filename>
  191. in the same manner that you set <filename>PATH</filename>
  192. earlier in the appendix.
  193. You should realize, though, that it is much more flexible to set the
  194. <filename>BBPATH</filename> variable up in a configuration
  195. file for each project.</para>
  196. <para>From your shell, enter the following commands to set and
  197. export the <filename>BBPATH</filename> variable:
  198. <literallayout class='monospaced'>
  199. $ BBPATH="<replaceable>projectdirectory</replaceable>"
  200. $ export BBPATH
  201. </literallayout>
  202. Use your actual project directory in the command.
  203. BitBake uses that directory to find the metadata it needs for
  204. your project.
  205. <note>
  206. When specifying your project directory, do not use the
  207. tilde ("~") character as BitBake does not expand that character
  208. as the shell would.
  209. </note>
  210. </para></listitem>
  211. <listitem><para><emphasis>Run BitBake:</emphasis>
  212. Now that you have <filename>BBPATH</filename> defined, run
  213. the <filename>bitbake</filename> command again:
  214. <literallayout class='monospaced'>
  215. $ bitbake
  216. ERROR: Traceback (most recent call last):
  217. File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
  218. return func(fn, *args)
  219. File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 173, in parse_config_file
  220. return bb.parse.handle(fn, data, include)
  221. File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 99, in handle
  222. return h['handle'](fn, data, include)
  223. File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 120, in handle
  224. abs_fn = resolve_file(fn, data)
  225. File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 117, in resolve_file
  226. raise IOError("file %s not found in %s" % (fn, bbpath))
  227. IOError: file conf/bitbake.conf not found in /home/scott-lenovo/hello
  228. ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in /home/scott-lenovo/hello
  229. </literallayout>
  230. This sample output shows that BitBake could not find the
  231. <filename>conf/bitbake.conf</filename> file in the project
  232. directory.
  233. This file is the first thing BitBake must find in order
  234. to build a target.
  235. And, since the project directory for this example is
  236. empty, you need to provide a <filename>conf/bitbake.conf</filename>
  237. file.
  238. </para></listitem>
  239. <listitem><para><emphasis>Creating <filename>conf/bitbake.conf</filename>:</emphasis>
  240. The <filename>conf/bitbake.conf</filename> includes a number of
  241. configuration variables BitBake uses for metadata and recipe
  242. files.
  243. For this example, you need to create the file in your project directory
  244. and define some key BitBake variables.
  245. For more information on the <filename>bitbake.conf</filename> file,
  246. see
  247. <ulink url='http://git.openembedded.org/bitbake/tree/conf/bitbake.conf'></ulink>.
  248. </para>
  249. <para>Use the following commands to create the <filename>conf</filename>
  250. directory in the project directory:
  251. <literallayout class='monospaced'>
  252. $ mkdir conf
  253. </literallayout>
  254. From within the <filename>conf</filename> directory, use
  255. some editor to create the <filename>bitbake.conf</filename>
  256. so that it contains the following:
  257. <literallayout class='monospaced'>
  258. <link linkend='var-bb-PN'>PN</link> = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
  259. </literallayout>
  260. <literallayout class='monospaced'>
  261. TMPDIR = "${<link linkend='var-bb-TOPDIR'>TOPDIR</link>}/tmp"
  262. <link linkend='var-bb-CACHE'>CACHE</link> = "${TMPDIR}/cache"
  263. <link linkend='var-bb-STAMP'>STAMP</link> = "${TMPDIR}/${PN}/stamps"
  264. <link linkend='var-bb-T'>T</link> = "${TMPDIR}/${PN}/work"
  265. <link linkend='var-bb-B'>B</link> = "${TMPDIR}/${PN}"
  266. </literallayout>
  267. <note>
  268. Without a value for <filename>PN</filename>, the
  269. variables <filename>STAMP</filename>,
  270. <filename>T</filename>, and <filename>B</filename>,
  271. prevent more than one recipe from working. You can fix
  272. this by either setting <filename>PN</filename> to have
  273. a value similar to what OpenEmbedded and BitBake use
  274. in the default <filename>bitbake.conf</filename> file
  275. (see previous example). Or, by manually updating each
  276. recipe to set <filename>PN</filename>. You will also
  277. need to include <filename>PN</filename> as part of the
  278. <filename>STAMP</filename>, <filename>T</filename>, and
  279. <filename>B</filename> variable definitions in the
  280. <filename>local.conf</filename> file.
  281. </note>
  282. The <filename>TMPDIR</filename> variable establishes a directory
  283. that BitBake uses for build output and intermediate files other
  284. than the cached information used by the
  285. <link linkend='setscene'>Setscene</link> process.
  286. Here, the <filename>TMPDIR</filename> directory is set to
  287. <filename>hello/tmp</filename>.
  288. <note><title>Tip</title>
  289. You can always safely delete the <filename>tmp</filename>
  290. directory in order to rebuild a BitBake target.
  291. The build process creates the directory for you
  292. when you run BitBake.
  293. </note></para>
  294. <para>For information about each of the other variables defined in this
  295. example, click on the links to take you to the definitions in
  296. the glossary.
  297. </para></listitem>
  298. <listitem><para><emphasis>Run BitBake:</emphasis>
  299. After making sure that the <filename>conf/bitbake.conf</filename>
  300. file exists, you can run the <filename>bitbake</filename>
  301. command again:
  302. <literallayout class='monospaced'>
  303. $ bitbake
  304. ERROR: Traceback (most recent call last):
  305. File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
  306. return func(fn, *args)
  307. File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
  308. bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
  309. File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
  310. include(fn, file, lineno, d, "inherit")
  311. File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
  312. raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
  313. ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
  314. ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
  315. </literallayout>
  316. In the sample output, BitBake could not find the
  317. <filename>classes/base.bbclass</filename> file.
  318. You need to create that file next.
  319. </para></listitem>
  320. <listitem><para><emphasis>Creating <filename>classes/base.bbclass</filename>:</emphasis>
  321. BitBake uses class files to provide common code and functionality.
  322. The minimally required class for BitBake is the
  323. <filename>classes/base.bbclass</filename> file.
  324. The <filename>base</filename> class is implicitly inherited by
  325. every recipe.
  326. BitBake looks for the class in the <filename>classes</filename>
  327. directory of the project (i.e <filename>hello/classes</filename>
  328. in this example).
  329. </para>
  330. <para>Create the <filename>classes</filename> directory as follows:
  331. <literallayout class='monospaced'>
  332. $ cd $HOME/hello
  333. $ mkdir classes
  334. </literallayout>
  335. Move to the <filename>classes</filename> directory and then
  336. create the <filename>base.bbclass</filename> file by inserting
  337. this single line:
  338. <literallayout class='monospaced'>
  339. addtask build
  340. </literallayout>
  341. The minimal task that BitBake runs is the
  342. <filename>do_build</filename> task.
  343. This is all the example needs in order to build the project.
  344. Of course, the <filename>base.bbclass</filename> can have much
  345. more depending on which build environments BitBake is
  346. supporting.
  347. </para></listitem>
  348. <listitem><para><emphasis>Run BitBake:</emphasis>
  349. After making sure that the <filename>classes/base.bbclass</filename>
  350. file exists, you can run the <filename>bitbake</filename>
  351. command again:
  352. <literallayout class='monospaced'>
  353. $ bitbake
  354. Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
  355. </literallayout>
  356. BitBake is finally reporting no errors.
  357. However, you can see that it really does not have anything
  358. to do.
  359. You need to create a recipe that gives BitBake something to do.
  360. </para></listitem>
  361. <listitem><para><emphasis>Creating a Layer:</emphasis>
  362. While it is not really necessary for such a small example,
  363. it is good practice to create a layer in which to keep your
  364. code separate from the general metadata used by BitBake.
  365. Thus, this example creates and uses a layer called "mylayer".
  366. <note>
  367. You can find additional information on layers in the
  368. "<link linkend='layers'>Layers</link>" section.
  369. </note></para>
  370. <para>Minimally, you need a recipe file and a layer configuration
  371. file in your layer.
  372. The configuration file needs to be in the <filename>conf</filename>
  373. directory inside the layer.
  374. Use these commands to set up the layer and the <filename>conf</filename>
  375. directory:
  376. <literallayout class='monospaced'>
  377. $ cd $HOME
  378. $ mkdir mylayer
  379. $ cd mylayer
  380. $ mkdir conf
  381. </literallayout>
  382. Move to the <filename>conf</filename> directory and create a
  383. <filename>layer.conf</filename> file that has the following:
  384. <literallayout class='monospaced'>
  385. BBPATH .= ":${<link linkend='var-bb-LAYERDIR'>LAYERDIR</link>}"
  386. <link linkend='var-bb-BBFILES'>BBFILES</link> += "${LAYERDIR}/*.bb"
  387. <link linkend='var-bb-BBFILE_COLLECTIONS'>BBFILE_COLLECTIONS</link> += "mylayer"
  388. <link linkend='var-bb-BBFILE_PATTERN'>BBFILE_PATTERN_mylayer</link> := "^${LAYERDIR_RE}/"
  389. </literallayout>
  390. For information on these variables, click the links
  391. to go to the definitions in the glossary.</para>
  392. <para>You need to create the recipe file next.
  393. Inside your layer at the top-level, use an editor and create
  394. a recipe file named <filename>printhello.bb</filename> that
  395. has the following:
  396. <literallayout class='monospaced'>
  397. <link linkend='var-bb-DESCRIPTION'>DESCRIPTION</link> = "Prints Hello World"
  398. <link linkend='var-bb-PN'>PN</link> = 'printhello'
  399. <link linkend='var-bb-PV'>PV</link> = '1'
  400. python do_build() {
  401. bb.plain("********************");
  402. bb.plain("* *");
  403. bb.plain("* Hello, World! *");
  404. bb.plain("* *");
  405. bb.plain("********************");
  406. }
  407. </literallayout>
  408. The recipe file simply provides a description of the
  409. recipe, the name, version, and the <filename>do_build</filename>
  410. task, which prints out "Hello World" to the console.
  411. For more information on these variables, follow the links
  412. to the glossary.
  413. </para></listitem>
  414. <listitem><para><emphasis>Run BitBake With a Target:</emphasis>
  415. Now that a BitBake target exists, run the command and provide
  416. that target:
  417. <literallayout class='monospaced'>
  418. $ cd $HOME/hello
  419. $ bitbake printhello
  420. ERROR: no recipe files to build, check your BBPATH and BBFILES?
  421. Summary: There was 1 ERROR message shown, returning a non-zero exit code.
  422. </literallayout>
  423. We have created the layer with the recipe and the layer
  424. configuration file but it still seems that BitBake cannot
  425. find the recipe.
  426. BitBake needs a <filename>conf/bblayers.conf</filename> that
  427. lists the layers for the project.
  428. Without this file, BitBake cannot find the recipe.
  429. </para></listitem>
  430. <listitem><para><emphasis>Creating <filename>conf/bblayers.conf</filename>:</emphasis>
  431. BitBake uses the <filename>conf/bblayers.conf</filename> file
  432. to locate layers needed for the project.
  433. This file must reside in the <filename>conf</filename> directory
  434. of the project (i.e. <filename>hello/conf</filename> for this
  435. example).</para>
  436. <para>Set your working directory to the <filename>hello/conf</filename>
  437. directory and then create the <filename>bblayers.conf</filename>
  438. file so that it contains the following:
  439. <literallayout class='monospaced'>
  440. BBLAYERS ?= " \
  441. /home/&lt;you&gt;/mylayer \
  442. "
  443. </literallayout>
  444. You need to provide your own information for
  445. <filename>you</filename> in the file.
  446. </para></listitem>
  447. <listitem><para><emphasis>Run BitBake With a Target:</emphasis>
  448. Now that you have supplied the <filename>bblayers.conf</filename>
  449. file, run the <filename>bitbake</filename> command and provide
  450. the target:
  451. <literallayout class='monospaced'>
  452. $ bitbake printhello
  453. Parsing recipes: 100% |##################################################################################|
  454. Time: 00:00:00
  455. Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
  456. NOTE: Resolving any missing task queue dependencies
  457. NOTE: Preparing RunQueue
  458. NOTE: Executing RunQueue Tasks
  459. ********************
  460. * *
  461. * Hello, World! *
  462. * *
  463. ********************
  464. NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
  465. </literallayout>
  466. BitBake finds the <filename>printhello</filename> recipe and
  467. successfully runs the task.
  468. <note>
  469. After the first execution, re-running
  470. <filename>bitbake printhello</filename> again will not
  471. result in a BitBake run that prints the same console
  472. output.
  473. The reason for this is that the first time the
  474. <filename>printhello.bb</filename> recipe's
  475. <filename>do_build</filename> task executes
  476. successfully, BitBake writes a stamp file for the task.
  477. Thus, the next time you attempt to run the task
  478. using that same <filename>bitbake</filename> command,
  479. BitBake notices the stamp and therefore determines
  480. that the task does not need to be re-run.
  481. If you delete the <filename>tmp</filename> directory
  482. or run <filename>bitbake -c clean printhello</filename>
  483. and then re-run the build, the "Hello, World!" message will
  484. be printed again.
  485. </note>
  486. </para></listitem>
  487. </orderedlist>
  488. </section>
  489. </appendix>