Deploy Yocto 2.6 codename “Thud” on Raspberry Pi Zero Wireless
Yocto Project Release | LTSI Kernel Version | LTS Kernel Version | Released Kernel Version |
Yocto Project 2.6 | linux-yocto_4.9 | linux-yocto_4.14 | linux-yocto_4.18 |
Clone Yocto Layers
# Create your workspace $ mkdir my_yocto && cd my_yocto ## Clone Git repos # The build system $ git clone -b thud git://git.yoctoproject.org/poky && cd poky # Specific meta for Raspberry Pi boards $ git clone -b thud git://git.yoctoproject.org/meta-raspberrypi
Setup the environment
# Setup the yocto environnement by sourcing the oe init script $ . oe-init-build-env ../build
You had no conf/local.conf file. This configuration file has therefore been created for you with some default values. You may wish to edit it to, for example, select a different MACHINE (target hardware). See conf/local.conf for more information as common configuration options are commented. You had no conf/bblayers.conf file. This configuration file has therefore been created for you with some default values. To add additional metadata layers into your configuration please add entries to conf/bblayers.conf. The Yocto Project has extensive documentation about OE including a reference manual which can be found at: http://yoctoproject.org/documentation For more information about OpenEmbedded see their website: http://www.openembedded.org/ ### Shell environment set up for builds. ### You can now run 'bitbake <target>' Common targets are: core-image-minimal core-image-sato meta-toolchain meta-ide-support
Add specific Meta
Before going further, the meta “Raspberry Pi” has to be declared into the build system of Yocto. Indeed, additional metas are not recognized automatically. To do so, edit the conf/bblayers file as the following.
$ vim build/conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly POKY_BBLAYERS_CONF_VERSION = "2" BBPATH = "${TOPDIR}" BBFILES ?= "" BBLAYERS ?= " \ /home/wp_user/workspace/my_yocto/poky/meta \ /home/wp_user/workspace/my_yocto/poky/meta-poky \ /home/wp_user/workspace/my_yocto/poky/meta-yocto-bsp \ /home/wp_user/workspace/my_yocto/poky/meta-raspberrypi \ "
Choose the target
Then, the last but most cool Yocto step is to choose the target machine. Raspberry Pi are ashamedly not mentioned among default machine choices because it comes from the meta-raspberrypi, so it must be added manually as showed below. All possible machines are available into “my_yocto/poky/meta-raspberrypi/conf/machine/”
Raspberry Pi machines | Model | SOC version |
raspberrypi0 | Raspberry Pi Zero v1.3 | BCM2835 |
raspberrypi0-wifi | Raspberry Pi Zero Wireless | BCM2835 |
raspberrypi2 | Raspberry Pi 2 (model B) | BCM2836 |
raspberrypi3-64 | Raspberry Pi 3 64 bits (model B) | BCM2837 |
raspberrypi3 | Raspberry Pi 3 (model B) | BCM2837 |
raspberrypi-cm3 | Raspberry Pi Compute module 3 | BCM2837 |
raspberrypi-cm | Raspberry Pi Compute module 1 | BCM2835 |
raspberrypi | ? | ? |
$ vim build/conf/local.conf
[...] # This sets the default machine to be qemux86 if no other machine is selected: #MACHINE ??= "qemux86" MACHINE ??= "raspberrypi3" [...]
Build a very first image 🙂
# Install build dependencies (ubuntu and debian) $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm
# Launch the build $ bitbake core-image-base Parsing recipes: 100% |#########################################################################################################################| Time: 0:03:04 Parsing of 817 .bb files complete (0 cached, 817 parsed). 1290 targets, 68 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies Build Configuration: BB_VERSION = "1.40.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "debian-9" TARGET_SYS = "arm-poky-linux-gnueabi" MACHINE = "raspberrypi" DISTRO = "poky" DISTRO_VERSION = "2.6.1" TUNE_FEATURES = "arm armv6 vfp arm1176jzfs callconvention-hard" TARGET_FPU = "hard" meta meta-poky meta-yocto-bsp = "thud:cc73390a75d98b96eb861ae0624283c1ea6ef1bd" meta-raspberrypi = "thud:a48743dc36e31170cf737e200cc88f273e13611a"
Troubleshooting
The first build is very time, memory and power consuming for your host machine !
≈ 50Go
≈ 1h of work
(with 8 cores CPU Intel Xeon 2620 v4 @ 2.1Ghz and 100Mbps internet bandwidth)
3 Comments
pkrishna12@gmail.com · June 1, 2019 at 6:42 am
After following above steps i getting following errors.
wpa-supplicant.cortexa7t2hf_neon_vfpv4 2.6-r0
Error: Transaction failed
ERROR: core-image-base-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/RPi3/Try2/poky/build/tmp/work/raspberrypi3-poky-linux-gnueabi/core-image-base/1.0-r0/temp/log.do_rootfs.13469
ERROR: Task (/home/RPi3/Try2/poky/meta/recipes-core/images/core-image-base.bb:do_rootfs) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 3401 tasks of which 3180 didn’t need to be rerun and 1 failed.
Summary: 1 task failed:
/home/RPi3/Try2/poky/meta/recipes-core/images/core-image-base.bb:do_rootfs
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
AntonioBanderas · July 11, 2019 at 8:51 am
The build was successful, but how do I copy/run it on my Raspberry PI?
How to build a Yocto image for the Raspberry Pi running Azure IoT Edge – Kevin Saye · June 21, 2019 at 12:37 am
[…] https://www.codecubix.eu/linux/linux-yocto-on-raspberry-pi/ […]