27
Building your OS platform for multiple architectures with the Yocto Project AGL AMM Jan-Simon Möller Oct 2017 AGL Release Manager

Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Embed Size (px)

Citation preview

Page 1: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Building your OS platform for multiple architectures with the Yocto ProjectAGL AMM Jan-Simon MöllerOct 2017 AGL Release Manager

Page 2: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Introduction, Topics

Page 3: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

IntroductionDipl.-Ing. Jan-Simon Möller

[email protected]

'DL9PF' on #freenode

AGL Release Manager, EG CIAT Lead

Page 4: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

This talk is about:● Building your OS platform (e.g. Automotive Grade Linux)

– with the Yocto Project– for multiple architectures

● Intel, ● ARM32, ● ARM64/AARCH64

– for multiple boards– from the same codebase– … add yours...– ...and still stay sane

Page 5: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Why at all ?

Page 6: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Example: Automotive Grade Linux

Page 7: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Multiple boards ?● But hey, aren't they the same ARCH ?!

– x86-64● qemux86-64, intel-corei7-64

– ARM 32bit● porter, rpi3, dra7xx-evm, cyclone5, beaglebone, i.mx6

– ARM 64bit / AArch64● m3ulcb, dragonboard-410c

Page 8: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Save time by reusing artifacts !● Yocto builds can take a long time● We can save time by making

effective use of theShared-State-Cache

Page 9: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Save space by sharing artifacts● If we do builds as single silos,

we waste a lot of space● For each developer● On the servers● More $MB means more I/O and thus more time

Page 10: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Ideas ?

Page 11: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Why not group by ARCH ?● We would have 3 target builds then (one per ARCH)● Desktop distro's work that way already … wink, wink● good idea, but:

– Boards ship with a BSP– BSP's today ship with preselections

● some should actually be left-out for the DISTRO to decide (instead of the BSP)

● one of these is the default COMPILER TUNE_FLAGS ● another one is the IMAGE_FSTYPE to output

Page 12: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

ARM 32bit default compiler flags● dra7xx-evm:

– TUNE_FEATURES="arm armv7a vfp thumb neon callconvention-hard"

– TUNE_CCARGS=" -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard"

● porter

– TUNE_FEATURES="arm armv7ve vfp neon callconvention-hard cortexa15"

– TUNE_CCARGS=" -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15"

● raspberrypi3:

– TUNE_FEATURES="arm armv7ve vfp thumb neon vfpv4 callconvention-hard cortexa7"

– TUNE_CCARGS=" -march=armv7ve -marm -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7"

Page 13: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

ARM 64bit default compiler flags● dragonboard-410C:

– DEFAULTTUNE="aarch64"

– TUNE_FEATURES="aarch64"

– TUNE_CCARGS="" # should probably be -march=armv8-a, but implied through compiler default● m3ulcb

– DEFAULTTUNE="cortexa57-cortexa53"

– TUNE_FEATURES="aarch64 cortexa57-cortexa53"

– TUNE_CCARGS=" -march=armv8-a -mtune=cortex-a57.cortex-a53" # big.LITTLE● rpi3-64 )* :

– DEFAULTTUNE="aarch64"

– TUNE_FEATURES="aarch64"

– TUNE_CCARGS=""

Page 14: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

x86-64 default compiler flags● qemux86-64:

– DEFAULTTUNE="core2-64"

– TUNE_FEATURES="m64 core2"

– TUNE_CCARGS=" -m64 -march=core2 -mtune=core2 -mfpmath=sse -msse3"● intel-corei7-64:

– DEFAULTTUNE="corei7-64"

– TUNE_FEATURES="m64 corei7"

– TUNE_CCARGS=" -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2"

Page 15: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Is it possible to ...● group boards by arch ?

– NO. Each board sets different flags● save time by reusing artifacts ?

– NO. Different flags mean different artifacts● share artifacts across boards ?

– No. Different flags mean different artifacts

Page 16: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

What can we do ?

Page 17: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Use DEFAULTTUNE for each ARCH● ARM32

– high profile:● DEFAULTTUNE_arm="armv7vethf-neon-vfpv4"● TUNE_FEATURES="arm armv7ve vfp thumb neon vfpv4 callconvention-hard"● Resulting in:● TUNE_CCARGS=" -march=armv7ve -marm -mfpu=neon-vfpv4 -mfloat-abi=hard"

– requires at least a cortex-a15 -class CPU (VirtualizationExtensions)– Is basically equal to what ARMv8-a supports in 32bit mode (AARCH32)

Page 18: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Use DEFAULTTUNE for each ARCH● ARM32

– medium profile:● DEFAULTTUNE="armv7athf-neon" # vfpv1/2/3 implied for armv7-a with neon● TUNE_FEATURES="arm armv7a vfp neon callconvention-hard"● TUNE_CCARGS=" -march=armv7-a -mfpu=neon -mfloat-abi=hard"

– This requires at least a cortex-a8 -class CPU– It does *not enable* the virtualization extensions and does *not* use vfpv4– It is *very compatible* in terms of broad CPU support for ARM 32bit.

Page 19: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Use DEFAULTTUNE for each ARCH● AArch64:

– DEFAULTTUNE="aarch64"– TUNE_FEATURES="aarch64"– TUNE_CCARGS="-march=armv8-a"

– no default -mtune

Page 20: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Use DEFAULTTUNE for each ARCH● x86-64:

– DEFAULTTUNE="corei7-64"– TUNE_FEATURES="m64 corei7"– TUNE_CCARGS=" -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2"

– INCLUDING qemux86-64 and bump – QEMU_EXTRAOPTIONS_corei7-64 = " -cpu Nehalem,check=false"

Page 21: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Outcome:● 4 default compilation targets with common flags● we can share most packages● build times reduced● reuse of artifacts maximised

Page 22: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

What else is to do ?

Page 23: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Issues● The cflags are just one example:

– BSP patches to core components Yikes ! Boo !● kernel recipe + own linux-libc-headers● wayland/weston● gstreamer● own/separate u-boot

– For maximum reuse, we need to maximise the # of shared components

Page 24: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Next steps ?

Page 25: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Profiles and package feeds● A 'core' profile will contain all components that make up a bootable

image – including security framework and automotive components

● On-top of this 'core' there can be other profiles that reuse the binary artifacts and only ship the new components:– telematics– demo-ui (+wayland-weston)

● demo-ui-html5 (+webengine)● demo-ui-qt5 (+qt5)● demu-ui-gtk (+gtk)

Page 26: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Profiles and package feeds● Package feeds represent these profiles and allow

– boards to boot the minimal 'core' and select/install a profile– the SDK can reuse the rpm feed to install the dependencies

● likely Q1 / 18

Page 27: Building your OS platform for multiple architectures with ...schd.ws/.../26/jsmoeller_Building_your_OS...with_the_Yocto_Project.pdf · with the Yocto Project AGL AMM Jan-Simon Möller

Questions ?