Skip to content

Commit

Permalink
neonvm-kernel: fix readme to mention architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Misha Sakhnov <[email protected]>
  • Loading branch information
mikhail-sakhnov committed Nov 26, 2024
1 parent 15b68b9 commit 5ec2586
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions neonvm-kernel/Dockerfile.kernel-builder
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 \
Expand Down
16 changes: 10 additions & 6 deletions neonvm-kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<replace with version>
export NEW_VERSION=<replace with 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
Expand Down

0 comments on commit 5ec2586

Please sign in to comment.