From dc96712c5333e753704cad0b26efc8ebf3d54e16 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 14 Jul 2011 10:17:41 -0700 Subject: documentation/kernel-manual/kernel-how-to.xml: Updated the create BSP section This section has been re-written to just include high-level overview of the steps. The detailed example that used to be the section is not needed as there is adequate documentation of this process in the Yocto Project Development Manual and on the wiki courtesy of Tom Zanussi. (From yocto-docs rev: 7355734a5ed965401027ba23bfb15fd926a171f7) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/kernel-manual/kernel-how-to.xml | 277 +++++--------------------- 1 file changed, 49 insertions(+), 228 deletions(-) (limited to 'documentation') diff --git a/documentation/kernel-manual/kernel-how-to.xml b/documentation/kernel-manual/kernel-how-to.xml index 8ef9793c60..bce2c2ce44 100644 --- a/documentation/kernel-manual/kernel-how-to.xml +++ b/documentation/kernel-manual/kernel-how-to.xml @@ -1010,240 +1010,60 @@ That's it. Configure and build. Creating a BSP Based on an Existing Similar BSP - This section provides an example for creating a BSP that is based on an existing, and hopefully, - similar one. - The example assumes you will be using a local kernel repository and you will be pointing the - kernel recipes at that repository. - Follow the steps in this section and keep in mind your particular situation and differences. + This section overviews the process of creating a BSP based on an + existing similar BSP. + The information is introductory in nature and does not provide step-by-step examples. + For detailed information on how to create a BSP given an existing similar BSP + see the Yocto Project Development Manual [NEED LINK] or the + + wiki page. - - If you are interested in a more detailed example with complete transcripts showing how to - create a BSP that is based on an existing similar BSP, see the information on the wiki - page at . + The basic steps you need to follow are: + + Make sure you have the Yocto Project source tree available. + You should either create a Yocto Project Git repository (recommended), or + you should get the Yocto Project release tarball and extract it. + Choose an existing BSP available with the Yocto Project. + Try to map your board features as closely to the features of a BSP that is + already supported and exists in the Yocto Project. + Starting with something as close as possible to your board makes developing + your BSP easier. + You can find all the BSPs that are supported and ship with the Yocto Project + on the Yocto Project's Download page at + . + Be sure you have the Base BSP. + You need to either have the Yocto Project Git repository set up or download + the tarball of the base BSP. + Either method gives you access to the BSP source files. + Make a copy of the existing BSP, thus isolating your new BSP work. + Copying the existing BSP structure gives you a new area in which to work. + Make configuration and recipe changes to your new BSP. + Configuration changes involve the files in the BSP's conf + directory. + Changes include creating a machine-specific configuration file and editing the + layer.conf file. + The configuration changes identify the kernel you will be using. + Recipe changes include removing, modifying, or adding new recipe files that + instruct the build process on what features to include in the image. + Prepare for the build. + Before you actually initiate the build you need to set up the build environment + by sourcing the environment initialization script. + After setting up the environment you need to make some build configuration + changes to the local.conf and bblayers.conf + files. + Build the image. + The Yocto Project uses the BitBake tool to create the image. + You need to decide on the type of image you are going to build (e.g. minimal, base, + core, sato, and so forth) and then start the build using the bitbake + command. + - - - - Identify a machine configuration file that matches your machine. - - - - You can start with a machine configuration file in the Yocto Project source tree - such as the atom-pc.conf in meta-yocto/conf/machine. - Or, you can start with a machine configuration file from a BSP layer - such as emenlow.conf in meta-emenlow/conf/machine. - - - - The main difference between these two BSP machine configuration files is that "emenlow" is - in its own isolated BSP layer, while "atom-pc" is in a more encompassing layer - named meta-yocto that is part of the Yocto Project source tree. - The "emenlow" configuration is in its own BSP layer because the target hardware - needs extra machine-specific packages to support graphics and other features. - The "atom-pc" configuration file supports more basic hardware that does not need any - special packages - everything the hardware needs can be specified in the configuration file. - The "atom-pc" machine also supports all of Asus eee901, Acer Aspire One, Toshiba NB305, - and the Intel® Embedded Development Board 1-N450 with no changes. - - - - If you want to make minor changes to support a slightly different machine, you can - create a new configuration file for the new machine and add it alongside the - configuration files. - You might consider keeping common configurations for several machines in a separate file - and then including the other configuration files that have more specific configurations. - - - - Similarly, you can also use multiple configuration files for different machines even - when the configuration files come from a separate and different layer. - - - - As an example consider this: - - Copy the "emenlow" BSP layer to a new BSP layer named - meta-mymachine. - Now you have two identical BSP layers ‐ but with different names. - This example assumes the hardware for your new BSP is very similar to - the hardware used for meta-emenlow. - And, you only need to change some machine configurations and inform the Yocto Project build - process of the new layer. - Consequently, you just need to modify some files in the the new layer so that the Yocto Project - build process uses the recipes and configurations in the new layer. - Since you are basing your new layer on a copied existing layer you need to be sure to rename - any directories named "emenlow" to "mymachine". - There is one in the recipes-bsp directory and one in the - recipes-graphics directory.. - In the recipes-graphics directory make sure you locate and - change all occurences of "emenlow" to "mymachine". - Several instances exist. - Rename the emenlow.conf file to mymachine.conf - and fix or remove any configurations. - You need to be sure that "mymachine" replaces "emenlow". - Note also that "linux-yocto" is the kernel specified in the configuration file. - Make sure the Yocto Project build process knows about the new BSP - layer by adding the pathname to the new layer to the bblayers.conf configuration - file located in the Yocto Project build tree at build/conf/bblayers.conf. - Adding the layer allows BitBake to find the new layer. - - - The above example creates a BSP layer named meta-mymachine that is - functionally identical to the BSP layer on which it was based - meta-emenlow. - In a real-world scenario you would need to differentiate features and configurations to enable - your "similar" BSP layer to work on your target hardware. - - - - - - Create a machine branch for your machine in a the Yocto Project Git repository. - - - - For the kernel to compile successfully, you need to create a branch in the - Yocto Project Git repository that is specifically named for your machine. - To create this branch, first create a bare clone of the Yocto Project Git repository. - Then, create a local clone of that bare clone. - Here are the commands: - - $ git clone ‐‐bare git://git.yoctoproject.org/linux-yocto-2.6.37.git linux-yocto-2.6.37.git - $ git clone linux-yocto-2.6.37.git linux-yocto-2.6.37 - - - - - Now be sure you are in the local clone and create a branch and push it to the bare clone: - - $ git checkout -b yocto/standard/mymachine origin/yocto/standard/base - $ git push origin yocto/standard/mymachine:yocto/standard/mymachine - - - - - In your new layer you need to edit the linux-yocto_git.bbappend - file so that the compatible machine is "mymachine". - It is also convenient to point to a cloned Yocto Project Git repository that is local - to your system for development purposes. - Thus, change the linux-yocto_git.bbappend file in your - meta-mymachine layer to the following: - - - - - FILESEXTRAPATHS := "${THISDIR}/${PN}" - COMPATIBLE_MACHINE_mymachine = "mymachine" - - # It is often nice to have a clone of the kernel repository, to - # allow patches to be staged, branches created, and so forth. Modify - # KSRC to point to your bare clone as appropriate. - - KSRC ?= $MYWORK/linux-yocto-2.6.37.git - - # KMACHINE is the branch to be built, or alternatively - # KBRANCH can be directly set. - # KBRANCH is set to KMACHINE in the main linux-yocto_git.bb - # KBRANCH ?= "${LINUX_KERNEL_TYPE}/${KMACHINE}" - - KMACHINE_mymachine = "yocto/standard/mymachine" - - SRC_URI = "git://${KSRC};nocheckout=1;branch=${KBRANCH},meta;name=machine,meta" - - - - - After updating the linux-yocto_git.bbappend file, - edit the build/conf/local.conf found - in the Yocto Project build tree so that it selects your machine: - - # - MACHINE ?= "mymachine" - # - - - - - You should now be able to build and boot an image with the new kernel: - - $ bitbake -k core-image-sato-live - - - - - Modify the kernel configuration for your machine. - - - - At this point you will build a kernel with the default configuration file, which is probably - not what you want. - If you just want to set some kernel configuration options, you can do that by - putting them in a file. - For example, inserting the following into some .cfg file: - - CONFIG_NETDEV_1000=y - CONFIG_E1000E=y - - - - - And, another .cfg file would contain: - - CONFIG_LOG_BUF_SHIFT=18 - - - - - These configuration fragments could then be picked up and - applied to the kernel .config by appending them to the kernel SRC_URI: - - SRC_URI_append_mymachine = " file://some.cfg \ - file://other.cfg \ - " - - - - - You could also add these directly to the git repository meta - branch as well. - However, the former method is a simple starting point. - - - - If you're also adding patches to the kernel, you can do the same thing. - Put your patches in the SRC_URI as well (plus .cfg for their kernel - configuration options if needed). - - - - Practically speaking, to generate the patches, you'd go to the source in the build tree: - - build/tmp/work/mymachine-poky-linux/linux-yocto-2.6.37+Git0+d1cd5c80ee97e81e130be8c3de3965b770f320d6_0+ -0431115c9d720fee5bb105f6a7411efb4f851d26-r13/linux - - - - - Then, modify the code there, using quilt to save the changes, and recompile until - it works: - - $ bitbake -c compile -f linux-yocto - - - - - Once you have the final patch from quilt, copy it to the - SRC_URI location. - The patch is applied the next time you do a clean build. - Of course, since you have a branch for the BSP in Git, it would be better to put it there instead. - For example, in this case, commit the patch to the "yocto/standard/mymachine" branch, and during the - next build it is applied from there. - - +