The yocto-bsp
script creates a new
BSP layer for any architecture supported
by the Yocto Project, as well as QEMU versions of the same.
The default mode of the script's operation is to prompt you for information needed
to generate the BSP layer.
For the current set of BSPs, the script prompts you for various important parameters such as:
The kernel to use
The branch of that kernel to use (or re-use)
Whether or not to use X, and if so, which drivers to use
Whether to turn on SMP
Whether the BSP has a keyboard
Whether the BSP has a touchscreen
Remaining configurable items associated with the BSP
You use the yocto-bsp create
sub-command to create
a new BSP layer.
This command requires you to specify a particular kernel architecture
(karch
) on which to base the BSP.
Assuming you have sourced the environment, you can use the
yocto-bsp list karch
sub-command to list the
architectures available for BSP creation as follows:
$ yocto-bsp list karch Architectures available: qemu mips64 powerpc x86_64 arm mips i386
The remainder of this section presents an example that uses
myarm
as the machine name and qemu
as the machine architecture.
Of the available architectures, qemu
is the only architecture
that causes the script to prompt you further for an actual architecture.
In every other way, this architecture is representative of how creating a BSP for
an actual machine would work.
The reason the example uses this architecture is because it is an emulated architecture
and can easily be followed without requiring actual hardware.
As the yocto-bsp create
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 meta-myarm
BSP layer
is created in the current working directory.
This example assumes you have sourced the
oe-init-build-env
setup script.
Following is the complete example:
$ yocto-bsp create myarm qemu Checking basic git connectivity... Done. Which qemu architecture would you like to use? [default: i386] 1) i386 (32-bit) 2) x86_64 (64-bit) 3) ARM (32-bit) 4) PowerPC (32-bit) 5) MIPS (32-bit) 6) MIPS64 (64-bit) 3 Would you like to use the default (3.17) kernel? (y/n) [default: y] y Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y] Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.17.git... Please choose a machine branch to base your new BSP branch on: [default: standard/base] 1) standard/arm-versatile-926ejs 2) standard/base 3) standard/beagleboard 4) standard/beaglebone 5) standard/ck 6) standard/common-pc 7) standard/crownbay 8) standard/edgerouter 9) standard/fsl-mpc8315e-rdb 10) standard/mti-malta32 11) standard/mti-malta64 12) standard/qemuarm64 13) standard/qemuppc 1 Would you like SMP support? (y/n) [default: y] Does your BSP have a touchscreen? (y/n) [default: n] Does your BSP have a keyboard? (y/n) [default: y] New qemu BSP created in meta-myarm
Take a closer look at the example now:
For the QEMU architecture, the script first prompts you for which emulated architecture to use. In the example, we use the ARM architecture.
The script then prompts you for the kernel. The default 3.17 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.
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.
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.
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 #1
at the prompt, which selects the ARM-versatile branch.
The remainder of the prompts are routine. Defaults are accepted for each.
By default, the script creates the new BSP Layer in the
current working directory of the
Source Directory,
(i.e. poky/build
).
Once the BSP Layer is created, you must add it to your
bblayers.conf
file.
Here is an example:
BBLAYERS = ? " \ /usr/local/src/yocto/meta \ /usr/local/src/yocto/meta-yocto \ /usr/local/src/yocto/meta-yocto-bsp \ /usr/local/src/yocto/meta-myarm \ " BBLAYERS_NON_REMOVABLE ?= " \ /usr/local/src/yocto/meta \ /usr/local/src/yocto/meta-yocto \ "
Adding the layer to this file allows the build system to build the BSP and
the yocto-kernel
tool to be able to find the layer and
other Metadata it needs on which to operate.