Kenyon Ralph

FreeBSD rebuild

Here is my condensed version of, or how to rebuild the FreeBSD world and kernel.

Once the devel/subversion port is installed, check out the source tree once:

cd /usr && sudo svn co svn:// src

Create a symlink to my custom kernel config, if necessary. For example:

ln -s ~/MYCONFIG /usr/src/sys/amd64/conf

Update if the tree has already been checked out:

cd /usr/src && sudo svn up

If devel/subversion is not available, update the source tree with csup:

sudo csup -L 2 stable-supfile

Read updating notes and build:

less /usr/src/UPDATING
cd /usr/obj && sudo chflags -vR noschg * && sudo rm -rvf *
cd /usr/src && sudo make cleandir; sudo make cleandir
sudo script /root/build-`date +%Y%m%dT%H%M%S`.log
make -j2 buildworld && make buildkernel
sudo make installkernel
sudo shutdown -r now
# boot into single-user mode with boot -s at the loader prompt.
adjkerntz -i
mount -a # for a ZFS system: zfs mount -v -a && mount -u -w /
mergemaster -p -F -U
cd /usr/src
make installworld
mergemaster -i -F -U
shutdown -r now
(cd /etc && sudo git status; cd /usr/local/etc && sudo git status; cd /boot && sudo git status)

Commit changes to git repositories as necessary.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. Revision History.