Build Custom Kernel

From wiki
Revision as of 12:39, 12 January 2020 by imported>Jacob
Jump to navigation Jump to search

Previous post install actions Return ssh configuration


Build Custom kernel with ALTQ for firewalls

First ensure the custom kernel configuration files are downloaded in the ~/conf/kernels directory. We use the methode of having a source file with the specifics only, which includes the GENERIC file. In the firewall case we used GENERIC_STRIPPED which is the GENERIC file with unused options and hardware commented out to reduce Kernel compilation time. Then make a folder in the boot directory where we will store the configuration files for the host specific kernel.

>$ cd ~/conf/kernels
>$ su
># mkdir /boot/kernels
># cp FIRE_V040 /boot/kernels/
># cp GENERIC_STRIPPED /boot/kernels/

Make a copy of the current generic kernel, if this is the first build. This will allow to boot in the generic kernel if the custom kernel doesn't boot. The install will make a kernel.old but that is overwritten with each install

># cp -pr /boot/kernel /boot/kernel.generic

Make now links from the kernel source directory to the kernel configuration files in the /boot/kernels directory.

># cd /usr/src/sys/amd64/conf
># ln -s /boot/kernels/GENERIC_STRIPPED ./GENERIC_STRIPPED
># ln -s /boot/kernels/FIRE_V040 ./FIRE_V040

Go to the root of the src directory and switch to screen so you can detach it to let it run from a ssh session.

># cd /usr/src/
># screen

Start the build in screen with

># make buildkernel KERNCONF=FIRE_V040

Detach from the screen when the build process runs, with

[ctrl]A d

Previous post install actions Return ssh configuration

Up Freebsd Knowledge Base