2020-04-28 17:29:52 +02:00
---
title: "Gentoo Kernel Upgrades"
2021-03-12 19:36:17 +01:00
description: Gentoo kernel upgrades on adyxax.org
2021-09-13 00:48:07 +02:00
tags:
- gentoo
- linux
2020-04-28 17:29:52 +02:00
---
2021-03-12 19:36:17 +01:00
## Introduction
Now that I am mostly running OpenBSD servers I just use genkernel to build my custom configuration on each node with :
2023-04-23 22:33:49 +02:00
```sh
2021-03-12 19:36:17 +01:00
eselect kernel list
eselect kernel set 1
genkernel all --kernel-config=/proc/config.gz --menuconfig
nvim --diff /proc/config.gz /usr/src/linux/.config
2023-04-23 22:33:49 +02:00
```
2021-03-12 19:36:17 +01:00
2021-04-26 23:50:31 +02:00
Bellow you will find how I did things previously when centralising the build of all kernels on a collab-jde machine, and distributing them all afterwards. Local nodes would only rebuild local modules and get on with their lives.
2020-04-28 17:29:52 +02:00
## Building on collab-jde
2023-04-23 22:33:49 +02:00
```sh
2020-04-28 17:29:52 +02:00
PREV_VERSION=4.14.78-gentoo
eselect kernel list
eselect kernel set 1
cd /usr/src/linux
for ARCHI in `ls /srv/gentoo-builder/kernels/` ; do
make mrproper
cp /srv/gentoo-builder/kernels/${ARCHI}/config-${PREV_VERSION} .config
echo "~~~~~~~~~~ $ARCHI ~~~~~~~~~~"
make oldconfig
make -j5
INSTALL_MOD_PATH=/srv/gentoo-builder/kernels/${ARCHI}/ make modules_install
INSTALL_PATH=/srv/gentoo-builder/kernels/${ARCHI}/ make install
done
2023-04-23 22:33:49 +02:00
```
2020-04-28 17:29:52 +02:00
## Deploying on each node :
2023-04-23 22:33:49 +02:00
```sh
2020-04-28 17:29:52 +02:00
export VERSION=5.4.28-gentoo-x86_64
wget http://packages.adyxax.org/kernels/x86_64/System.map-${VERSION} -O /boot/System.map-${VERSION}
wget http://packages.adyxax.org/kernels/x86_64/config-${VERSION} -O /boot/config-${VERSION}
wget http://packages.adyxax.org/kernels/x86_64/vmlinuz-${VERSION} -O /boot/vmlinuz-${VERSION}
rsync -a --delete collab-jde.nexen.net:/srv/gentoo-builder/kernels/x86_64/lib/modules/${VERSION} /lib/modules/
eselect kernel set 1
cd /usr/src/linux
cp /boot/config-${VERSION} .config
cp /boot/System.map-${VERSION} System.map
(cd usr ; make gen_init_cpio)
make modules_prepare
emerge @module -rebuild
2020-06-26 00:06:30 +02:00
genkernel --install initramfs --ssh-host-keys=create-from-host
2020-04-28 17:29:52 +02:00
grub-mkconfig -o /boot/grub/grub.cfg
2023-04-23 22:33:49 +02:00
```