...
This wiki shows how to create a custom layer in an open source Xilinx Yocto flow. After creating the layer, it provides an example of creating your own machine based on a ZCU102 configuration.
Releases Supported
Xilinx Yocto rel-v2018.1
and later (Rocko 2.4)
Prerequisites
Yocto Supported Linux Distro
- Dedicated or virtual Linux machineBare-metal Linux or Virtual Machine
- Yocto Project Reference Manual: Supported Linux DistributionsDocumentation
Xilinx Tools
...
Dependencies
Note |
---|
|
These dependencies are not required for rel-v2018.3 |
...
...
- Install
xvfb
(X virtual framebuffer) see UG1144 Table 2-1 - XSDK or XSCT Installation (required for
meta-xilinx-tools
layer)
Xilinx Open Source Yocto Installation
Info |
---|
|
Don't forget to edit the path and version variables in local.conf to point to the current SDK root directory. |
Creating Your Custom Layer
You may create your custom layer manually by copying an existing layer.conf
, however, Yocto provides some helper scripts to automate it. The bitbake-layers create-layer
script will generate a base layer with a default priority of 6. Once the layer is created, you can either add the layer to bblayers.conf
manually or use the bitbake-layers add-layer
to automate it. Note that adding it manually will be faster, but may increase the likelihood of typos or syntax errors. The sequence below is an example of how to apply these scripts. You may cut-and-paste the commands below into a local script to further automate this flow. The resulting layer.conf
and bblayers.conf
are shown below.
Setup the Bitbake Environment
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Create Yocto Layer |
---|
| export LAYER=example # your layer name goes here
Setup Bitbake Environment |
|
# From Yocto root directory
source setupsdk
# Optional: Make a backup copy of local.conf and bblayers.conf
cp conf/local.conf conf/local.conf.bk
cp conf/bblayers.conf conf/bblayers.conf.bk
# Add a default MACHINE in local.conf or specify on the command line for bitbake, e.g. MACHINE=zcu102-zynqmp
echo 'MACHINE ?= "zcu102-zynqmp"' >> conf/local.conf
# Create your layer in the sources directory
|
Create Your Custom Layer
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Create Custom Yocto Layer |
---|
|
export LAYER=example
cd ../sources
bitbake-layers create-layer meta-$LAYER
# Create custom layer directory structure for Xilinx components
cd meta-$LAYER
mkdir -p conf/machine recipes-kernel/linux-xlnx recipes-bsp/{u-boot/u-boot-xlnx recipes-bsp/,device-tree/files \
recipes-bsp/hdf/files recipes-bsp/fsbl/files recipes-bsp/pmu-firmware/files
# Add new layer with bitbake-layers or edit bblayers.conf manually
cd ../../build}
cd $BBPATH
bitbake-layers add-layer ../sources/meta-$LAYER
|
Warning |
---|
|
In releases rel-v2018.1 and rel-v2018.2 , edit conf/layer.conf . If there is a double backward slash “\\” in the BBFILES variable, delete one backward slash, so there is only a single backward slash “\” . This is required for proper line continuation, otherwise your bbappend files will not be found. |
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | layer.conf |
---|
|
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-example"
BBFILE_PATTERN_meta-example = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-example = "6" |
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | bblayers.conf |
---|
|
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/emil/yocto/sources/core/meta \
/home/emil/yocto/sources/core/meta-poky \
<...>
/home/emil/yocto/sources/core/../meta-xilinx/meta-xilinx-bsp \
/home/emil/yocto/sources/core/../meta-xilinx/meta-xilinx-contrib \
/home/emil/yocto/sources/core/../meta-xilinx-tools \
/home/emil/yocto/sources/core/../meta-petalinux \
/home/emil/yocto/sources/core/../meta-virtualization \
/home/emil/yocto/sources/core/../meta-openamp \
/home/emil/yocto/sources/meta-example \
"
BBLAYERS_NON_REMOVABLE ?= "
\
/home/emil/yocto/sources/core/meta \
" |
Custom Layer Directory Structure
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | meta-example |
---|
|
$ tree meta-example
meta-example
├── conf
│ ├── layer.conf
│ └── machine
├── COPYING.MIT
├── README
├── recipes-bsp
│ ├── device-tree
│ │ └── files
│ ├── fsbl
│ │ └── files
│ ├── hdf
│ │ └── files
│ ├── pmu-firmware
│ │ └── files
│ └── u-boot
│ └── u-boot-xlnx
├── recipes-example
│ └── example
│ └── example.bb
└── recipes-kernel
└── linux-xlnx
|
Warning |
---|
|
In releases rel-v2018.1 and rel-v2018.2 , you may need to edit conf/layer.conf . If there is a double backward slash “\\” in the BBFILES variable, delete one backward slash, so there is only a single backward slash “\” . This is required for proper line continuation, otherwise your bbappend files will not be found. |
Verify Your Layer
You can verify that your custom layer has been properly added to the Yocto build system by running bitbake-layers
show-layers
as shown below.
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | bitbake |
---|
|
$ MACHINE=example-zcu102-zynqmp bitbake petalinux-image-minimal |
Info |
---|
title | baking |
---|
Make sure you have sourced setupsdk and you are in the build directory when baking. |
Related LinksRelated Links
Install and Build with Xilinx Yocto
Adding a Hardware Platform to a Xilinx Yocto Layer
...
Xilinx Yocto Builds without an Internet Connection
References
Yocto Project Mega-Manual (2.4.4)Documentation