From 376c9a6993298571a7049d2203232830c9cd1f87 Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Fri, 8 Jun 2007 06:36:33 +0000 Subject: usermanual: Rename the sample in the recipes chapter from helloworld to myhelloworld since someone committed a helloworld recipe to OE and that's now where the documentation was saying to put this example. --- usermanual/chapters/recipes.xml | 204 ++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/usermanual/chapters/recipes.xml b/usermanual/chapters/recipes.xml index 8f9754b0a7..5672067af8 100644 --- a/usermanual/chapters/recipes.xml +++ b/usermanual/chapters/recipes.xml @@ -1079,11 +1079,11 @@ ${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}" it's a useful example because it doesn't depend on any of the helper classes which can sometime hide a lot of what is going on. - First we'll create the helloworld.c file and a readme file. We'll - place this in the files subdirectory, which is one of the places that is - searched for file:// URI's:mkdir packages/helloworld -mkdir pacakges/helloworld/files -cat > pacakges/helloworld/files/helloworld.c + First we'll create the myhelloworld.c file and a readme file. + We'll place this in the files subdirectory, which is one of the places + that is searched for file:// URI's:mkdir packages/myhelloworld +mkdir pacakges/myhelloworld/files +cat > pacakges/myhelloworld/files/myhelloworld.c #include <stdio.h> int main(int argc, char** argv) @@ -1092,11 +1092,11 @@ int main(int argc, char** argv) return 0; } ^D -cat > pacakges/helloworld/files/README.txt -Readme file for helloworld. +cat > pacakges/myhelloworld/files/README.txt +Readme file for myhelloworld. ^D - Now we have a directory for our recipe, packages/helloworld, and + Now we have a directory for our recipe, packages/myhelloworld, and we've created a files subdirectory in there to store our local files. We've created two local files, the C source code for our helloworld program and a readme file. Now we need to create the bitbake @@ -1104,11 +1104,11 @@ Readme file for helloworld. First we need the header section, which will contain a description of the package and the release number. We'll leave the other header - variables out for now:DESCRIPTION = "Hello world program" + variables out for now:DESCRIPTION = "My hello world program" PR = "r0" Next we need to tell it which files we want to be included in the - recipe, which we do via file:// URI's and the SRC_URI variable:SRC_URI = "file://helloworld.c \ + recipe, which we do via file:// URI's and the SRC_URI variable:SRC_URI = "file://myhelloworld.c \ file://README.txt" Note the use of the \ to continue a file and the file of file:// @@ -1119,7 +1119,7 @@ PR = "r0" the recipe and providing the appropriate commands: do_compile() { - ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/helloworld.c -o helloworld + ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/myhelloworld.c -o myhelloworld } Note the: @@ -1146,9 +1146,9 @@ PR = "r0" the destination directory so that it'll be packaged up correctly. This is done via the install task, so we need to define a do_install function in the recipe to describe how to install the package:do_install() { - install -m 0755 -d ${D}${bindir} ${D}${docdir}/helloworld - install -m 0644 ${S}/helloworld ${D}${bindir} - install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/helloworld + install -m 0755 -d ${D}${bindir} ${D}${docdir}/myhelloworld + install -m 0644 ${S}/myhelloworld ${D}${bindir} + install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/myhelloworld } Note the: @@ -1186,120 +1186,120 @@ PR = "r0" We'll consider this release 0 and version 0.1 of a program called - helloworld. So we'll name the recipe helloworld_0.1.bb:cat > packages/helloworld/helloworld_0.1.bb + helloworld. So we'll name the recipe myhelloworld_0.1.bb:cat > packages/myhelloworld/myhelloworld_0.1.bb DESCRIPTION = "Hello world program" PR = "r0" -SRC_URI = "file://helloworld.c \ +SRC_URI = "file://myhelloworld.c \ file://README.txt" do_compile() { - ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/helloworld.c -o helloworld + ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/myhelloworld.c -o myhelloworld } do_install() { - install -m 0755 -d ${D}${bindir} ${D}${docdir}/helloworld - install -m 0644 ${S}/helloworld ${D}${bindir} - install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/helloworld + install -m 0755 -d ${D}${bindir} ${D}${docdir}/myhelloworld + install -m 0644 ${S}/myhelloworld ${D}${bindir} + install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/myhelloworld } ^DNow we are ready to build our package, hopefully it'll all work - since it's such a simple example:~/oe%> bitbake -b packages/helloworld/helloworld_0.1.bb -NOTE: package helloworld-0.1: started -NOTE: package helloworld-0.1-r0: task do_fetch: started -NOTE: package helloworld-0.1-r0: task do_fetch: completed -NOTE: package helloworld-0.1-r0: task do_unpack: started -NOTE: Unpacking /home/lenehan/devel/oe/local-packages/helloworld/files/helloworld.c to /home/lenehan/devel/oe/build/titan-glibc-25/tmp/work/helloworld-0.1-r0/ -NOTE: Unpacking /home/lenehan/devel/oe/local-packages/helloworld/files/README.txt to /home/lenehan/devel/oe/build/titan-glibc-25/tmp/work/helloworld-0.1-r0/ -NOTE: package helloworld-0.1-r0: task do_unpack: completed -NOTE: package helloworld-0.1-r0: task do_patch: started -NOTE: package helloworld-0.1-r0: task do_patch: completed -NOTE: package helloworld-0.1-r0: task do_configure: started -NOTE: package helloworld-0.1-r0: task do_configure: completed -NOTE: package helloworld-0.1-r0: task do_compile: started -NOTE: package helloworld-0.1-r0: task do_compile: completed -NOTE: package helloworld-0.1-r0: task do_install: started -NOTE: package helloworld-0.1-r0: task do_install: completed -NOTE: package helloworld-0.1-r0: task do_package: started -NOTE: package helloworld-0.1-r0: task do_package: completed -NOTE: package helloworld-0.1-r0: task do_package_write: started -NOTE: Not creating empty archive for helloworld-dbg-0.1-r0 -Packaged contents of helloworld into /home/lenehan/devel/oe/build/titan-glibc-25/tmp/deploy/ipk/sh4/helloworld_0.1-r0_sh4.ipk -Packaged contents of helloworld-doc into /home/lenehan/devel/oe/build/titan-glibc-25/tmp/deploy/ipk/sh4/helloworld-doc_0.1-r0_sh4.ipk -NOTE: Not creating empty archive for helloworld-dev-0.1-r0 -NOTE: Not creating empty archive for helloworld-locale-0.1-r0 -NOTE: package helloworld-0.1-r0: task do_package_write: completed -NOTE: package helloworld-0.1-r0: task do_populate_staging: started -NOTE: package helloworld-0.1-r0: task do_populate_staging: completed -NOTE: package helloworld-0.1-r0: task do_build: started -NOTE: package helloworld-0.1-r0: task do_build: completed -NOTE: package helloworld-0.1: completed + since it's such a simple example:~/oe%> bitbake -b packages/myhelloworld/myhelloworld_0.1.bb +NOTE: package myhelloworld-0.1: started +NOTE: package myhelloworld-0.1-r0: task do_fetch: started +NOTE: package myhelloworld-0.1-r0: task do_fetch: completed +NOTE: package myhelloworld-0.1-r0: task do_unpack: started +NOTE: Unpacking /home/lenehan/devel/oe/local-packages/myhelloworld/files/helloworld.c to /home/lenehan/devel/oe/build/titan-glibc-25/tmp/work/myhelloworld-0.1-r0/ +NOTE: Unpacking /home/lenehan/devel/oe/local-packages/myhelloworld/files/README.txt to /home/lenehan/devel/oe/build/titan-glibc-25/tmp/work/myhelloworld-0.1-r0/ +NOTE: package myhelloworld-0.1-r0: task do_unpack: completed +NOTE: package myhelloworld-0.1-r0: task do_patch: started +NOTE: package myhelloworld-0.1-r0: task do_patch: completed +NOTE: package myhelloworld-0.1-r0: task do_configure: started +NOTE: package myhelloworld-0.1-r0: task do_configure: completed +NOTE: package myhelloworld-0.1-r0: task do_compile: started +NOTE: package myhelloworld-0.1-r0: task do_compile: completed +NOTE: package myhelloworld-0.1-r0: task do_install: started +NOTE: package myhelloworld-0.1-r0: task do_install: completed +NOTE: package myhelloworld-0.1-r0: task do_package: started +NOTE: package myhelloworld-0.1-r0: task do_package: completed +NOTE: package myhelloworld-0.1-r0: task do_package_write: started +NOTE: Not creating empty archive for myhelloworld-dbg-0.1-r0 +Packaged contents of myhelloworld into /home/lenehan/devel/oe/build/titan-glibc-25/tmp/deploy/ipk/sh4/myhelloworld_0.1-r0_sh4.ipk +Packaged contents of myhelloworld-doc into /home/lenehan/devel/oe/build/titan-glibc-25/tmp/deploy/ipk/sh4/myhelloworld-doc_0.1-r0_sh4.ipk +NOTE: Not creating empty archive for myhelloworld-dev-0.1-r0 +NOTE: Not creating empty archive for myhelloworld-locale-0.1-r0 +NOTE: package myhelloworld-0.1-r0: task do_package_write: completed +NOTE: package myhelloworld-0.1-r0: task do_populate_staging: started +NOTE: package myhelloworld-0.1-r0: task do_populate_staging: completed +NOTE: package myhelloworld-0.1-r0: task do_build: started +NOTE: package myhelloworld-0.1-r0: task do_build: completed +NOTE: package myhelloworld-0.1: completed Build statistics: Attempted builds: 1 ~/oe%> The package was successfully built, the output consists of two .ipkg files, which are ready to be installed on the target. One contains - the binary and the other contains the readme file:~/oe%> ls -l tmp/deploy/ipk/*/helloworld* --rw-r--r-- 1 lenehan lenehan 3040 Jan 12 14:46 tmp/deploy/ipk/sh4/helloworld_0.1-r0_sh4.ipk --rw-r--r-- 1 lenehan lenehan 768 Jan 12 14:46 tmp/deploy/ipk/sh4/helloworld-doc_0.1-r0_sh4.ipk + the binary and the other contains the readme file:~/oe%> ls -l tmp/deploy/ipk/*/myhelloworld* +-rw-r--r-- 1 lenehan lenehan 3040 Jan 12 14:46 tmp/deploy/ipk/sh4/myhelloworld_0.1-r0_sh4.ipk +-rw-r--r-- 1 lenehan lenehan 768 Jan 12 14:46 tmp/deploy/ipk/sh4/myhelloworld-doc_0.1-r0_sh4.ipk ~/oe%> It's worthwhile looking at the working directory to see where - various files ended up:~/oe%> find tmp/work/helloworld-0.1-r0 -tmp/work/helloworld-0.1-r0 -tmp/work/helloworld-0.1-r0/helloworld-0.1 -tmp/work/helloworld-0.1-r0/helloworld-0.1/patches -tmp/work/helloworld-0.1-r0/helloworld-0.1/helloworld -tmp/work/helloworld-0.1-r0/temp -tmp/work/helloworld-0.1-r0/temp/run.do_configure.21840 -tmp/work/helloworld-0.1-r0/temp/log.do_stage.21840 -tmp/work/helloworld-0.1-r0/temp/log.do_install.21840 -tmp/work/helloworld-0.1-r0/temp/log.do_compile.21840 -tmp/work/helloworld-0.1-r0/temp/run.do_stage.21840 -tmp/work/helloworld-0.1-r0/temp/log.do_configure.21840 -tmp/work/helloworld-0.1-r0/temp/run.do_install.21840 -tmp/work/helloworld-0.1-r0/temp/run.do_compile.21840 -tmp/work/helloworld-0.1-r0/install -tmp/work/helloworld-0.1-r0/install/helloworld-locale -tmp/work/helloworld-0.1-r0/install/helloworld-dbg -tmp/work/helloworld-0.1-r0/install/helloworld-dev -tmp/work/helloworld-0.1-r0/install/helloworld-doc -tmp/work/helloworld-0.1-r0/install/helloworld-doc/usr -tmp/work/helloworld-0.1-r0/install/helloworld-doc/usr/share -tmp/work/helloworld-0.1-r0/install/helloworld-doc/usr/share/doc -tmp/work/helloworld-0.1-r0/install/helloworld-doc/usr/share/doc/helloworld -tmp/work/helloworld-0.1-r0/install/helloworld-doc/usr/share/doc/helloworld/README.txt -tmp/work/helloworld-0.1-r0/install/helloworld -tmp/work/helloworld-0.1-r0/install/helloworld/usr -tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin -tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin/helloworld -tmp/work/helloworld-0.1-r0/image -tmp/work/helloworld-0.1-r0/image/usr -tmp/work/helloworld-0.1-r0/image/usr/bin -tmp/work/helloworld-0.1-r0/image/usr/share -tmp/work/helloworld-0.1-r0/image/usr/share/doc -tmp/work/helloworld-0.1-r0/image/usr/share/doc/helloworld -tmp/work/helloworld-0.1-r0/helloworld.c -tmp/work/helloworld-0.1-r0/README.txt + various files ended up:~/oe%> find tmp/work/myhelloworld-0.1-r0 +tmp/work/myhelloworld-0.1-r0 +tmp/work/myhelloworld-0.1-r0/myhelloworld-0.1 +tmp/work/myhelloworld-0.1-r0/myhelloworld-0.1/patches +tmp/work/myhelloworld-0.1-r0/myhelloworld-0.1/myhelloworld +tmp/work/myhelloworld-0.1-r0/temp +tmp/work/myhelloworld-0.1-r0/temp/run.do_configure.21840 +tmp/work/myhelloworld-0.1-r0/temp/log.do_stage.21840 +tmp/work/myhelloworld-0.1-r0/temp/log.do_install.21840 +tmp/work/myhelloworld-0.1-r0/temp/log.do_compile.21840 +tmp/work/myhelloworld-0.1-r0/temp/run.do_stage.21840 +tmp/work/myhelloworld-0.1-r0/temp/log.do_configure.21840 +tmp/work/myhelloworld-0.1-r0/temp/run.do_install.21840 +tmp/work/myhelloworld-0.1-r0/temp/run.do_compile.21840 +tmp/work/myhelloworld-0.1-r0/install +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-locale +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-dbg +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-dev +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc/usr +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc/usr/share +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc/usr/share/doc +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc/usr/share/doc/myhelloworld +tmp/work/myhelloworld-0.1-r0/install/myhelloworld-doc/usr/share/doc/myhelloworld/README.txt +tmp/work/myhelloworld-0.1-r0/install/myhelloworld +tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr +tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin +tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin/myhelloworld +tmp/work/myhelloworld-0.1-r0/image +tmp/work/myhelloworld-0.1-r0/image/usr +tmp/work/myhelloworld-0.1-r0/image/usr/bin +tmp/work/myhelloworld-0.1-r0/image/usr/share +tmp/work/myhelloworld-0.1-r0/image/usr/share/doc +tmp/work/myhelloworld-0.1-r0/image/usr/share/doc/myhelloworld +tmp/work/myhelloworld-0.1-r0/myhelloworld.c +tmp/work/myhelloworld-0.1-r0/README.txt ~/oe%>Things to note here are: The two source files are in tmp/work/helloworld-0.1-r0, which is the + role="bold">tmp/work/myhelloworld-0.1-r0, which is the working directory as specified via the ${WORKDIR} variable; There's logs of the various tasks in tmp/work/helloworld-0.1-r0/temp which you can - look at for more details on what was done in each task; + role="bold">tmp/work/myhelloworld-0.1-r0/temp which you + can look at for more details on what was done in each task; There's an image directory at tmp/work/helloworld-0.1-r0/image which + role="bold">tmp/work/myhelloworld-0.1-r0/image which contains just the directories that were to be packaged up. This is actually the destination directory, as specified via the ${D} variable. The two files that we @@ -1311,28 +1311,28 @@ tmp/work/helloworld-0.1-r0/README.txt The program was actually compiled in the tmp/work/helloworld-0.1-r0/helloworld-0.1 + role="bold">tmp/work/myhelloworld-0.1-r0/myhelloworld-0.1 directory, this is the source directory as specified via the ${S} variable. There's an install directory at tmp/work/helloworld-0.1-r0/install which + role="bold">tmp/work/myhelloworld-0.1-r0/install which contains the packages that were being generated and the files that - go in the package. So we can see that the helloworld-doc package + go in the package. So we can see that the myhelloworld-doc package contains the single file /usr/share/doc/helloworld/README.txt, the - helloworld package contains the single file /usr/bin/helloworld and the -dev, -dbg and + role="bold">/usr/share/doc/myhelloworld/README.txt, the + myhelloworld package contains the single file /usr/bin/myhelloworld and the -dev, -dbg and -local packages are all empty. At this stage it's good to verify that we really did produce a binary for the target and not for our host system. We can check that - with the file command:~/oe%> file tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin/helloworld -tmp/work/helloworld-0.1-r0/install/helloworld/usr/bin/helloworld: ELF 32-bit LSB executable, Hitachi SH, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped + with the file command:~/oe%> file tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin/myhelloworld +tmp/work/myhelloworld-0.1-r0/install/myhelloworld/usr/bin/myhelloworld: ELF 32-bit LSB executable, Hitachi SH, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped ~/oe%> file /bin/ls /bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped ~/oe%>This shows us that the helloworld program is for an SH @@ -3557,4 +3557,4 @@ which find - + \ No newline at end of file -- cgit 1.2.3-korg