02_build new word & kernel - normalform/freebsd_setup GitHub Wiki
get source code
$git clone -b releng/13.0 --depth 1 https://git.freebsd.org/src.git freebsdsrc
cleanup
#cd /usr/obj
#chflags -R noschg *
#rm -rf *
build the world (compiler and the others) (with 32 cores)
#cd /usr/src
#time -l make -j 32 buildworld
--------------------------------------------------------------
>>> World build completed on Wed Jun 2 21:56:15 PDT 2021
>>> World built in 684 seconds, ncpu: 32, make -j32
--------------------------------------------------------------
683.96 real 17918.15 user 752.25 sys
build a new kernel (with 32 cores)
#time -l make -j 32 buildkernel
--------------------------------------------------------------
>>> Kernel build for GENERIC completed on Wed Jun 2 21:59:10 PDT 2021
--------------------------------------------------------------
>>> Kernel(s) GENERIC built in 65 seconds, ncpu: 32, make -j32
--------------------------------------------------------------
65.28 real 1647.80 user 127.65 sys
install the new kernel
#make installkernel
enter the single-mode
#shutdown now
ONLY for ufs
#mount -u /
#mount -a -t ufs
#swapon -a
ONLY for zfs
#zfs set readonly=off zroot
#zfs mount -a
initial configuration file update for next installworld
#mergemaster -p
install the new world
#cd /usr/src
#make installworld
update other configuration files
#mergemaster -iF
delete any obsolete files
#make delete-old
reboot
#reboot
delete any obsolete libraries to avoid conflicts with newer ones.
#make delete-old-libs