Yocto meta-acrn Layer Introduction
Naveen Saini
Naveen Saini <naveen.kumar.saini@intel.com>
05/13/2020
Agenda
• Yocto Project Introduction
• Meta-acrn Objective & Internals
• Configure & Build
• Booting ACRN
• Useful links
Yocto Project
Yocto Project
➢ Linux Foundation collaborative open source project
➢ Standard tools and process for building embedded Linux
➢ Based on the well-established OpenEmbedded Project
➢ It’s not a Linux distribution!
➢ Core components: bitbake, oe-core, Poky distro, BSP layers
Yocto Project
➢ Development model of the Yocto Project is Layer model.
➢ Layers are repositories that contain related sets of instructions that tell the
build system what to do.
➢ Layers can be BSP, GUI, distro configuration, middleware or application
layers.
➢ https://git.yoctoproject.org/
Concepts
➢Layer (meta-*)
➢Recipes (.bb)
➢Configuration files (.conf)
➢Classes (.bbclass)
➢Append files (.bbappend)
Yocto Project
The Yocto Project Development Environment
Meta-acrn Layer
Meta-acrn
➢Integrate ACRN hypervisor with the yocto project.
➢Provides kernel support
➢Linux-intel-lts
➢Linux-intel-rt
➢Acrn-kernel
➢Maintains additional acrn specific kernel configuration for both Service OS
and User OS
Meta-acrn
➢Distro configurations
➢acrn-demo-sos.conf for Service OS
➢acrn-demo-uos.conf for User OS
➢Provides customized image configuration for ACRN
➢acrn-image-base (small footprint, non GUI)
➢acrn-image-sato(GUI with X11)
➢acrn-image-Weston (GUI with Weston)
➢Additional patches for ACRN
➢Network and systemd
Meta-acrn Dependencies
➢ Meta-acrn has dependency on meta-intel layer too besides Core components.
➢ MACHINE configuration ie. intel-corei7-64 and intel-skylake-64
➢ Common Kernel configuration for IA
➢ Media software stack
➢ Carry few other recipe components, to remove dependencies on other layers
➢ Python-kconfiglib
➢ Numactl
Configure & Build
How to build Service OS
➢Clone source repos
$ git clone http://git.yoctoproject.org/git/poky
$ cd poky
$ git clone https://git.yoctoproject.org/git/meta-intel
$ git clone https://github.com/intel/meta-acrn.git
➢ Run environment script
$ source oe-init-build-env
➢ Add meta-intel & meta-acrn to bblayers.conf
$ echo "BBLAYERS += "/path/to/meta-intel"" >> conf/bblayers.conf
$ echo "BBLAYERS += "/path/to/meta-acrn"" >> conf/bblayers.conf
Configure Service OS
➢Append below configuration in conf/local.conf
MACHINE = "intel-corei7-64"
TMPDIR = "${TOPDIR}/master-acrn-sos"
DISTRO = "acrn-demo-sos“
PREFERRED_PROVIDER_virtual/kernel = "linux-intel-acrn-sos"
Multiconfiguration Build
➢ To build different images or packages for different targets
➢ Require different configuration
uos.conf
Build Directory
conf
multiconfig
local.conf
Configure User OS
➢ Add below configuration in conf/multiconf/uos.conf
DISTRO = "acrn-demo-uos"
TMPDIR = "${TOPDIR}/master-acrn-uos"
PREFERRED_PROVIDER_virtual/kernel = "linux-intel-acrn-uos”
Configure User OS(Deploying UOS images into SOS image)
➢Additionally append below configuration in conf/local.conf
BBMULTICONFIG = "uos“
CONTAINER_PACKAGE_DEPLOY_DIR = "${TOPDIR}/master-acrn-
uos/deploy/images/${MACHINE}“
CONTAINER_PACKAGE_MC = "uos“
# Add core-image-base-package to acrn-image-base
IMAGE_INSTALL_append_pn-acrn-image-base = " core-image-base-package“
# Add core-image-sato-package to acrn-image-sato
IMAGE_INSTALL_append_pn-acrn-image-sato = " core-image-sato-package"
Configure User OS
➢ Build SOS image.
$ bitbake acrn-image-base
Or
$ bitbake acrn-image-sato
➢ To re-use the sstate, in order to reduce build time, first build UOS and then SOS image.
$ bitbake mc:uos:core-image-base
$ bitbake acrn-image-base
Or
$ bitbake mc:uos:core-image-sato
$ bitbake acrn-image-sato
➢ On Successful build, SOS image acrn-image-*-intel-corei7-64.wic.acrn image can be
found at master-acrn-sos/deploy/images/${MACHINE}/
Booting ACRN
Booting ACRN from ESP
➢image-acrn.bbclass
➢Creates a modified wic image with acrn.efi injected to ESP
➢First boot only: update EFI boot order to boot ACRN first
➢Shipping acrn-efi-setup.sh script which invokes efibootmgr to setup boot entry for acrn
efi.
➢On first boot, will be normal Linux but will setup EFI entries so that subsequent boots
are inside ACRN.
Booting ACRN
➢ If you are using USB stick to boot, alternatively use the EFI shell, something like this
works:
> fs1:
> EFIBOOTacrn.efi
➢ On successful boot of SOS, you can launch UOS using:
$ /var/lib/machine/launch-bash.sh
Links
➢ Layer Index
https://layers.openembedded.org/layerindex/branch/master/layers/
➢ Yocto Project Quick Build
https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html
➢ Getting started guide for meta-acrn
https://github.com/intel/meta-acrn/blob/master/docs/getting-started.md
Thank you for your
participation!

