Difference between revisions of "Xen on ARM and Yocto"

From Xen
Line 1: Line 1:
Follow these instructions to cross-compile a minimal Dom0 initramfs with all the Xen tools for ARM64 platforms. The build runs on x86 machines, while the target is ARM64 platforms.
+
Follow these instructions to cross-compile a minimal Dom0 initramfs, with all the Xen tools, for ARM64 platforms. The build runs on x86 machines, while the target is ARM64. In this example, we are targeting Xilinx Zynq MPSoCs.
   
First we need to clone the Yocto and meta-virtualization repositories and checkout the right branches. Here we are using the ''krogoth'' release.
+
First we need to clone the yocto and meta-virtualization repositories and checkout the right branches. Here we are using the ''krogoth'' release.
   
 
git clone http://git.yoctoproject.org/git/poky
 
git clone http://git.yoctoproject.org/git/poky
Line 17: Line 17:
 
cd ..
 
cd ..
   
Make sure to also checkout the following if your target is a Xilinx MPSoC board:
+
The following is specific to Xilinx:
   
 
git clone https://github.com/Xilinx/meta-xilinx.git
 
git clone https://github.com/Xilinx/meta-xilinx.git
Line 57: Line 57:
 
bitbake core-image-minimal
 
bitbake core-image-minimal
   
The output will be found under build/tmp/deploy/images.
+
The output will be under build/tmp/deploy/images.

Revision as of 22:14, 20 April 2017

Follow these instructions to cross-compile a minimal Dom0 initramfs, with all the Xen tools, for ARM64 platforms. The build runs on x86 machines, while the target is ARM64. In this example, we are targeting Xilinx Zynq MPSoCs.

First we need to clone the yocto and meta-virtualization repositories and checkout the right branches. Here we are using the krogoth release.

git clone http://git.yoctoproject.org/git/poky
cd poky
git checkout -b krogoth origin/krogoth
git clone https://git.yoctoproject.org/git/meta-virtualization
cd meta-virtualization
git checkout -b krogoth origin/krogoth
cd ..
git clone git://git.openembedded.org/meta-openembedded
cd meta-openembedded
git checkout -b krogoth origin/krogoth
cd ..

The following is specific to Xilinx:

git clone https://github.com/Xilinx/meta-xilinx.git
cd meta-xilinx
git checkout -b krogoth origin/krogoth
cd ..

Add xen_4.8.0.bb to meta-virtualization/recipes-extended/xen, make sure to edit the file to specify the git url, branch and revision you want to be built. Then execute:

source oe-init-build-env

Manually edit conf/bblayers.conf, add the following, where /local/repos/yocto is the directory where you cloned poky previously:

BBLAYERS ?= " \
  /local/repos/yocto/poky/meta \
  /local/repos/yocto/poky/meta-poky \
  /local/repos/yocto/poky/meta-yocto-bsp \
  /local/repos/yocto/poky/meta-openembedded/meta-oe \
  /local/repos/yocto/poky/meta-openembedded/meta-python \
  /local/repos/yocto/poky/meta-openembedded/meta-networking \
  /local/repos/yocto/poky/meta-virtualization \
  /local/repos/yocto/poky/meta-xilinx \
  "

Edit conf/local.conf, add the following, making sure to set MACHINE to your target platform (here we are using zcu102-zynqmp as reference):

MACHINE ??= "zcu102-zynqmp"
IMAGE_INSTALL_append = " dropbear"

INITRAMFS_IMAGE = "core-image-minimal"
INITRAMFS_IMAGE_BUNDLE = "1"
IMAGE_FSTYPES += "cpio.gz"
  
DISTRO_FEATURES_append=" xen"
IMAGE_INSTALL_append = " dropbear xen-base zlib-dev libsdl libsdl-mixer"
ASSUME_PROVIDED += "iasl-native"

Finally lunch the build!

bitbake core-image-minimal

The output will be under build/tmp/deploy/images.