From 5ec2586b28f3aaececd2384028e60d3c4767aea8 Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Fri, 22 Nov 2024 08:26:02 +0200 Subject: [PATCH] neonvm-kernel: fix readme to mention architecture Signed-off-by: Misha Sakhnov --- neonvm-kernel/Dockerfile.kernel-builder | 4 ++-- neonvm-kernel/README.md | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/neonvm-kernel/Dockerfile.kernel-builder b/neonvm-kernel/Dockerfile.kernel-builder index 85095daf4..2e49c41f6 100644 --- a/neonvm-kernel/Dockerfile.kernel-builder +++ b/neonvm-kernel/Dockerfile.kernel-builder @@ -1,5 +1,5 @@ # Force initial check that KERNEL_VERSION is set appropriately -FROM ubuntu:23.10 AS check-arg +FROM ubuntu:23.04 AS check-arg ARG KERNEL_VERSION WORKDIR /build @@ -8,7 +8,7 @@ RUN set -e \ && test -n "${KERNEL_VERSION}" \ && echo "force this as a requirement for build-deps" > /build/arg-check-succeeded -FROM ubuntu:23.10 AS build-deps +FROM ubuntu:23.04 AS build-deps WORKDIR /build RUN apt-get update && apt-get -y install \ diff --git a/neonvm-kernel/README.md b/neonvm-kernel/README.md index 533ad24d4..9e459dd04 100644 --- a/neonvm-kernel/README.md +++ b/neonvm-kernel/README.md @@ -15,29 +15,33 @@ in use, although this can be overridden on an individual VM basis using the ## Upgrading the kernel +NB: upgrading kernel config should be done for both supported architectures. Assuming a plain upgrade (i.e. no additional features to enable), upgrading the kernel can be done with the following sequence of actions: 1. On the host, run: ```sh + export OLD_VERSION= + export NEW_VERSION= + export KERNEL_ARCH=amd64 # replace with the wanted arch, x86_64 or arm64 cd neonvm-kernel # this directory - docker build --build-arg KERNEL_VERSION=$NEW_VERSION --platform linux/x86_64 --target build-deps -t kernel-build-deps -f Dockerfile.kernel-builder . + docker build --build-arg KERNEL_ARCH=$ARCH --build-arg NEW_VERSION=$NEW_VERSION --build-arg OLD_VERSION=$OLD_VERSION --platform linux/x86_64 --target build-deps -t kernel-build-deps -f Dockerfile.kernel-builder . docker run --rm -v $PWD:/host --name kernel-build -it kernel-build-deps bash ``` 2. Then, inside the container, run: ```sh cd linux-$NEW_VERSION - cp /host/linux-config-6.1.92 .config # Copy current config in - make menuconfig + cp /host/linux-config-$ARCH-$OLD_VERSION .config # Copy current config in + make ARCH=$KERNEL_ARCH menuconfig # do nothing; just save and exit, overwriting .config - cp .config /host/linux-config-$NEW_VERSION # NOTE: Different from existing! + cp .config /host/linux-config-$ARCH-$NEW_VERSION # NOTE: Different from existing! ``` 3. Back on the host, finish with: ```sh # compare the two versions - diff linux-config-6.1.92 linux-config-$NEW_VERSION + diff linux-config-$ARCH-$OLD_VERSION linux-config-$NEW_VERSION # If all looks good, delete the old version. This is required so auto-selection works. - rm linux-config-6.1.92 + rm linux-config-$ARCH-$OLD_VERSION ``` Afterwards, it's probably also good to do a search-and-replace repo-wide to update all places that