OpenEmbedded KVM testing

Initial setup

The standard Linaro OE setup is created by:

   1 mkdir openembedded
   2 cd openembedded
   3 git clone git://git.linaro.org/openembedded/jenkins-setup.git
   4 bash init-and-build.sh

For KVM, some changes are needed to conf/site.conf

PREFERRED_PROVIDER_virtual/kernel = "linux-aarch64-kvm"
IMAGE_ROOTFS_EXTRA_SPACE = "1048576"
IMAGE_FSTYPES = "tar.gz ext3 cpio.gz"

building image(s)

For host we build linaro-image-kvm, which is basic linaro image with qemu added and kernel included. For guest core-image-minimal (to have a minimal cpio initramfs)

   1 cd openembedded-core
   2 source oe-init-build-env ../build
   3 bitbake core-image-minimal # guest initramfs image
   4 bitbake linaro-image-kvm # host image
   5 

Once that finishes we copy the guest image to inside host image:

   1 cd build/tmp-eglibc/deploy/images
   2 sudo mount -o loop linaro-image-kvm-genericarmv8-*.rootfs.ext3 /mnt/
   3 sudo cp core-image-minimal-genericarmv8-*.rootfs.cpio.gz /mnt/home/root/
   4 sudo umount /mnt/

Running kvm in model

Start the foundation model, and verify that the kernel messages mention kvm successfully initialized.

   1 Foundation_v8 --image linux-system-foundation.axf --block-device linaro-image-kvm-genericarmv8-*.rootfs.ext3 
   2 ....
   3 kvm [1]: Using HYP init bounce page @ffeb1000
   4 kvm [1]: interrupt-controller@2c004000 IRQ25
   5 kvm [1]: timer IRQ27
   6 kvm [1]: Hyp mode initialized successfully
   7 ...

Start qemu-kvm:

   1 qemu-system-aarch64 -M machvirt -kernel /boot/Image-* -initrd core-image-minimal-genericarmv8-*.rootfs.cpio.gz -append 'earlyprintk=smh rdinit=/bin/sh init=/bin/sh console=ttyAMA0,38400 keep_bootcon' -enable-kvm -nographic

If everything works, you get into shell prompt inside kvm in a moment

Modifying setup

All the build instructions are inside meta-linaro git tree:

https://git.linaro.org/gitweb?p=openembedded/meta-linaro.git;a=summary

Qemu is built with qemu_git.bb inside meta-aarch64. Configure options and git url can be changed there:

https://git.linaro.org/gitweb?p=openembedded/meta-linaro.git;a=blob;f=meta-aarch64/recipes-devtools/qemu/qemu_git.bb

Kernel is is built Marc's tree:

https://git.linaro.org/gitweb?p=openembedded/meta-linaro.git;a=blob;f=meta-aarch64/recipes-kernel/linux/linux-aarch64-kvm_git.bb

arm64/defconfig is in Marc's tree is missing KVM and Foundation model essential config options. These have been hacked into:

https://git.linaro.org/gitweb?p=openembedded/meta-linaro.git;a=blob;f=meta-aarch64/recipes-kernel/linux/files/kvm-config

Changin any of these, and "bitbake linaro-image-kvm" will cook you a new image with the changes.

TODO

ATM putting the job to LAVA would not work as the guest image doesn't seem to shut down.

Jenkins job:

  • Build images
  • submit to lava

LAVA glue:

  • Adapt existing kvm-ci
  • Add tests

Platform/DevPlatform/OpenEmbbeddedAArch64QEMU (last modified 2013-06-13 12:00:32)