FreeBSD kernel compile

Delete and re-download the kernel source

  • Delete own kernel source
    rm -rf /usr/src
  • Download the kernel source
    axel -avn3 http://mirrors.ustc.edu.cn/freebsd/releases/amd64/12.1-RELEASE/src.txz

  • Extract the kernel source
    tar xvzfp src.txz -C /

Modify kernel parameters

  • Enter the corresponding kernel directory, the virtual machine is AMD64
    cd /usr/local/amd64/conf
  • Modify kernel parameters, using the mode profile is introduced:
  • cp GENERIC code
    • vi code#加入include  code_kern
    • vi code_kern # add the following
    • options IPFIREWALL
      options IPFIREWALL_VERBOSE
      options IPFIREWALL_VERBOSE_LIMIT=3
      options IPFIREWALL_DEFAULT_TO_ACCEPT
      options IPFIREWALL_NAT
      options DUMMYNET
      options LIBALIAS
      options HZ=1000
      options NULLFS
      options VIMAGE

  • config code

Recompile the kernel

      • Directory compiled into the kernel 
        cd /usr/local/amd64/compile/code
      • Cleanup dependencies
        make cleandepend
      • Re-build dependencies
        make depend
      • Compile
        make
      • installation
        make install
      • Restart the serverreboot
      • Using the following a command cd ../compile/code;make cleandepend; make depend; make; make install; reboot

Guess you like

Origin www.cnblogs.com/defifind/p/12372205.html