Top Banner
Yocto vs Buildroot: A case study of SPEC7 Mamta Shukla, BE-CO-HT 1 SoC Interest Group Meeting : 01/07/2020
35

Yocto vs Buildroot: A case study of SPEC7

Mar 20, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Yocto vs Buildroot: A case study of SPEC7

Yocto vs Buildroot: A case study of SPEC7

Mamta Shukla, BE-CO-HT

1

SoC Interest Group Meeting : 01/07/2020

Page 2: Yocto vs Buildroot: A case study of SPEC7

Outline:

● Introduction● Parameters for comparison● Case study of SPEC7 (Simple PCI express Carrier 7)

2

Page 3: Yocto vs Buildroot: A case study of SPEC7

Outline:

● Introduction● Parameters for comparison● Case study of SPEC7 (Simple PCI express Carrier 7)

3

Page 4: Yocto vs Buildroot: A case study of SPEC7

Buildroot

4

● Simple and easy-to-use tool to generate embedded linux systems using cross-compilation.

● Output is a root file system● Uses existing technologies - make and kconfig● Supports ~1200 packages● Focuses more on simplified and minimalistic build

Page 5: Yocto vs Buildroot: A case study of SPEC7

Yocto and Open Embedded Core

5

● It is an umbrella project/ecosystem focusing on - open-embedded core - poky distribution● Output is a linux distribution● Uses Packages to create all basic blocks of

embedded distribution● Doesn’t maintain/build support for each device,

rather support is provided by vendors by upstreaming vendor-specific meta-layers

● Focuses more on versatility

Page 6: Yocto vs Buildroot: A case study of SPEC7

Outline:

● Introduction● Parameters for comparison● Case study of SPEC7 (Simple PCI express Carrier 7)

6

Page 7: Yocto vs Buildroot: A case study of SPEC7

7

Parameters Buildroot Yocto

Complexity Simple and easy to start with. Requires steep learning curve.

Reconfiguration/Flexibility

Needs complete rebuild for each change in package.

Incremental builds allowed with sstate-cache

Size and Build Time requirements

5MB, For minimum build requires 15 minutes

50GB required for complete distro, Takes 2-3 hrs and few minutes if sstate-cache is available for rebuild

Test Environment Custom Tests with LAVA, run-tests pTest , LAVA, Fuego

Support Community specific Community +Vendor

Page 8: Yocto vs Buildroot: A case study of SPEC7

8

Parameters Buildroot Yocto

Reproducibility Good with config files Quite better because of meta-layers

Release Cycles Once in three months LTS version available with 2 years support

Maintainability -Using branches in Buildroot tree-BR2_EXTERNAL

Easy with a separate meta-layers

Page 9: Yocto vs Buildroot: A case study of SPEC7

Outline:

● Introduction● Parameters for comparison● Case study of SPEC7 (Simple PCI express Carrier 7)

9

Page 10: Yocto vs Buildroot: A case study of SPEC7

SPEC7

10

● SPEC7 stands for Simple PCIe FMC Carrier, based on Xilinx 7-series

FPGAs

● Follow up of SPEC (Simple PCI Express Carrier)

● Can hold one FMC card and an SFP connector

● Zynq 7000 Family SoC (XC7Z030-1FBG676C)

● Dual-Core ARM processor integrated

● It is optimised for low jitter for White Rabbit deployment

● A collaboration between NIKHEF (NL) and CERN

Page 11: Yocto vs Buildroot: A case study of SPEC7

Block Diagram

11

Page 12: Yocto vs Buildroot: A case study of SPEC7

12

[1] https://ohwr.org/project/spec7

Page 13: Yocto vs Buildroot: A case study of SPEC7

13

Configuration: Buildroot

● Uses Kconfig from Linux Kernel● Availability of menuconfig,

oldconfig, defconfig● Easy to build using make and

gives an upstart● Independent build for each

machine

Page 14: Yocto vs Buildroot: A case study of SPEC7

14

Configuration: Yocto

● Distribution configuration● Machine configuration● Image Recipes● meta layers● bblayers.conf and local.conf● Uses bitbake for build ● In this case added meta-spec7

layer

Source: Yocto Project Mega Manual

Page 15: Yocto vs Buildroot: A case study of SPEC7

15

● Buildroot configuration for SPEC7 done by declaring config file and using buildroot defconfigs: BR2_arm=yBR2_cortex_a9=yBR2_ARM_EABIHF=yBR2_ARM_ENABLE_NEON=y

BR2_ARM_FPU_VFPV3=y

● Toolchain and Kernel configuration and similarly for U-boot :BR2_TOOLCHAIN_BUILDROOT_CXX=yBR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"BR2_LINUX_KERNEL=yBR2_LINUX_KERNEL_CUSTOM_GIT=yBR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx"BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xlnx_rebase_v4.14_2018.3"BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"

● For external layers/packages use:BR2_EXTERNAL

Configuration: SPEC7

Page 16: Yocto vs Buildroot: A case study of SPEC7

16

● Yocto configuration requires addition of meta layers in bblayers.conf and values in local.conf.Build configuration after bitbake core-image-minimal:

Configuration: SPEC7

Page 17: Yocto vs Buildroot: A case study of SPEC7

17

