From 4a0f7440a05848f4b2414fdbb0031cc69cdb2a9d Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 16 Sep 2011 09:20:09 -0700 Subject: [PATCH] documentation/yocto-project-qs/yocto-project-qs.xml: General edits This was a final scrub of the manual. I updated all examples and links to be current for what I think will be the 1.1 release. I also added some cross-referencing into the YP dev manual that now exist. (From yocto-docs rev: 4c10b0e04856817a1d03aee7a9ed6e4d5d73a3ac) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../yocto-project-qs/yocto-project-qs.xml | 387 ++++++++++-------- 1 file changed, 215 insertions(+), 172 deletions(-) diff --git a/documentation/yocto-project-qs/yocto-project-qs.xml b/documentation/yocto-project-qs/yocto-project-qs.xml index c95e1a02ab..fbc8f2251a 100644 --- a/documentation/yocto-project-qs/yocto-project-qs.xml +++ b/documentation/yocto-project-qs/yocto-project-qs.xml @@ -21,7 +21,7 @@ This short document will give you some basic information about the environment as well as let you experience it in its simplest form. - After reading this document you will have a basic understanding of what the Yocto Project is + After reading this document, you will have a basic understanding of what the Yocto Project is and how to use some of its core components. This document steps you through a simple example showing you how to build a small image and run it using the QEMU emulator. @@ -29,7 +29,8 @@ For complete information on the Yocto Project, you should check out the Yocto Project Website. - You can find the latest builds, breaking news, full development documentation, and a + Through the website, you can find the latest builds, breaking news, full development + documentation, and a rich Yocto Project Development Community into which you can tap. @@ -74,7 +75,7 @@ - Yocto Project: + Here are some highlights for the Yocto Project: @@ -85,7 +86,7 @@ Makes available system components such as X11, Matchbox, GTK+, Pimlico, Clutter, GuPNP and Qt (among others) so you can create a richer user interface experience on devices that use displays or have a GUI. - For devices that don't have a GUI or display you simply would not employ these + For devices that don't have a GUI or display, you simply would not employ these components. @@ -100,9 +101,9 @@ The Yocto Project can generate images for many kinds of devices. - However, the standard example machines target QEMU full system emulation for x86, ARM, MIPS, - and PPC-based architectures as well as specific hardware such as the Intel Desktop Board - DH55TC. + However, the standard example machines target QEMU full-system emulation for x86, x86-64, ARM, MIPS, + and PPC-based architectures as well as specific hardware such as the + Intel Desktop Board DH55TC. Because an image developed with the Yocto Project can boot inside a QEMU emulator, the development environment works nicely as a test platform for developing embedded software. @@ -113,7 +114,7 @@ restricted screen sizes, sits neatly on top of a device using the GNOME Mobile Stack and provides a well-defined user experience. Implemented in its own layer, it makes it clear to developers how they can implement - their own UIs on top of Yocto Linux. + their own user interface on top of Yocto Linux. @@ -186,7 +187,7 @@ - If you are using a Fedora version prior to version 15 you will need to take some + If you are using a Fedora version prior to version 15, you will need to take some extra steps to enable sudo. See for details. @@ -232,7 +233,7 @@ Yocto Project Release - You can download the latest release images for the Yocto Project on the + You can download the latest Yocto Project release by going to the Yocto Project Download page. Just go to the page and click the "Yocto Downloads" link found in the "Download" navigation pane to the right to view all available Yocto Project releases. @@ -242,6 +243,17 @@ . However, for this document a released version of Yocto Project is used. + + + You can also get the Yocto Project files by setting up a Git repository on your host + development system. + Doing so allows you to contribute back to the project. + For information on how to get set up using this method, see the + "Yocto + Project Release" item in + The Yocto Project + Development Manual. + @@ -249,16 +261,16 @@ A Quick Test Run - Now that you have your system requirements in order you can give Yocto Project a try. + Now that you have your system requirements in order, you can give Yocto Project a try. This section presents some steps that let you do the following: - Build an image and run it in the emulator + Build an image and run it in the QEMU emulator - Or, use a pre-built image and run it in the emulator + Or, use a pre-built image and run it in the QEMU emulator @@ -266,7 +278,8 @@ Building an Image - In the development environment you will need to build an image whenever you change hardware support, add or change system libraries, or add or change services that have dependencies. + In the development environment you will need to build an image whenever you change hardware + support, add or change system libraries, or add or change services that have dependencies. @@ -302,15 +315,17 @@ - $ wget http://www.yoctoproject.org/downloads/poky/poky-bernard-5.0.1.tar.bz2 - $ tar xjf poky-bernard-5.0.1.tar.bz2 - $ source poky-bernard-5.0.1/poky-init-build-env poky-5.0.1-build + $ wget http://www.yoctoproject.org/downloads/poky/poky-einstein-6.0.tar.bz2 + $ tar xjf poky-einstein-6.0.tar.bz2 + $ source poky-einstein-6.0/oe-init-build-env einstein-6.0-build - To help conserve disk space during builds you can add the following statement - to your local.conf file. + To help conserve disk space during builds, you can add the following statement + to your local.conf file in the Yocto Project build + directory, which for this example + is einstein-6.0-build. Adding this statement deletes the work directory used for building a package once the package is built. @@ -319,25 +334,55 @@ - The first two commands extract the Yocto Project files from the - release tarball and place them into a subdirectory of your current directory. - The source command creates the - poky-5.0.1-build directory and executes the cd - command to make poky-5.0.1-build the working directory. - The resulting build directory contains all the files created during the build. - By default the target architecture is qemux86. - To change this default, edit the value of the MACHINE variable in the - conf/local.conf file. + The first command retrieves the Yocto Project release tarball from the + source repositories. + Notice, the example uses the wget shell command. + Alternatively, you can go to the + Yocto Project website downloads + area to retrieve the tarball. + The second command extracts the files from the tarball and places + them into a directory named poky-einstein-6.0 in the current + directory. + + The third command runs the Yocto Project environment setup script. + Running this script defines Yocto Project build environment settings needed to + complete the build. + The script also creates the Yocto Project + build directory, which is einstein-6.0-build in this case. + After the script runs, your current working directory is set + to the build directory. + Later, when the build completes, the build directory contains all the files + created during the build. + Take some time to examine your conf/local.conf file found in the - Yocto Project file's conf. - The defaults should work fine. - However, if you have a multi-core CPU you might want to set the variable - BB_NUMBER_THREADS equal to twice the number of processor cores your system has. - And, set the variable PARALLEL_MAKE equal to the number of processor cores. + Yocto Project build directory. + The defaults in the local.conf should work fine. + However, there are some variables of interest at which you might look. + + + + By default, the target architecture for the build is qemux86, + which is an image that can be used in the QEMU emulator and is targeted for an + Intel 32-bit based architecture. + To change this default, edit the value of the MACHINE variable in the + conf/local.conf file in the build directory before + launching the build. + + + + Another couple of variables of interest are the + BB_NUMBER_THREADS and the + PARALLEL_MAKE variables. + By default, these variables are commented out. + However, if you have a multi-core CPU you might want to remove the comment + and set the variable + BB_NUMBER_THREADS equal to twice the number of your + host's processor cores. + Also, you could set the variable PARALLEL_MAKE equal to the number + of processor cores. Setting these variables can significantly shorten your build time. - By default, these variables are commented out. @@ -345,9 +390,9 @@ the image. By default, the Yocto Project build system uses the RPM package manager. You can control this configuration by using the - PACKAGE_CLASSES variable. + PACKAGE_CLASSES variable. For additional package manager selection information, see - Packaging - package*.bbclass in + "Packaging - package*.bbclass" in The Yocto Project Reference Manual. @@ -355,10 +400,9 @@ Continue with the following command to build an OS image for the target, which is core-image-sato in this example. - For information on the ‐k option use the - bitbake --help command or see - - BitBake section in the Yocto Project Reference Manual. + For information on the -k option use the + bitbake --help command or see the + "BitBake" section in the Yocto Project Reference Manual. $ bitbake -k core-image-sato @@ -383,16 +427,13 @@
Using Pre-Built Binaries and QEMU + - If hardware, libraries and services are stable you can get started by using a pre-built binary - of the image, kernel and toolchain and run it using the emulator QEMU. + If hardware, libraries and services are stable, you can get started by using a pre-built binary + of the image, kernel, and toolchain and run it using the QEMU emulator. This scenario is useful for developing application software. - - - - @@ -400,53 +441,38 @@ Using a Pre-Built Image - + - - For this scenario you need to do several things: - + + For this scenario, you need to do several things: + - - - - Install the stand-alone Yocto toolchain tarball. - - - - - Download the pre-built kernel that will boot with QEMU. - You need to be sure to get the QEMU image that matches your target machine’s - architecture (e.g. x86, ARM, etc.). - - - - - Download the filesystem image for your target machine's architecture. - - - - - Set up the environment to emulate the hardware and then start the QEMU emulator. - - - - + + Install the stand-alone Yocto toolchain tarball. + Download the pre-built image that will boot with QEMU. + You need to be sure to get the QEMU image that matches your target machine’s + architecture (e.g. x86, ARM, etc.). + Download the filesystem image for your target machine's architecture. + + Set up the environment to emulate the hardware and then start the QEMU emulator. + +
- Installing the Toolchain - - You can download the pre-built toolchain, which includes the runqemu - script and support files, from - . - Toolchains are available for 32-bit and 64-bit development systems from the - i686 and x86_64 folders, respectively. - Each type of development system supports five target architectures. - The tarball files are named such that a string representing the host system appears - first in the filename and then is immediately followed by a string representing - the target architecture. - + Installing the Toolchain + + You can download the pre-built toolchain, which includes the runqemu + script and support files, from + . + Toolchains are available for 32-bit and 64-bit development systems from the + i686 and x86_64 folders, respectively. + Each type of development system supports five target architectures. + The tarball files are named such that a string representing the host system appears + first in the filename and then is immediately followed by a string representing + the target architecture. + - + yocto-eglibc<host_system>-<arch>-toolchain-gmae-<release>.tar.bz2 Where: @@ -457,50 +483,55 @@ i586, x86_64, powerpc, mips, or arm. <release> is the version of Yocto Project. - + - - For example, the following toolchain tarball is for a 64-bit development - host system and a 32-bit target architecture: - + + For example, the following toolchain tarball is for a 64-bit development + host system and a 32-bit target architecture: + - + yocto-eglibc-x86_64-i586-toolchain-gmae-1.1.tar.bz2 - + - - The toolchain tarballs are self-contained and must be installed into /opt/poky. - The following commands show how you install the toolchain tarball given a 64-bit development host system - and a 32-bit target architecture. - The example assumes the toolchain tarball is located in ~/toolchains/: - + + The toolchain tarballs are self-contained and must be installed into /opt/poky. + The following commands show how you install the toolchain tarball given a 64-bit development host system + and a 32-bit target architecture. + The example assumes the toolchain tarball is located in ~/toolchains/: + - - + + $ cd / $ sudo tar -xvjf ~/toolchains/yocto-eglibc-x86_64-i586-toolchain-gmae-1.1.tar.bz2 - - -
+ + + + + For more information on how to install tarballs, see the + "Using a Cross-Toolchain Tarball" and + "Using BitBake and the Yocto Project Build Tree" sections in + The Yocto Project + Application Development Toolkit (ADT) Development Manual. + +
- Downloading the Pre-Built Linux Kernel - - You can download the pre-built Linux kernel and the filesystem image suitable for - running in the emulator QEMU from - . - Be sure to use the kernel and filesystem image that matches the architecture you want - to simulate. - Download areas exist for the five supported machine architectures: - qemuarm, qemumips, qemuppc, - qemux86, and qemux86_64. - - - - Most kernel files have one of the following forms: - - - + Downloading the Pre-Built Linux Kernel + + + You can download the pre-built Linux kernel suitable for running in the QEMU emulator from + . + Be sure to use the kernel that matches the architecture you want to simulate. + Download areas exist for the five supported machine architectures: + qemuarm, qemumips, qemuppc, + qemux86, and qemux86_64. + + + + Most kernel files have one of the following forms: + *zImage-<kernel-rev>-qemu<arch>-<release>*.bin vmlinux-<kernel-rev>-qemu<arch>-<release>*.bin @@ -512,21 +543,35 @@ x86, x86-64, ppc, mips, or arm. <release> is the version of Yocto Project. - -
+ +
+ + + You can learn more about downloading a Yocto Project kernel in the + "Linux Yocto Kernel" section of + The + Yocto Project Development Manual. + +
- Downloading the Filesystem - - The filesystem image has two tarball forms: ext3 and - tar. - You must use the ext3 form when booting an image using the - QEMU emulator. - The tar form can be flattened out in your host development system - and used for Yocto Project build purposes. - + Downloading the Filesystem - + + You can also download the filesystem image suitable for your target architecture from + . + Again, be sure to use the filesystem that matches the architecture you want + to simulate. + + + + The filesystem image has two tarball forms: ext3 and + tar. + You must use the ext3 form when booting an image using the + QEMU emulator. + The tar form can be flattened out in your host development system + and used for Yocto Project build purposes. + yocto-image-<profile>-qemu<arch>-<release>.rootfs.ext3.bz2 yocto-image-<profile>-qemu<arch>-<release>.rootfs.tar.bz2 @@ -540,17 +585,17 @@ x86, x86-64, ppc, mips, or arm. <release> is the version of Yocto Project. - -
+ + +
- Setting Up the Environment and Starting the QEMU Emulator - - Before you start the QEMU emulator you need to set up the emulation environment. - The following command form sets up the emulation environment. - - - + Setting Up the Environment and Starting the QEMU Emulator + + + Before you start the QEMU emulator, you need to set up the emulation environment. + The following command form sets up the emulation environment. + $ source /opt/poky/1.1/environment-setup-<arch>-poky-linux-<if> Where: @@ -559,13 +604,12 @@ <if> is a string representing an embedded application binary interface. Not all setup scripts include this string. - + + - - Finally, this command form invokes the QEMU emulator - - - + + Finally, this command form invokes the QEMU emulator + $ runqemu <qemuarch> <kernel-image> <filesystem-image> Where: @@ -576,33 +620,32 @@ <filesystem-image> is the .ext3 filesystem image. - + + - - Continuing with the example, the following two commands setup the emulation - environment and launch QEMU. - This example assumes the root filesystem tarball has been downloaded and expanded, and - that the kernel and filesystem are for a 32-bit target architecture. - - - + + Continuing with the example, the following two commands setup the emulation + environment and launch QEMU. + This example assumes the root filesystem tarball has been downloaded and expanded, and + that the kernel and filesystem are for a 32-bit target architecture. + $ source /opt/poky/1.1/environment-setup-i686-poky-linux $ runqemu qemux86 bzImage-3.0-qemux86-1.1.bin \ yocto-image-sato-qemux86-1.1.rootfs.ext3 - + + - - The environment in which QEMU launches varies depending on the filesystem image and on the - target architecture. For example, if you source the environment for the ARM target - architecture and then boot the minimal QEMU image, the emulator comes up in a new - shell in command-line mode. However, if you boot the SDK image QEMU comes up with - a GUI. - - - - Booting the PPC image results in QEMU launching in the same shell in command-line mode. - -
+ + The environment in which QEMU launches varies depending on the filesystem image and on the + target architecture. + For example, if you source the environment for the ARM target + architecture and then boot the minimal QEMU image, the emulator comes up in a new + shell in command-line mode. + However, if you boot the SDK image, QEMU comes up with a GUI. + Booting the PPC image results in QEMU launching in the same shell in + command-line mode. + +