From b980c62f43dc5a46944da88924ecd4c4b828abcc Mon Sep 17 00:00:00 2001 From: Dan Middleton Date: Tue, 10 Aug 2021 16:57:23 -0500 Subject: [PATCH] packaging/kernel: Update kernel build doc Clarify dependencies, correct typos, and fill in some gaps. Fixes: #2422 Signed-off-by: Dan Middleton --- tools/packaging/kernel/README.md | 19 +++++++++++++------ tools/packaging/kernel/build-kernel.sh | 5 ----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/packaging/kernel/README.md b/tools/packaging/kernel/README.md index e47c116ea..4f89121e0 100644 --- a/tools/packaging/kernel/README.md +++ b/tools/packaging/kernel/README.md @@ -8,6 +8,14 @@ automates the process to build a kernel for Kata Containers. The `build-kernel.sh` script requires an installed Golang version matching the [component build requirements](../../../docs/Developer-Guide.md#requirements-to-build-individual-components). +It also requires [yq](https://github.com/mikefarah/yq) version 3.4.1 +> **Hint**: `snap install yq --channel=v3/stable` + + +The Linux kernel scripts further require a few packages (flex, bison, and libelf-dev) +See the CI scripts for your distro for more information... +Look for the setup*.sh files [here](https://github.com/kata-containers/tests/tree/main/.ci) + ## Usage @@ -17,9 +25,6 @@ Overview: Build a kernel for Kata Containers -Description: This script is the *ONLY* to build a kernel for development. - - Usage: build-kernel.sh [options] @@ -49,14 +54,16 @@ Options: Example: ``` -$ ./build-kernel.sh -v 4.19.86 -g nvidia -f -d setup +$ ./build-kernel.sh -v 5.10.25 -g nvidia -f -d setup ``` > **Note** -> - `-v 4.19.86`: Specify the guest kernel version. +> - `-v 5.10.25`: Specify the guest kernel version. > - `-g nvidia`: To build a guest kernel supporting Nvidia GPU. > - `-f`: The `.config` file is forced to be generated even if the kernel directory already exists. > - `-d`: Enable bash debug mode. +> **Hint**: When in doubt look at [versions.yaml](../../../versions.yaml) to see what kernel version CI is using. + ## Setup kernel source code @@ -90,7 +97,7 @@ on this path, the following command will install it to the default Kata containers path (`/usr/share/kata-containers/`). ```bash -$ ./build-kernel.sh install +$ sudo ./build-kernel.sh install ``` ## Submit Kernel Changes diff --git a/tools/packaging/kernel/build-kernel.sh b/tools/packaging/kernel/build-kernel.sh index d0ab1c264..828939a6c 100755 --- a/tools/packaging/kernel/build-kernel.sh +++ b/tools/packaging/kernel/build-kernel.sh @@ -4,10 +4,6 @@ # # SPDX-License-Identifier: Apache-2.0 -description=" -Description: This script is the *ONLY* to build a kernel for development. -" - set -o errexit set -o nounset set -o pipefail @@ -71,7 +67,6 @@ usage() { Overview: Build a kernel for Kata Containers - ${description} Usage: