This document provides steps to build a Yocto Project-based Service OS (SOS) that runs on the ACRN hypervisor. It involves cloning source code repositories, modifying configuration files to set board/kernel options, and building images using BitBake. Key steps include adding the Meta-ACRN layer, selecting the ACRN kernel, and configuring the bootloader to launch the ACRN hypervisor at boot.
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Build Yocto SOS on ACRN
1. How to Build a Yocto Based SOS on ACRN
Fuzhong Liu
Key contributors: Wenling Zhang Nanlin Xie
2. Disclaimer
• I’m from ACRN CI team; not a Yocto
Projector and Meta-ACRN expert
• Basic Yocto Project and ACRN hypervisor
knowledge is appreciated from audience
3. Agenda
• Yocto Project introduction
• Meta-ACRN introduction
• Steps about Build Yocto based SOS on ACRN
• ACRN issue case study
4. Agenda
• Yocto Project introduction
• Meta-ACRN introduction
• Steps about Build Yocto based SOS on ACRN
• ACRN issue case study
6. Yocto Project
• Linux Foundation collaborative open source project
• Standard tools and process for building embedded Linux
• Based on the well-established OpenEmbedded
• Major components: bitbake, oe-core, Poky distro, BSP
layers
• Users: Zephyr SDK, AGL, OpenBMC, GNOME-continuous
etc.
14. Agenda
• Yocto Project introduction
• Meta-ACRN introduction
• Steps about Build Yocto based SOS on ACRN
15. Steps about Build Yocto based SOS on ACRN
• Yocto Project introduction
• Meta-ACRN introduction
• Steps about build Build Yocto based SOS on
ACRN
16. Steps about Build Yocto based SOS on ACRN
Clone Poky Repo
git clone https://git.yoctoproject.org/git/poky
cd poky
git checkout origin/master -b my-master
cd ..
Clone meta-intel repo
git clone https://git.yoctoproject.org/git/meta-
intel
cd meta-intel
git checkout origin/master -b my-master
cd ..
Clone meta-acrn repo
git clone https://github.com/intel/meta-acrn.git
cd meta-acrn
git checkout origin/master -b my-master
cd ..
Add all necessary layers
source poky/oe-init-build-env build
bitbake-layers add-layer ../meta-intel
bitbake-layers add-layer ../meta-acrn
Step 1:
Clone Source Code
17. Steps about Build Yocto based SOS on ACRN
There is a prototype example distro called acrn-demo-sos
Something like this in local.conf:
MACHINE = "intel-corei7-64"
TMPDIR = "${TOPDIR}/master-acrn-sos"
DISTRO = "acrn-demo-sos"
#if you want to modify BOARD and SCENARIO, also modify in
local.conf:
ACRN_BOARD = "whl-ipc-i5"
ACRN_SCENARIO= "industry"
#if you want to enlarge the rootfs size(60G in my case), please
refer below cmd:
IMAGE_ROOTFS_EXTRA_SPACE = "62914560"
# Set kernel for SOS
#if you want to build SOS using acrn-kernel
PREFERRED_PROVIDER_virtual/kernel = "acrn-kernel-sos"
Step 2:
Modify local.conf
18. Steps about Build Yocto based SOS on ACRN
Step 3:
Modify acrn-common.inc
root@clr-sos~/meta-acrn/recipes-core/acrn # vim acrn-common.inc
SUMMARY = "A Type 1 hypervisor stack, running directly on the bare-metal hardware"
HOMEPAGE = "https://projectacrn.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5732af37bf18525ed9d2b16985054901"
SRC_URI = "git://github.com/projectacrn/acrn-hypervisor.git;branch=release_1.5
file://paths.patch
file://0001-hypervisor-Makefile-do-not-strip.patch
file://0001-acrn-config-append-kconfig-setting-on-new-board.patch
file://0001-HV-enable-cpu-sharing-by-default.patch"
# Snapshot tags are of the format:
# acrn-<year>w<week>.<day>-<timestamp><pass|fail>
PV = "1.5.1"
SRCREV = "e13c6dec9215701117bc76eacb09ad4f6ad55306“
# 1 for release build, 0 for debug build.
ACRN_RELEASE ?= "0“
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19. Steps about Build Yocto based SOS on ACRN
Step 4:
Modify acrn-kernel.inc
root@clr-sos~/meta-acrn/recipes-kernel/linux # vim acrn-kernel.inc
require recipes-kernel/linux/linux-intel_4.19.bb
KBRANCH = "master"
SRC_URI_remove = "git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=${KBRANCH};"
SRC_URI_prepend = "git://github.com/projectacrn/acrn-kernel.git;protocol=https;name=machine;branch=${KBRANCH};"
# tag: v1.5.1
LINUX_VERSION = "4.19.73"
SRCREV_machine = "0bf3d99ba46b80a87f7b0f2864ba0432e34a9070"
KERNEL_EXTRA_FEATURES += " cfg/hv-guest.scc cfg/paravirt_kvm.scc "
20. Steps about Build Yocto based SOS on ACRN
Step 5:
Modify acrn-efi-setup.sh
root@clr-sos~/meta-acrn/recipes-core/acrn/acrn-efi-setup # vim acrn-efi-setup.sh
#! /bin/sh
# Copyright (C) 2019 Intel
# MIT licensed
# TODO: lots of hardcoded values in here. Need a generic solution.
set -e
# Prune previous ACRN boot entries
for boot in $(efibootmgr | perl -n -e '/Boot([0-9a-fA-F]+).*ACRN.*/ && print "$1n"'); do
efibootmgr -b $boot -B
done
efibootmgr -c -l "EFIBOOTacrn.efi"
-L "ACRN (Yocto)"
-u "bootloader=EFIBOOTbootx64.efi uart=disabled"
21. Steps about Build Yocto based SOS on ACRN
Step 6:
bitbake acrn-image-base