Adding custom layer and custom package:

package

<my_package>

<Buildroot>

-Config.in-my_packge.mk-01_package.patch

Page 18: Yocto vs Buildroot: A case study of SPEC7

18

Adding custom layer and custom package:

<meta_layer>

recipe_*

<Yocto>

-conf -my_recipe.bb-my_recipe.bbappend-files -01_layer.patch

Page 19: Yocto vs Buildroot: A case study of SPEC7

19

Adding external HDF/XSA:

● Create new packages for example: bitstream

● Add required files, dependencies in .mk file and update with config.in file

● Other methods include: - Store bitstream in separate file or flash address - fpga load command from uboot - load it from Linux using cat bitstream.bit > /dev/xdevcfg

Buildroot

Page 20: Yocto vs Buildroot: A case study of SPEC7

20

Adding external HDF/XSA:

● Create new packages for example: bitstream

● Add required files, dependencies in .mk file and update with config.in file

● Other methods include: - Store bitstream in separate file or flash address - fpga load command from uboot - load it from Linux using cat bitstream.bit > /dev/xdevcfg

Buildroot

● meta-xilinx-tools layer● Add in your meta-layer:

- conf/machine/spec7.confHDF_BASE = "file://"HDF_PATH = "/path-to/spec7_wr_ref.hdf"

- from 2019.2, HDF_BASE = "file://"

HDF_PATH = "/path-to/spec7_wr_ref.xsa"

Yocto

Page 21: Yocto vs Buildroot: A case study of SPEC7

21

Customizing Kernel:

Yocto Buildroot

● Adding path to custom kernel repository in config file

BR2_LINUX_KERNELBR2_LINUX_KERNEL_CUSTOM_GITBR2_LINUX_KERNEL_CUSTOM_REPO_URLBR2_LINUX_KERNEL_CUSTOM_REPO_VERSIONBR2_LINUX_KERNEL_DEFCONFIG

● Adding recipes-kernel and adding path in .bb file

SRC_URILINUX_VERSIONLINUX_VERSION_EXTENSION_append = "-custom"SRCREV_machinePV = "${LINUX_VERSION}+git${SRCPV}"

Page 22: Yocto vs Buildroot: A case study of SPEC7

22

Build Process and Time:

● Buildroot uses make and options available with make are :

make menuconfigmake busybox-menuconfigmake linux-menuconfigmake [all]

● Yocto uses bitbake :

bitbake core-image-minimalbitbake core-image-satobitbake -c clean worldbitbake busybox

Buildroot Yocto

Page 23: Yocto vs Buildroot: A case study of SPEC7

23

Build Process and Time:

Buildroot

source

extract

patch

configure

compile

install target

install staging

install images

Page 24: Yocto vs Buildroot: A case study of SPEC7

24

Build Process and Time:

24

Build Process and Time:

Buildroot

source

extract

patch

configure

compile

install target

install staging

install images

Yocto

fetch

source

patch

configure

install deploy

compile

Page 25: Yocto vs Buildroot: A case study of SPEC7

25

Visualizing the Build dependencies:

● Buildroot: ● To generate a dependency graph:

make graph-dependsmake <pkg>-graph-depends

● To generate the build time graph make graph-build

● To generate filesystem size contributionmake graph-size

● Yocto:● To observe build dependencies

bitbake -g <target_name>bitbake -g -u taskexp <target_name>

● Scripts available to generate buildtstats: bb-matrix.sh

pybootchartgui Buildstats.diff

Page 26: Yocto vs Buildroot: A case study of SPEC7

26

● make graph-depends● Sequence and structure of all dependencies of SPEC7 config in Buildroot

Page 27: Yocto vs Buildroot: A case study of SPEC7

27

● bitbake -g <target_name>● Few recipes which are executed while building the distribution

Page 28: Yocto vs Buildroot: A case study of SPEC7

28

Conclusion:

● Complete system build from source with choice of kernel and bootloader

● Allow modifying packages with patches or custom configuration files● Can build cross-toolchains for development ● For package manager based approach with frequent upgrades -

choose Yocto ● For less customizations and easy start - choose Buildroot

Page 29: Yocto vs Buildroot: A case study of SPEC7

29

Thank you !

Page 30: Yocto vs Buildroot: A case study of SPEC7

30

Links and Resources:

[1] https://ohwr.org/project/spec7

[2] https://buildroot.org/

[3] https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html

[4] https://gitlab.cern.ch/mshukla/meta-spec7

[5] https://wiki.yoctoproject.org/wiki/Ptest

Page 31: Yocto vs Buildroot: A case study of SPEC7

31

Back up….

Page 32: Yocto vs Buildroot: A case study of SPEC7

32

Testing the Embedded system:

● Boot Up Time● Tests with frameworks like LAVA● pTest● Fuego

Page 33: Yocto vs Buildroot: A case study of SPEC7

33

Building embedded systems for SoC:

● Build everything from scratch

● Build using tools like Yocto, Buildroot, OpenWrt

● Build using Distro

Page 34: Yocto vs Buildroot: A case study of SPEC7

34

WhiteRabbit PLL and Clocks

Page 35: Yocto vs Buildroot: A case study of SPEC7

35

SFP and HPC for Mezzanine