Difference between revisions of "Xen on ARM and Yocto"

From Xen
Line 9: Line 9:
   
 
$ git clone -b warrior http://git.openembedded.org/meta-openembedded
 
$ git clone -b warrior http://git.openembedded.org/meta-openembedded
$ git clone http://github.com/cazfi/meta-games.git
 
 
$ git clone -b warrior https://git.yoctoproject.org/git/meta-virtualization
 
$ git clone -b warrior https://git.yoctoproject.org/git/meta-virtualization
   
Line 15: Line 14:
   
 
git clone -b warrior https://github.com/Xilinx/meta-xilinx.git
 
git clone -b warrior https://github.com/Xilinx/meta-xilinx.git
 
meta-games is needed for sdl but freeciv causes issues with warrior. Let's remove it:
 
 
$ rm -rf meta-games/recipes-games/freeciv/
 
   
 
Manually edit conf/bblayers.conf, add the following, where /scratch/repos/poky is the directory where you cloned poky previously:
 
Manually edit conf/bblayers.conf, add the following, where /scratch/repos/poky is the directory where you cloned poky previously:
Line 29: Line 24:
 
/scratch/repos/poky/meta-openembedded/meta-python \
 
/scratch/repos/poky/meta-openembedded/meta-python \
 
/scratch/repos/poky/meta-openembedded/meta-networking \
 
/scratch/repos/poky/meta-openembedded/meta-networking \
/scratch/repos/poky/meta-games \
 
 
/scratch/repos/poky/meta-virtualization \
 
/scratch/repos/poky/meta-virtualization \
 
/scratch/repos/poky/meta-xilinx/meta-xilinx-bsp \
 
/scratch/repos/poky/meta-xilinx/meta-xilinx-bsp \
Line 45: Line 39:
 
IMAGE_FSTYPES += "cpio.gz"
 
IMAGE_FSTYPES += "cpio.gz"
 
DISTRO_FEATURES_append=" xen"
 
DISTRO_FEATURES_append=" xen"
IMAGE_INSTALL_append = " busybox dropbear xen-base zlib-dev libsdl-net libsdl-mixer"
+
IMAGE_INSTALL_append = " busybox dropbear xen-base zlib-dev"
 
ASSUME_PROVIDED += "iasl-native"
 
ASSUME_PROVIDED += "iasl-native"
  +
PACKAGECONFIG_remove_pn-xen += " sdl"
 
  +
IMAGE_INSTALL_append = " dropbear"
 
  +
Sdl is enabled by default in the Xen build but it is not actually necessary.
INITRAMFS_IMAGE = "core-image-minimal"
 
  +
If you would like to build QEMU to provide PV backends, such as disk and 9pfs, then you need to add to conf/local.conf:
INITRAMFS_IMAGE_BUNDLE = "1"
 
  +
  +
IMAGE_INSTALL_append += " qemu"
  +
PACKAGECONFIG_pn-qemu += " virtfs xen fdt"
  +
PACKAGECONFIG_remove_pn-qemu += " sdl"
  +
QEMU_TARGETS = "i386 aarch64"
   
If you are using meta-xilinx and building for ''zcu102-zynqmp'', then you also need to add the following to conf/local.conf:
+
If you are using meta-xilinx and building for ''zcu102-zynqmp'', then you also need the following in conf/local.conf:
   
 
BBMULTICONFIG ?= "pmu"
 
BBMULTICONFIG ?= "pmu"

Revision as of 01:59, 9 November 2019

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.

Firstly clone the poky, we are using the warrior release:

$ git clone -b warrior http://git.yoctoproject.org/git/poky
$ cd poky

Download and install the relevant meta repositories:

$ git clone -b warrior http://git.openembedded.org/meta-openembedded
$ git clone -b warrior https://git.yoctoproject.org/git/meta-virtualization

The following is specific to Xilinx:

git clone -b warrior https://github.com/Xilinx/meta-xilinx.git

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

BBLAYERS ?= " \
/scratch/repos/poky/meta \
/scratch/repos/poky/meta-poky \
/scratch/repos/poky/meta-yocto-bsp \
/scratch/repos/poky/meta-openembedded/meta-oe \
/scratch/repos/poky/meta-openembedded/meta-filesystems \
/scratch/repos/poky/meta-openembedded/meta-python \
/scratch/repos/poky/meta-openembedded/meta-networking \
/scratch/repos/poky/meta-virtualization \
/scratch/repos/poky/meta-xilinx/meta-xilinx-bsp \
/scratch/repos/poky/meta-xilinx/meta-xilinx-contrib \
/scratch/repos/poky/meta-xilinx/meta-xilinx-standalone \
"
INHERIT += "externalsrc"
EXTERNALSRC_pn-xen = "/scratch/repos/xen"
EXTERNALSRC_BUILD_pn-xen = "/scratch/repos/xen"

Edit conf/local.conf, add the following or making sure they match if already present (MACHINE is the target platform, here we are using zcu102-zynqmp as reference):

MACHINE ??= "zcu102-zynqmp"
DISTRO = "poky"
IMAGE_FSTYPES += "cpio.gz"
DISTRO_FEATURES_append=" xen"
IMAGE_INSTALL_append = " busybox dropbear xen-base zlib-dev"
ASSUME_PROVIDED += "iasl-native"
PACKAGECONFIG_remove_pn-xen += " sdl"

Sdl is enabled by default in the Xen build but it is not actually necessary. If you would like to build QEMU to provide PV backends, such as disk and 9pfs, then you need to add to conf/local.conf:

IMAGE_INSTALL_append += " qemu" PACKAGECONFIG_pn-qemu += " virtfs xen fdt" PACKAGECONFIG_remove_pn-qemu += " sdl" QEMU_TARGETS = "i386 aarch64"

If you are using meta-xilinx and building for zcu102-zynqmp, then you also need the following in conf/local.conf:

BBMULTICONFIG ?= "pmu"
do_image[mcdepends] = "multiconfig::pmu:pmu-firmware:do_deploy"

and the following to conf/multiconfig/pmu.conf:

MACHINE="zynqmp-pmu" 
DISTRO="xilinx-standalone" 
TMPDIR="${TOPDIR}/pmutmp"


Finally lunch the build!

bitbake core-image-minimal

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