Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neonvm-kernel: Switch to version 6.6.63 #1170

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion neonvm-kernel/Dockerfile.kernel-builder
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ FROM --platform=linux/amd64 alpine:3.19 AS kernel_amd64
ARG KERNEL_VERSION
COPY --from=build_amd64 /build/linux-${KERNEL_VERSION}/arch/x86/boot/bzImage /vmlinuz

# Build the kernel on amd64
# Build the kernel on arm64
FROM build-deps AS build_arm64
ARG KERNEL_VERSION
ADD linux-config-aarch64-${KERNEL_VERSION} linux-${KERNEL_VERSION}/.config
Expand Down
38 changes: 33 additions & 5 deletions neonvm-kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ in use, although this can be overridden on an individual VM basis using the
Assuming a plain upgrade (i.e. no additional features to enable), upgrading the kernel can be done
with the following sequence of actions:

### On amd64 (x64)

1. On the host, run:
```sh
cd neonvm-kernel # this directory
Expand All @@ -27,28 +29,54 @@ with the following sequence of actions:
2. Then, inside the container, run:
```sh
cd linux-$NEW_VERSION
cp /host/linux-config-6.1.92 .config # Copy current config in
cp /host/linux-config-amd64-6.6.63 .config # Copy current config in
make 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-amd64-$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-amd64-6.6.63 linux-config-amd64-$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-amd64-6.6.63
```

Afterwards, it's probably also good to do a search-and-replace repo-wide to update all places that
mention the old kernel version.

### On arm64 (aarch64 ARM)

Note: you need to run this on ARM64 machine. It worked on my MacBook M2, but didn't on x64.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird... @mikhail-sakhnov any ideas what's needed to avoid this?

(broader context: I think it's risky to have kernel upgrade steps that depend on dev access to particular hardware, because it makes updating quite complex).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sharnoff I answered in the pr #1172, should be doable cross platform


1. On the host, run:
```sh
cd neonvm-kernel # this directory
docker build --build-arg KERNEL_VERSION=$NEW_VERSION --platform linux/arm64 --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-aarch64-6.6.63 .config # Copy current config in
make menuconfig
# do nothing; just save and exit, overwriting .config
cp .config /host/linux-config-aarch64-$NEW_VERSION # NOTE: Different from existing!
```
3. Back on the host, finish with:
```sh
# compare the two versions
diff linux-config-aarch64-6.6.63 linux-config-aarch64-$NEW_VERSION
# If all looks good, delete the old version. This is required so auto-selection works.
rm linux-config-aarch64-6.6.63
```

## Adjusting the config

To adjust the kernel config, try the following from this directory:

```sh
docker build --build-arg KERNEL_VERSION=6.1.92 --platform linux/x86_64 --target build-deps -t kernel-build-deps -f Dockerfile.kernel-builder .
docker build --build-arg KERNEL_VERSION=6.6.63 --platform linux/x64_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
# inside that bash shell, do the menuconfig, then copy-out the config to /host
```
Loading
Loading