»   »   »

Rebuilding the FreeBSD Kernel

Prelude

After many security patches,the requirement is to rebuild your kernel. It's not as scary as it sounds. Below is the brief form of the information I gathered from here:

Before you start, first check if you have a /usr/src/sys directory on your system; if you don't, then the kernel source has not been installed. The easiest way to do this is by running sysinstall as root, and selecting: Configure, then Distributions, src, and finally sys.

One more thing; If you are using a different architecture (for example spark64) then you should replace the i386 below with your architecture:

Method

cd /usr/src/sys/i386/conf
mkdir /root/kernels
cp GENERIC /root/kernels/MYKERNEL   
ln -s /root/kernels/MYKERNEL
/usr/sbin/config MYKERNEL
cd ../compile/MYKERNEL
make depend
make
make install
    

Your new kernel will have now been copied to the /boot/kernel directory as /boot/kernel/kernel and the old kernel will have be moved to /boot/kernel.old/kernel.

Now you'll need to reboot the system: shutdown -r now to use your new kernel. If something goes wrong, refer to the links at the bottom of this page.

© Roqet :: 2022-03-01 16:07:34