# initialize the repo.
python3 repo init -u git://github.com/Xilinx/yocto-manifests.git -b <release-version>
# repo sync to get all sources
python3 repo sync
Change the memory settings on your machine
This is because of a known issue with Yocto builds. For details, https://confluence.xilinx.com/display/XPS/System+settings+for+Yocto+builds and https://confluence.xilinx.com/display/GUUP/GUUP+FAQ#GUUPFAQ-WhydoesmyPetaLinuxBuildfailwithfailedliblzma:Memoryallocation
sudo sysctl -w vm.overcommit_memory=0
sudo sysctl -w vm.overcommit_ratio=50
# source the environment to build using bitbake.
Add option to generate rootfs image with Yocto build
This option will generate the rootfs in cpio.gz format which will be used in creating boot-scripts step. Rootfs built will contain the useful Xen tools like xl.
# Edit conf/local.conf and Add the below line
IMAGE_FSTYPES += "cpio.gz"
Build using bitbake
Next, we will build the xen-image-minimal image. This will produce Xen, Linux kernel for Xen and rootfs. If only Xen needs to be build, it can done using MACHINE=vck190-versal bitbake xen.
$ MACHINE=vck190-versal bitbake xen-image-minimal
# Please use appropriate yocto machine name to build for a target hardware. Examples:
This step can take a lot of time depending upon host machine processing power. It will also required significant disk space, please see Yocto for more details.
Creating boot scripts
To create boot scripts, we use Imagebuilder which generates a U-Boot script that loads all the necessary binaries and automatically adds the required entries to device tree at boot time. In order to use it, we will need to write a config file first.
First, cd to <current directory>/tmp/deploy/images/$(machine_name). Example: build/tmp/deploy/images/vck190-versal.
Next, create a file named "config" with the contents as illustrated below and save the file.