重新編譯 FreeBSD Kernel
date
May 7, 2018
slug
rebuild-freebsd-kernel
status
Published
tags
NCTU
SA
summary
type
Post
重新編譯 kernel 有ㄧ定程度的風險,建議先備份後再進行以下操作
All steps
Details
Get source code
- check version
- using
svn
Customize kernel
cd /usr/src/sys/<architecture>/conf
digitalocean <FreeBSD> use AMD64 cd /usr/src/sys/amd64/conf
GENERIC KERNEL CONFIG https://gist.github.com/maxam2017/50b1e6813f477aa411d053dee8a773b0
check current kernel config
sysctl kern.conftxt
using include
vim MYKERNEL
Build kernel
cd /usr/src
這步驟可以跳過 sudo make kernel-toolchain get all tool needed when compiling
sudo make buildkernel KERNCONF=<kernel_config>
https://wiki.freebsd.org/EmbeddedHandbook
Install kernel
cd /usr/src
sudo make installkernel KERNCONF=<kernel_config>
Reboot
sudo shutdown -r now