bsp-guide: Removed deprecated tool sections

I took out the sections at the end of the manual that talked
about the yocto-kernel tool.  This tool is no longer maintained
and there is no equivalent tool.  I also fixed the yocto-bsp
tool to be the bitbake-layers tool.  This involved some
consolidation of sections.

I fixed some links in the kernel-dev and toaster-manual.

(From yocto-docs rev: 20cda99b301b6327d816c4a4cfb3511ad25c987c)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2018-03-09 13:11:53 -08:00
committed by Richard Purdie
parent 7f141cf9a0
commit fdd79ab4cb
4 changed files with 1481 additions and 1839 deletions

View File

@@ -4,9 +4,9 @@
<chapter id='bsp'>
<title>Board Support Packages (BSP) - Developer's Guide</title>
<title>Board Support Packages (BSP) - Developer's Guide</title>
<para>
<para>
A Board Support Package (BSP) is a collection of information that
defines how to support a particular hardware device, set of devices, or
hardware platform.
@@ -16,18 +16,19 @@
The BSP also lists any additional software
components required in addition to a generic Linux software stack for both
essential and optional platform features.
</para>
</para>
<para>
<para>
This guide presents information about BSP Layers, defines a structure for components
so that BSPs follow a commonly understood layout, discusses how to customize
a recipe for a BSP, addresses BSP licensing, and provides information that
shows you how to create and manage a
<link linkend='bsp-layers'>BSP Layer</link> using two Yocto Project
<link linkend='using-the-yocto-projects-bsp-tools'>BSP Tools</link>.
</para>
shows you how to create a
<link linkend='bsp-layers'>BSP Layer</link> using the
<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'><filename>bitbake-layers</filename></link>
tool.
</para>
<section id='bsp-layers'>
<section id='bsp-layers'>
<title>BSP Layers</title>
<para>
@@ -152,9 +153,9 @@
"<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
section of the Yocto Project Development Tasks Manual.
</para>
</section>
</section>
<section id='preparing-your-build-host-to-work-with-bsp-layers'>
<section id='preparing-your-build-host-to-work-with-bsp-layers'>
<title>Preparing Your Build Host to Work With BSP Layers</title>
<para>
@@ -304,9 +305,9 @@
</para></listitem>
</orderedlist>
</para>
</section>
</section>
<section id="bsp-filelayout">
<section id="bsp-filelayout">
<title>Example Filesystem Layout</title>
<para>
@@ -882,12 +883,17 @@
You can find these files in the BSP Layer at:
<literallayout class='monospaced'>
meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux/linux-yocto*.bbappend
meta-<replaceable>bsp_name</replaceable>/recipes-kernel/linux/*.bb
</literallayout>
</para>
<para>
These files append machine-specific changes to the main
kernel recipe you are using.
Append files (<filename>*.bbappend</filename> modify
the main kernel recipe being used to build the image.
The <filename>*.bb</filename> files would be a
developer-supplied recipe.
This area of the BSP hierarchy can contain both these
types of files.
</para>
<para>
@@ -937,16 +943,32 @@
section in the Yocto Project Linux Kernel Development
Manual.
</para>
</section>
</section>
<section id='developing-a-board-support-package-bsp'>
<para>
An alternate scenario is when you create your own
kernel recipe for the BSP.
A good example of this is the Raspberry Pi BSP.
If you examine the
<filename>recipes-kernel/linux</filename> directory
you see the following:
<literallayout class='monospaced'>
linux-raspberrypi-dev.bb
linux-raspberrypi.inc
linux-raspberrypi_4.14.bb
linux-raspberrypi_4.9.bb
</literallayout>
The directory contains three kernel recipes and an
include file.
</para>
</section>
</section>
<section id='developing-a-board-support-package-bsp'>
<title>Developing a Board Support Package (BSP)</title>
<para>
This section contains the high-level procedure you can
follow to create a BSP using the Yocto Project's
<link linkend='using-the-yocto-projects-bsp-tools'>BSP Tools</link>.
follow to create a BSP.
Although not required for BSP creation, the
<filename>meta-intel</filename> repository, which
contains many BSPs supported by the Yocto Project,
@@ -1165,9 +1187,9 @@
</para></listitem>
</orderedlist>
</para>
</section>
</section>
<section id='requirements-and-recommendations-for-released-bsps'>
<section id='requirements-and-recommendations-for-released-bsps'>
<title>Requirements and Recommendations for Released BSPs</title>
<para>
@@ -1477,9 +1499,9 @@
</itemizedlist>
</para>
</section>
</section>
</section>
<section id='customizing-a-recipe-for-a-bsp'>
<section id='customizing-a-recipe-for-a-bsp'>
<title>Customizing a Recipe for a BSP</title>
<para>
@@ -1573,9 +1595,9 @@
</para></listitem>
</orderedlist>
</para>
</section>
</section>
<section id='bsp-licensing-considerations'>
<section id='bsp-licensing-considerations'>
<title>BSP Licensing Considerations</title>
<para>
@@ -1704,163 +1726,11 @@
to remove this restriction.
</note>
</para>
</section>
</section>
<section id='using-the-yocto-projects-bsp-tools'>
<title>Using the Yocto Project's BSP Tools</title>
<para>
The Yocto Project includes a couple of tools that enable
you to create a <link linkend='bsp-layers'>BSP layer</link>
from scratch and do basic configuration and maintenance
of the kernel without ever looking at a Metadata file.
These tools are <filename>yocto-bsp</filename> and <filename>yocto-kernel</filename>,
respectively.
</para>
<para>
The following sections describe the common location and help features as well
as provide details for the
<filename>yocto-bsp</filename> and <filename>yocto-kernel</filename> tools.
</para>
<section id='common-features'>
<title>Common Features</title>
<para>
Designed to have a command interface somewhat like
<ulink url='&YOCTO_DOCS_GS_URL;#git'>Git</ulink>, each
tool is structured as a set of sub-commands under a
top-level command.
The top-level command (<filename>yocto-bsp</filename>
or <filename>yocto-kernel</filename>) itself does
nothing but invoke or provide help on the sub-commands
it supports.
</para>
<para>
Both tools reside in the <filename>scripts/</filename> subdirectory
of the <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
Consequently, to use the scripts, you must <filename>source</filename> the
environment just as you would when invoking a build:
<literallayout class='monospaced'>
$ source oe-init-build-env <replaceable>build_dir</replaceable>
</literallayout>
</para>
<para>
The most immediately useful function is to get help on both tools.
The built-in help system makes it easy to drill down at
any time and view the syntax required for any specific command.
Simply enter the name of the command with the <filename>help</filename>
switch:
<literallayout class='monospaced'>
$ yocto-bsp help
Usage:
Create a customized Yocto BSP layer.
usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
Current 'yocto-bsp' commands are:
create Create a new Yocto BSP
list List available values for options and BSP properties
See 'yocto-bsp help COMMAND' for more information on a specific command.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-D, --debug output debug information
</literallayout>
</para>
<para>
Similarly, entering just the name of a sub-command shows the detailed usage
for that sub-command:
<literallayout class='monospaced'>
$ yocto-bsp create
ERROR:root:Wrong number of arguments, exiting
Usage:
Create a new Yocto BSP
usage: yocto-bsp create &lt;bsp-name&gt; &lt;karch&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]
[-i &lt;JSON PROPERTY FILE&gt; | --infile &lt;JSON PROPERTY_FILE&gt;]
This command creates a Yocto BSP based on the specified parameters.
The new BSP will be a new Yocto BSP layer contained by default within
the top-level directory specified as 'meta-bsp-name'. The -o option
can be used to place the BSP layer in a directory with a different
name and location.
The value of the 'karch' parameter determines the set of files that
will be generated for the BSP, along with the specific set of
'properties' that will be used to fill out the BSP-specific portions
of the BSP. The possible values for the 'karch' parameter can be
listed via 'yocto-bsp list karch'.
...
</literallayout>
</para>
<para>
For any sub-command, you can use the word "help" option just before the
sub-command to get more extensive documentation:
<literallayout class='monospaced'>
$ yocto-bsp help create
NAME
yocto-bsp create - Create a new Yocto BSP
SYNOPSIS
yocto-bsp create &lt;bsp-name> &lt;karch&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]
[-i &lt;JSON PROPERTY FILE&gt; | --infile &lt;JSON PROPERTY_FILE&gt;]
DESCRIPTION
This command creates a Yocto BSP based on the specified
parameters. The new BSP will be a new Yocto BSP layer contained
by default within the top-level directory specified as
'meta-bsp-name'. The -o option can be used to place the BSP layer
in a directory with a different name and location.
...
</literallayout>
</para>
<para>
Now that you know where these two commands reside and how to access information
on them, you should find it relatively straightforward to discover the commands
necessary to create a BSP and perform basic kernel maintenance on that BSP using
the tools.
<note>
You can also use the <filename>bitbake-layers</filename> script to create
a "generic" layer.
For information on using this script to create a layer, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
section in the Yocto Project Development Tasks Manual.
</note>
</para>
<para>
The next sections provide a concrete starting point to expand on a few points that
might not be immediately obvious or that could use further explanation.
</para>
</section>
<section id='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>
<section id='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>
<title>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</title>
<para role='writernotes'>
I have put in information that will be the basis of this section,
but it is missing a lot at this point.
This whole section needs reviewed and filled in with proper
information.
</para>
<para>
[INTRODUCE THE PROCEDURE AND LINK BACK TO <link linkend='bsp-layers'>BSP layer</link>.
IF THERE IS A LAUNDRY LIST OF ITEMS THAT NEED DEFINITION OR GET SET
@@ -1917,7 +1787,7 @@
</itemizedlist>
</para>
<para role='writernotes'>
<para>
[THERE IS MORE INFORMATION THAT NEEDS TO BE FILLED IN HERE. THIS NEEDS TO
BE PROVIDED BY ENGINEERS.]
</para>
@@ -1934,63 +1804,11 @@
and can easily be followed without requiring actual hardware.
</para>
<!-- <para>
[ASSUMING SIMILAR ACTION OCCURS]As the [SUBCOMMAND] command runs, default values for
the prompts appear in brackets.
Pressing enter without supplying anything on the command line or pressing enter
with an invalid response causes the script to accept the default value.
Once the script completes, the new <filename>meta-myarm</filename> BSP layer
is created in the current working directory.
This example assumes you have sourced the
<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
setup script.
</para>
-->
<para>
Following is a complete example:
<literallayout class='monospaced'>
[INSERT EXAMPLE - NEED EXAMPLE]
</literallayout>
<!--
<orderedlist>
<listitem><para>For the QEMU architecture,
the script first prompts you for which emulated architecture to use.
In the example, we use the ARM architecture.
</para></listitem>
<listitem><para>The script then prompts you for the kernel.
The default 4.8 kernel is acceptable.
So, the example accepts the default.
If you enter 'n', the script prompts you to further enter the kernel
you do want to use.</para></listitem>
<listitem><para>Next, the script asks whether you would like to have a new
branch created especially for your BSP in the local
Linux Yocto Kernel Git repository .
If not, then the script re-uses an existing branch.</para>
<para>In this example, the default (or "yes") is accepted.
Thus, a new branch is created for the BSP rather than using a common, shared
branch.
The new branch is the branch committed to for any patches you might later add.
The reason a new branch is the default is that typically
new BSPs do require BSP-specific patches.
The tool thus assumes that most of time a new branch is required.
</para></listitem>
<listitem><para>Regardless of which choice you make in the previous step,
you are now given the opportunity to select a particular machine branch on
which to base your new BSP-specific machine branch
(or to re-use if you had elected to not create a new branch).
Because this example is generating an ARM-based BSP, the example
uses <filename>#1</filename> at the prompt, which selects the ARM-versatile branch.
</para></listitem>
<listitem><para>The remainder of the prompts are routine.
Defaults are accepted for each.</para></listitem>
<listitem><para>By default, the script creates the new BSP Layer in the
current working directory of the
<ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>,
(i.e. <filename>poky/build</filename>).
</para></listitem>
</orderedlist>
-->
</para>
<para>
@@ -2008,153 +1826,5 @@
Adding the layer to this file allows the build system to build the BSP and
find the layer along with other Metadata it needs.
</para>
</section>
<section id='managing-kernel-patches-and-config-items-with-yocto-kernel'>
<title>Managing Kernel Patches and Config Items with yocto-kernel</title>
<para>
Assuming you have created a <link linkend='bsp-layers'>BSP Layer</link> using
<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>
<filename>yocto-bsp</filename></link> and you added it to your
<ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
variable in the <filename>bblayers.conf</filename> file, you can now use
the <filename>yocto-kernel</filename> script to add patches and configuration
items to the BSP's kernel.
</para>
<para>
The <filename>yocto-kernel</filename> script allows you to add, remove, and list patches
and kernel config settings to a BSP's kernel
<filename>.bbappend</filename> file.
All you need to do is use the appropriate sub-command.
Recall that the easiest way to see exactly what sub-commands are available
is to use the <filename>yocto-kernel</filename> built-in help as follows:
<literallayout class='monospaced'>
$ yocto-kernel --help
Usage:
Modify and list Yocto BSP kernel config items and patches.
usage: yocto-kernel [--version] [--help] COMMAND [ARGS]
Current 'yocto-kernel' commands are:
config list List the modifiable set of bare kernel config options for a BSP
config add Add or modify bare kernel config options for a BSP
config rm Remove bare kernel config options from a BSP
patch list List the patches associated with a BSP
patch add Patch the Yocto kernel for a BSP
patch rm Remove patches from a BSP
feature list List the features used by a BSP
feature add Have a BSP use a feature
feature rm Have a BSP stop using a feature
features list List the features available to BSPs
feature describe Describe a particular feature
feature create Create a new BSP-local feature
feature destroy Remove a BSP-local feature
See 'yocto-kernel help COMMAND' for more information on a specific command.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-D, --debug output debug information
</literallayout>
</para>
<para>
The <filename>yocto-kernel patch add</filename> sub-command allows you to add a
patch to a BSP.
The following example adds two patches to the <filename>myarm</filename> BSP:
<literallayout class='monospaced'>
$ yocto-kernel patch add myarm ~/test.patch
Added patches:
test.patch
$ yocto-kernel patch add myarm ~/yocto-testmod.patch
Added patches:
yocto-testmod.patch
</literallayout>
<note>Although the previous example adds patches one at a time, it is possible
to add multiple patches at the same time.</note>
</para>
<para>
You can verify patches have been added by using the
<filename>yocto-kernel patch list</filename> sub-command.
Here is an example:
<literallayout class='monospaced'>
$ yocto-kernel patch list myarm
The current set of machine-specific patches for myarm is:
1) test.patch
2) yocto-testmod.patch
</literallayout>
</para>
<para>
You can also use the <filename>yocto-kernel</filename> script to
remove a patch using the <filename>yocto-kernel patch rm</filename> sub-command.
Here is an example:
<literallayout class='monospaced'>
$ yocto-kernel patch rm myarm
Specify the patches to remove:
1) test.patch
2) yocto-testmod.patch
1
Removed patches:
test.patch
</literallayout>
</para>
<para>
Again, using the <filename>yocto-kernel patch list</filename> sub-command,
you can verify that the patch was in fact removed:
<literallayout class='monospaced'>
$ yocto-kernel patch list myarm
The current set of machine-specific patches for myarm is:
1) yocto-testmod.patch
</literallayout>
</para>
<para>
In a completely similar way, you can use the <filename>yocto-kernel config add</filename>
sub-command to add one or more kernel config item settings to a BSP.
The following commands add a couple of config items to the
<filename>myarm</filename> BSP:
<literallayout class='monospaced'>
$ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y
Added item:
CONFIG_MISC_DEVICES=y
$ yocto-kernel config add myarm CONFIG_YOCTO_TESTMOD=y
Added item:
CONFIG_YOCTO_TESTMOD=y
</literallayout>
<note>
Although the previous example adds config items one at a time, it is possible
to add multiple config items at the same time.
</note>
</para>
<para>
You can list the config items now associated with the BSP.
Doing so shows you the config items you added as well as others associated
with the BSP:
<literallayout class='monospaced'>
$ yocto-kernel config list myarm
The current set of machine-specific kernel config items for myarm is:
1) CONFIG_MISC_DEVICES=y
2) CONFIG_YOCTO_TESTMOD=y
</literallayout>
</para>
<para>
Finally, you can remove one or more config items using the
<filename>yocto-kernel config rm</filename> sub-command in a manner
completely analogous to <filename>yocto-kernel patch rm</filename>.
</para>
</section>
</section>
</section>
</chapter>

View File

@@ -1224,18 +1224,6 @@
the
"<link linkend='getting-ready-for-traditional-kernel-development'>Getting Ready for Traditional Kernel Development</link>"
Section.
</para>
<para>
Although this example uses Git and shell commands to generate the
patch, you could use the <filename>yocto-kernel</filename> script
found in the <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
under <filename>scripts</filename> to add and manage kernel
patches and configuration.
See the "<ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches and Config Items with yocto-kernel</ulink>"
section in the Yocto Project Board Support Packages (BSP)
Developer's Guide for more information on the
<filename>yocto-kernel</filename> script.
<orderedlist>
<listitem><para>
<emphasis>Edit the Source Files</emphasis>

View File

@@ -127,18 +127,6 @@
</para></listitem>
</itemizedlist>
</para>
<para>
Finally, while this document focuses on the manual creation of
recipes, patches, and configuration files, the Yocto Project
Board Support Package (BSP) tools are available to automate
this process with existing content and work well to create the
initial framework and boilerplate code.
For details on these tools, see the
"<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
section in the Yocto Project Board Support Package (BSP) Developer's
Guide.
</para>
</section>
<section id='kernel-modification-workflow'>
@@ -243,11 +231,7 @@
<para>Additionally, if you are working in a BSP layer
and need to modify the BSP's kernel's configuration,
you can use the
<ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'><filename>yocto-kernel</filename></ulink>
script as well as <filename>menuconfig</filename>.
The <filename>yocto-kernel</filename> script lets
you interactively set up kernel configurations.
you can use <filename>menuconfig</filename>.
</para></listitem>
<listitem><para>
<emphasis>Rebuild the Kernel Image With Your Changes:</emphasis>

View File

@@ -92,11 +92,11 @@
<para>
For general information on layers, see the
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
and
"<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
sections in the Yocto Project Board Support Package (BSP)
Developer's Guide.
"<ulink url='&YOCTO_DOCS_GS_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
section in the Getting Started With Yocto Project Manual.
For information on how to create layers, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
section in the Yocto Project Development Tasks Manual.
</para>
</section>