Yocto: Building Yocto with meta-altera

丌官承
2023-12-01

https://rocketboards.org/foswiki/Documentation/YoctoDoraBuildWithMetaAltera

Introduction

This describes adding the meta-altera layer to the vanilla Yocto sources. Optionally, you can add the meta-linaro layer and compile the linaro toolchain. Please note that there is plenty of documentation available for Yocto, a great starting place is https://www.yoctoproject.org/documentation. This site only documents the SoC specific instructions.

Yocto 2.0 Jethro

Please be sure to read the Quick Start Guide for any host dependencies. http://www.yoctoproject.org/docs/2.0/yocto-project-qs/yocto-project-qs.html

Setup Repos

First we need to checkout all of the relevant repositories

git clone -b jethro git://git.yoctoproject.org/poky.git
pushd poky
git clone -b jethro git://github.com/kraj/meta-altera.git
git clone -b jethro git://git.linaro.org/openembedded/meta-linaro.git
popd

Prepare for and configure the build

Here we source the oe setup script, and configure the local.conf and bblayers.conf
source poky/oe-init-build-env ./build
You should see something like
### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'

Configure bblayers.conf

vi conf/bblayers.conf
Change the file from (and yes, the path should reflect the path to your source files)
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /path/to/poky/meta \
  /path/to/poky/meta-yocto \
  /path/to/poky/meta-yocto-bsp \
  "
BBLAYERS_NON_REMOVABLE ?= " \
  /path/to/poky/meta \
  /path/to/poky/meta-yocto \
  "
to
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /path/to/poky/meta \
  /path/to/poky/meta-yocto \
  /path/to/poky/meta-yocto-bsp \
  /path/to/poky/meta-altera \
  /path/to/poky/meta-linaro/meta-linaro-toolchain \
  "
BBLAYERS_NON_REMOVABLE ?= " \
  /path/to/poky/meta \
  /path/to/poky/meta-yocto \
  "

Configure local.conf

The only edit NEEDED is to change the machine, but here we will add support for compiling and using the linaro toolchain
vi conf/local.conf
Add
MACHINE = "cyclone5"
to the top of the Machine Selection section like this for the Cyclone5 SoC (use "arria5" for the Arria5 SoC or "arria10" for the Arria 10 SoC)
#
# Machine Selection
#
# You need to select a specific machine to target the build with. There are a selection
# of emulated machines available which can boot and run in the QEMU emulator:
#
MACHINE = "cyclone5"
#MACHINE ?= "qemuarm"
......

On my machine I also had to comment out the following:

#ASSUME_PROVIDED += "libsdl-native"

Now add in support for the linaro toolchain:

For older kernels from linux-altera-ltsi_3.10 to linux-altera_4.2 use the 4.9 toolchain
GCCVERSION = "linaro-4.9"
DEFAULTTUNE = "cortexa9hf-neon"
For the linux-altera-ltsi_4.1 and linux-altera_4.3+ kernels
GCCVERSION = "linaro-5.2"
DEFAULTTUNE = "cortexa9hf-neon"

Building the kernel and filesystem

Please note that this does NOT build the altera-image rootfs added in the poky-socfpa git repository on rocketboards.org

First, consider explicitly setting the kernel you wish to build. You can do this by editing conf/local.conf. There are a few kernels available in meta-altera:

  • linux-altera → released kernel versions (currently 4.2/4.3/4.4) tied to a specific tested tag
  • linux-altera-dev → Current development branch of the kernel (4.4 at the moment)
  • linux-altera-ltsi → Released LTSI kernels (3.10/4.1) tied to a specific tested tag
  • linux-altera-ltsi-rt → LTSI kernel with Real Time patches (3.10) tied to a specific tested tag
  • linux-altera-ltsi-dev → Current development branch of ltsi kernel (4.1)