Project ACRN Yocto Project meta-acrn layer introduction

  • 1.
    Yocto meta-acrn LayerIntroduction Naveen Saini Naveen Saini <naveen.kumar.saini@intel.com> 05/13/2020
  • 2.
    Agenda • Yocto ProjectIntroduction • Meta-acrn Objective & Internals • Configure & Build • Booting ACRN • Useful links
  • 3.
  • 4.
    Yocto Project ➢ LinuxFoundation collaborative open source project ➢ Standard tools and process for building embedded Linux ➢ Based on the well-established OpenEmbedded Project ➢ It’s not a Linux distribution! ➢ Core components: bitbake, oe-core, Poky distro, BSP layers
  • 5.
    Yocto Project ➢ Developmentmodel of the Yocto Project is Layer model. ➢ Layers are repositories that contain related sets of instructions that tell the build system what to do. ➢ Layers can be BSP, GUI, distro configuration, middleware or application layers. ➢ https://git.yoctoproject.org/
  • 6.
    Concepts ➢Layer (meta-*) ➢Recipes (.bb) ➢Configurationfiles (.conf) ➢Classes (.bbclass) ➢Append files (.bbappend)
  • 7.
    Yocto Project The YoctoProject Development Environment
  • 8.
  • 9.
    Meta-acrn ➢Integrate ACRN hypervisorwith the yocto project. ➢Provides kernel support ➢Linux-intel-lts ➢Linux-intel-rt ➢Acrn-kernel ➢Maintains additional acrn specific kernel configuration for both Service OS and User OS
  • 10.
    Meta-acrn ➢Distro configurations ➢acrn-demo-sos.conf forService OS ➢acrn-demo-uos.conf for User OS ➢Provides customized image configuration for ACRN ➢acrn-image-base (small footprint, non GUI) ➢acrn-image-sato(GUI with X11) ➢acrn-image-Weston (GUI with Weston) ➢Additional patches for ACRN ➢Network and systemd
  • 11.
    Meta-acrn Dependencies ➢ Meta-acrnhas dependency on meta-intel layer too besides Core components. ➢ MACHINE configuration ie. intel-corei7-64 and intel-skylake-64 ➢ Common Kernel configuration for IA ➢ Media software stack ➢ Carry few other recipe components, to remove dependencies on other layers ➢ Python-kconfiglib ➢ Numactl
  • 12.
  • 13.
    How to buildService OS ➢Clone source repos $ git clone http://git.yoctoproject.org/git/poky $ cd poky $ git clone https://git.yoctoproject.org/git/meta-intel $ git clone https://github.com/intel/meta-acrn.git ➢ Run environment script $ source oe-init-build-env ➢ Add meta-intel & meta-acrn to bblayers.conf $ echo "BBLAYERS += "/path/to/meta-intel"" >> conf/bblayers.conf $ echo "BBLAYERS += "/path/to/meta-acrn"" >> conf/bblayers.conf
  • 14.
    Configure Service OS ➢Appendbelow configuration in conf/local.conf MACHINE = "intel-corei7-64" TMPDIR = "${TOPDIR}/master-acrn-sos" DISTRO = "acrn-demo-sos“ PREFERRED_PROVIDER_virtual/kernel = "linux-intel-acrn-sos"
  • 15.
    Multiconfiguration Build ➢ Tobuild different images or packages for different targets ➢ Require different configuration uos.conf Build Directory conf multiconfig local.conf
  • 16.
    Configure User OS ➢Add below configuration in conf/multiconf/uos.conf DISTRO = "acrn-demo-uos" TMPDIR = "${TOPDIR}/master-acrn-uos" PREFERRED_PROVIDER_virtual/kernel = "linux-intel-acrn-uos”
  • 17.
    Configure User OS(DeployingUOS images into SOS image) ➢Additionally append below configuration in conf/local.conf BBMULTICONFIG = "uos“ CONTAINER_PACKAGE_DEPLOY_DIR = "${TOPDIR}/master-acrn- uos/deploy/images/${MACHINE}“ CONTAINER_PACKAGE_MC = "uos“ # Add core-image-base-package to acrn-image-base IMAGE_INSTALL_append_pn-acrn-image-base = " core-image-base-package“ # Add core-image-sato-package to acrn-image-sato IMAGE_INSTALL_append_pn-acrn-image-sato = " core-image-sato-package"
  • 18.
    Configure User OS ➢Build SOS image. $ bitbake acrn-image-base Or $ bitbake acrn-image-sato ➢ To re-use the sstate, in order to reduce build time, first build UOS and then SOS image. $ bitbake mc:uos:core-image-base $ bitbake acrn-image-base Or $ bitbake mc:uos:core-image-sato $ bitbake acrn-image-sato ➢ On Successful build, SOS image acrn-image-*-intel-corei7-64.wic.acrn image can be found at master-acrn-sos/deploy/images/${MACHINE}/
  • 19.
  • 20.
    Booting ACRN fromESP ➢image-acrn.bbclass ➢Creates a modified wic image with acrn.efi injected to ESP ➢First boot only: update EFI boot order to boot ACRN first ➢Shipping acrn-efi-setup.sh script which invokes efibootmgr to setup boot entry for acrn efi. ➢On first boot, will be normal Linux but will setup EFI entries so that subsequent boots are inside ACRN.
  • 21.
    Booting ACRN ➢ Ifyou are using USB stick to boot, alternatively use the EFI shell, something like this works: > fs1: > EFIBOOTacrn.efi ➢ On successful boot of SOS, you can launch UOS using: $ /var/lib/machine/launch-bash.sh
  • 22.
    Links ➢ Layer Index https://layers.openembedded.org/layerindex/branch/master/layers/ ➢Yocto Project Quick Build https://www.yoctoproject.org/docs/latest/brief-yoctoprojectqs/brief-yoctoprojectqs.html ➢ Getting started guide for meta-acrn https://github.com/intel/meta-acrn/blob/master/docs/getting-started.md
  • 23.
    Thank you foryour participation!