Skip to content
ThinStation edited this page Jun 22, 2020 · 11 revisions

While I do endeavor to make a kernel that works pretty much anywhere, sometimes people need something special, so here is how to make a custom kernel.

Make sure you are in the chroot.

cd /ts/ports/kernel-modules/kernel-TS

This will download the kernel source, unpack it and place it in
/ts/ports/kernel-modules/kernel-TS/work/src/linux-<version>

pkgmk -d -f -eo

Now we can

cd work/src/linux-<version>

This will copy the current kernel configuration into the place that the kernel source expects.

cp ../ts.config .config

You can now make any changes that you want to the kernel configuration using the kernel menu configuration system.

make menuconfig

Save your changes when you are done, and exit the utility.

We now need to copy the new config to somewhere the port system will understand, so

cp .config ../../../ts.config

Now go back to /ts/ports/kernel-modules/kernel-TS

cd /ts/ports/kernel-modules/kernel-TS

We need to update the md5sum for the new ts.config, so

pkgmk -um

You can now run

rebuild-kernels

That's it. The following commands will take you through a more manual process for the rest of the building process. To actually build the kernel with the new configuration, we run

pkgmk -u

It is very likely that this operation will produce a footprint mismatch, so after the build completes, you will likely have to run

pkgmk -uf

Finally, we install the custom kernel with

pkgmk -u