The specify use of the 4.2 linux-altera kernel, add the following to conf/local.conf:
PREFERRED_PROVIDER_virtual/kernel = "linux-altera"
PREFERRED_VERSION_linux-altera = "4.2%"
To specify the 3.10 LTSI kernel:
PREFERRED_PROVIDER_virtual/kernel = "linux-altera-ltsi"
PREFERRED_VERSION_linux-altera-ltsi = "3.10%"
or to specify the linux-altera-dev kernel:
PREFERRED_PROVIDER_virtual/kernel = "linux-altera-dev"
The following build the bootloader, the rootfs, and the kernel.The first one takes a while b/c it will build to toolchain and all prerequisites.
bitbake virtual/bootloader
Parsing recipes: 100% |##############################################################################################| Time: 00:00:29
Parsing of 910 .bb files complete (0 cached, 910 parsed). 1265 targets, 54 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
  /data/dwesterg/socfpga/test/poky/meta-altera/recipes-core/netbase/netbase_5.0.bbappend
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.20.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "socfpga_cyclone5"
DISTRO            = "poky"
DISTRO_VERSION    = "1.5.1"
TUNE_FEATURES     = "armv7a vfp neon"
TARGET_FPU        = "vfp-neon"
meta              
meta-yocto        
meta-yocto-bsp    = "dora:0a6f0dbf9476dcb4a17a210af90e2dd1a43b61aa"
meta-altera       = "angstrom-v2013.12-yocto1.5:f53e9a9e5701392e178b93deeeca9e22554f2b1c"
meta-linaro-toolchain = "dora:503b1fe68f90a8e2b43c456ddd17a0a90816cf9c"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
WARNING: Checksum failure encountered with download of http://www.yoctoproject.org/downloads/pseudo/pseudo-1.5.1.tar.bz2 - will attempt other sources if available
WARNING: Renaming /data/dwesterg/socfpga/test/build/downloads/pseudo-1.5.1.tar.bz2 to /data/dwesterg/socfpga/test/build/downloads/pseudo-1.5.1.tar.bz2_bad-checksum_27e7397b57f401655762a055a69c3c7e
Currently 1 running tasks (209 of 222):
0: gcc-runtime-linaro-4.8-r2013.12 do_compile (pid 7081)

.......
and the rest
bitbake virtual/kernel
lastly,
bitbake core-image-minimal

In Conclusion

The results of your hard work can be found in tmp/deploy/images.You can follow any of the other guides on rocketboards.org to create the preloader and sdcard images specific to your design.

Please note that there is a plethora of literature on yoctoproject.org that describes adding, modifying, and extending layers.

Notes

Thanks,dw

Linaro 5.2 + Jethro Errors

Packaging Issue

When virtual/bootloader is building Linaro 5.2 there is a failure when creating the RPM package. The error would be something similar to:
Log data follows:
| DEBUG: Executing python function sstate_task_prefunc
| DEBUG: Python function sstate_task_prefunc finished
| DEBUG: Executing python function do_package_write_rpm
| DEBUG: Executing python function read_subpackage_metadata
| DEBUG: Python function read_subpackage_metadata finished
| DEBUG: Executing python function do_package_rpm
| DEBUG: Executing python function write_specfile
| NOTE: Creating RPM package for libgcc1
| NOTE: Creating RPM package for libgcc-s-dev
| NOTE: Creating RPM package for libgcc-s-dbg
| DEBUG: Python function write_specfile finished
| DEBUG: PKGWRITEDIR: /home/user/soc/yocto/jethro/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/libgcc/linaro-5.2-r2015.11-2/deploy-rpms/cortexa9hf_vfp_neon
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'arm-32', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function BUILDSPEC
| error: line 4: invalid tag value("^[A-Za-z0-9+._]+$") Release: Release: r2015.11-2
| error: Package has no %description: libgcc-linaro+5.2.cortexa9hf_vfp_neon
| Building target platforms: cortexa9hf_vfp_neon-poky-linux-gnueabi
| WARNING: exit code 1 from a shell command.
| DEBUG: Python function do_package_rpm finished
| DEBUG: Python function do_package_write_rpm finished
| ERROR: Function failed: BUILDSPEC (log file is located at /home/user/soc/yocto/jethro/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/libgcc/linaro-5.2-r2015.11-2/temp/log.do_package_write_rpm.27765)

Edit conf/layers.conf and change the package type to ipk.

#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends 
# can be enabled at once and the first item listed in the variable will be used 
# to generate the root filesystems.
# Options are:
#  - 'package_deb' for debian style deb files
#  - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
#  - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
PACKAGE_CLASSES ?= "package_rpm"

becomes

#
# Package Management configuration
#
# This variable lists which packaging formats to enable. Multiple package backends 
# can be enabled at once and the first item listed in the variable will be used 
# to generate the root filesystems.
# Options are:
#  - 'package_deb' for debian style deb files
#  - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
#  - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
PACKAGE_CLASSES ?= "package_ipk"

QA Issue

ERROR: QA Issue: gcc-runtime: Files/directories were installed but not shipped in any package:
  /usr/lib/libstdc++fs.la
  /usr/lib/libstdc++fs.a
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
gcc-runtime: 2 installed and not shipped files. [installed-vs-shipped]
Apply the patch for this (abandoned) issue: https://review.linaro.org/#/c/11606/
 类似资料:

相关阅读

相关文章

相关问答