mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
documentation/kernel-manual/kernel-how-to.xml: Partial - Re-write of BSP creation
This is a partial edit of re-writing the BSP creation section so that it is clearer for the naive user. It is not quite done yet. (From yocto-docs rev: 7a552e72a1d2d1b6ffa93f4fe3074f318ff35715) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1316648ae6
commit
fe438753ba
@@ -1021,62 +1021,76 @@ That's it. Configure and build.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
You can start with something in <filename>meta/conf/machine</filename> - <filename>
|
You can start with a machine configuration file in the Yocto Project source tree
|
||||||
meta/conf/machine/atom-pc.conf</filename> for example. Or, you can start with a machine
|
such as the <filename>atom-pc.conf</filename> in <filename>meta-yocto/conf/machine</filename>.
|
||||||
configuration from any of the BSP layers in the meta-intel repository at
|
Or, you can start with a machine configuration file from a BSP layer
|
||||||
<ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/'></ulink>, such as
|
such as <filename>emenlow.conf</filename> in <filename>meta-emenlow/conf/machine</filename>.
|
||||||
<filename>meta-intel/meta-emenlow/conf/machine/emenlow.conf</filename>.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The main difference between the two is that "emenlow" is in its own layer.
|
The main difference between these two BSP machine configuration files is that "emenlow" is
|
||||||
It is in its own layer because it needs extra machine-specific packages such as its
|
in its own isolated BSP layer, while "atom-pc" is in a more encompassing layer
|
||||||
own video driver and other supporting packages.
|
named <filename>meta-yocto</filename> that is part of the Yocto Project source tree.
|
||||||
The "atom-pc" is simpler and does not need any special packages - everything it needs can
|
The "emenlow" configuration is in its own BSP layer because the target hardware
|
||||||
be specified in the configuration file.
|
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,
|
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.
|
and the Intel® Embedded Development Board 1-N450 with no changes.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If you want to make minor changes to support a slightly different machine, you can
|
If you want to make minor changes to support a slightly different machine, you can
|
||||||
create a new configuration file for it and add it alongside the others.
|
create a new configuration file for the new machine and add it alongside the
|
||||||
You might consider keeping the common information separate and including it.
|
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.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Similarly, you can also use multiple configuration files for different machines even
|
Similarly, you can also use multiple configuration files for different machines even
|
||||||
if you do it as a separate layer like meta-emenlow.
|
when the configuration files come from a separate and different layer.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
As an example consider this:
|
As an example consider this:
|
||||||
<itemizedlist>
|
<orderedlist>
|
||||||
<listitem><para>Copy meta-emenlow to meta-mymachine</para></listitem>
|
<listitem><para>Copy the "emenlow" BSP layer to a new BSP layer named
|
||||||
<listitem><para>Fix or remove anything you do not need.
|
<filename>meta-mymachine</filename>.
|
||||||
For this example the only thing left was the kernel directory with a
|
Now you have two identical BSP layers ‐ but with different names.</para></listitem>
|
||||||
<filename>linux-yocto_git.bbappend</filename>
|
<listitem><para>This example assumes you only need to change some machine
|
||||||
file
|
configurations and inform the Yocto Project build process of the new layer.
|
||||||
and <filename>meta-mymachine/conf/machine/mymachine.conf</filename>
|
Consequently, modify the new layer's structure so that all it contains
|
||||||
(linux-yocto is the kernel listed in
|
is the <filename>linux-yocto_git.bbappend</filename> file in the
|
||||||
<filename>meta-emenlow/conf/machine/emenlow.conf</filename>)</para></listitem>.
|
<filename>meta-mymachine/recipes-kernel/linux</filename> directory
|
||||||
<listitem><para>Add a new entry in the <filename>build/conf/bblayers.conf</filename>
|
and the <filename>emenlow.conf</filename> configuration file in the
|
||||||
so the new layer can be found by BitBake.</para></listitem>
|
<filename>meta-mymachine/conf/machine</filename> directory.
|
||||||
</itemizedlist>
|
Note that "linux-yocto" is the kernel specified in the <filename>mymachine.conf</filename>
|
||||||
|
configuration file.</para></listitem>.
|
||||||
|
<listitem><para>Rename the <filename>emenlow.conf</filename> file to <filename>mymachine.conf</filename>
|
||||||
|
and fix or remove any configurations.</para></listitem>
|
||||||
|
<listitem><para>Make sure the Yocto Project build process knows about the new BSP
|
||||||
|
layer by adding the layer to the <filename>bblayers.conf</filename> configuration
|
||||||
|
file located in the Yocto Project build tree at <filename>build/conf/bblayers.conf</filename>.
|
||||||
|
Adding the layer allows Bitbake to find the new layer.
|
||||||
|
You also need to edit the <filename>layer.conf</filename> file located in the
|
||||||
|
<filename>meta-mymachine/conf</filename> directory such that "mymachine" replaces
|
||||||
|
"emenlow".</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Create a machine branch for your machine.
|
Create a machine branch for your machine in a the Yocto Project git repository.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For the kernel to compile successfully, you need to create a branch in the git repository
|
For the kernel to compile successfully, you need to create a branch in the
|
||||||
specifically named for your machine.
|
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.
|
To create this branch, first create a bare clone of the Yocto Project git repository.
|
||||||
Next, create a local clone of that:
|
Then, create a local clone of that bare clone.
|
||||||
|
Here are the commands:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ git clone --bare git://git.yoctoproject.org/linux-yocto-2.6.37.git
|
$ git clone --bare git://git.yoctoproject.org/linux-yocto-2.6.37.git 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
|
$ git clone linux-yocto-2.6.37.git linux-yocto-2.6.37
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
@@ -1090,8 +1104,12 @@ That's it. Configure and build.
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
|
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
In a layer, create a <filename>linux-yocto_git.bbappend</filename>
|
In your new layer you need to edit the <filename>linux-yocto_git.bbappend</filename>
|
||||||
file with the following:
|
file so that the compatible machine is "mymachine".
|
||||||
|
It is also convenient point to a cloned Yocto Project git repository that is local
|
||||||
|
to your system for development purposes.
|
||||||
|
Thus, change the <filename>linux-yocto_git.bbappend</filename> file in your
|
||||||
|
<filename>meta-mymachine</filename> layer to the following:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@@ -1099,11 +1117,11 @@ That's it. Configure and build.
|
|||||||
FILESEXTRAPATHS := "${THISDIR}/${PN}"
|
FILESEXTRAPATHS := "${THISDIR}/${PN}"
|
||||||
COMPATIBLE_MACHINE_mymachine = "mymachine"
|
COMPATIBLE_MACHINE_mymachine = "mymachine"
|
||||||
|
|
||||||
# It is often nice to have a local clone of the kernel repository, to
|
# It is often nice to have a clone of the kernel repository, to
|
||||||
# allow patches to be staged, branches created, and so forth. Modify
|
# allow patches to be staged, branches created, and so forth. Modify
|
||||||
# KSRC to point to your local clone as appropriate.
|
# KSRC to point to your bare clone as appropriate.
|
||||||
|
|
||||||
KSRC ?= /path/to/your/bare/clone/for/example/linux-yocto-2.6.37.git
|
KSRC ?= $MYWORK/linux-yocto-2.6.37.git
|
||||||
|
|
||||||
# KMACHINE is the branch to be built, or alternatively
|
# KMACHINE is the branch to be built, or alternatively
|
||||||
# KBRANCH can be directly set.
|
# KBRANCH can be directly set.
|
||||||
@@ -1117,7 +1135,9 @@ That's it. Configure and build.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
After doing that, select the machine in <filename>build/conf/local.conf</filename>:
|
After updating the <filename>linux-yocto_git.bbappend</filename> file,
|
||||||
|
edit the <filename>build/conf/local.conf</filename> found
|
||||||
|
in the Yocto Project build tree so that it selects your machine:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
#
|
#
|
||||||
MACHINE ?= "mymachine"
|
MACHINE ?= "mymachine"
|
||||||
@@ -1137,7 +1157,7 @@ That's it. Configure and build.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Of course, that will give you a kernel with the default configuration file, which is probably
|
At this point you will build a kernel with the default configuration file, which is probably
|
||||||
not what you want.
|
not what you want.
|
||||||
If you just want to set some kernel configuration options, you can do that by
|
If you just want to set some kernel configuration options, you can do that by
|
||||||
putting them in a file.
|
putting them in a file.
|
||||||
@@ -1155,7 +1175,7 @@ That's it. Configure and build.
|
|||||||
</literallayout>
|
</literallayout>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
These config fragments could then be picked up and
|
These configuration fragments could then be picked up and
|
||||||
applied to the kernel .config by appending them to the kernel SRC_URI:
|
applied to the kernel .config by appending them to the kernel SRC_URI:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user