From e24e94622cfc837e80777b8940b1ffa0080fae07 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Tue, 11 May 2021 10:28:35 -0400 Subject: [PATCH] docs/Developer-Guide: Add instructions to apply QEMU patches Occasionally patches are necessary to build QEMU with the kata containers configuration. This changed the developer guide to make it clear it is recommended to apply the patches; and tell how. Fixes #1807 Signed-off-by: Wainer dos Santos Moschetta --- docs/Developer-Guide.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/Developer-Guide.md b/docs/Developer-Guide.md index 8092703f7..e0ae950c5 100644 --- a/docs/Developer-Guide.md +++ b/docs/Developer-Guide.md @@ -393,14 +393,26 @@ You may choose to manually build your VMM/hypervisor. Kata Containers makes use of upstream QEMU branch. The exact version and repository utilized can be found by looking at the [versions file](../versions.yaml). -Kata often utilizes patches for not-yet-upstream fixes for components, -including QEMU. These can be found in the [packaging/QEMU directory](../tools/packaging/qemu/patches) +There are scripts to manage the build and packaging of QEMU. For the examples below, set your +environment as: +``` +$ go get -d github.com/kata-containers/kata-containers +$ packaging_dir="${GOPATH}/src/github.com/kata-containers/kata-containers/tools/packaging" +``` + +Kata often utilizes patches for not-yet-upstream and/or backported fixes for components, +including QEMU. These can be found in the [packaging/QEMU directory](../tools/packaging/qemu/patches), +and it's *recommended* that you apply them. For example, suppose that you are going to build QEMU +version 5.2.0, do: +``` +$ cd $your_qemu_directory +$ $packaging_dir/scripts/apply_patches.sh $packaging_dir/qemu/patches/5.2.x/ +``` To build utilizing the same options as Kata, you should make use of the `configure-hypervisor.sh` script. For example: ``` -$ go get -d github.com/kata-containers/kata-containers/tools/packaging $ cd $your_qemu_directory -$ ${GOPATH}/src/github.com/kata-containers/kata-containers/tools/packaging/scripts/configure-hypervisor.sh kata-qemu > kata.cfg +$ $packaging_dir/scripts/configure-hypervisor.sh kata-qemu > kata.cfg $ eval ./configure "$(cat kata.cfg)" $ make -j $(nproc) $ sudo -E make install