Skip to content

Commit

Permalink
neonvm-kernel: Fix upgrade instruction (#1172)
Browse files Browse the repository at this point in the history
Fix the instruction for kernel upgrades, add separate commands for arm64
and amd64 config upgrades.

Rerun the commands with current version. It has produced some diff, most
likely due to ubuntu upgrade in
#1159.

Split off from #1170
  • Loading branch information
petuhovskiy authored Dec 9, 2024
1 parent 623066b commit c386f31
Show file tree
Hide file tree
Showing 4 changed files with 992 additions and 965 deletions.
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: 32 additions & 6 deletions neonvm-kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,52 @@ 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
docker build --build-arg KERNEL_VERSION=$NEW_VERSION --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-amd64-6.1.92 .config # Copy current config in
make menuconfig ARCH=x86_64
# do nothing; just save and exit, overwriting .config
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-amd64-6.1.92 linux-config-amd64-$NEW_VERSION
# If all looks good, delete the old version. This is required so auto-selection works.
rm linux-config-amd64-6.1.92
```

### On arm64 (aarch64 ARM)

1. On the host, run:
```sh
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_VERSION=$NEW_VERSION --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-aarch64-6.1.92 .config # Copy current config in
make menuconfig ARCH=arm64
# do nothing; just save and exit, overwriting .config
cp .config /host/linux-config-$NEW_VERSION # NOTE: Different from existing!
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-6.1.92 linux-config-$NEW_VERSION
diff linux-config-aarch64-6.1.92 linux-config-aarch64-$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-aarch64-6.1.92
```

Afterwards, it's probably also good to do a search-and-replace repo-wide to update all places that
Expand Down
Loading

0 comments on commit c386f31

Please sign in to comment.