Created May 30 2005 Modified Jan 4 2006

The FreeBSD build/install kernel/world Page



Doing a FreeBSD build/install kernel and world is so cool
I made this page as a place to hang my notes
Perhaps it will help you
It assumes you done the following:
Installed cvsup
Installed portupgrade
Created a kernel config file

BTW I timed portions of this process (FreeBSD 4.11) on two machines for a speed reference


Hardware
Time in Minutes
buildworld
buildkernel
installkernel
installworld
Dell Optiplex P3 700, 384 MB RAM, 5400 RPM 20 GB HD 115m
23m
14m
Asus A7V-333 AMD Athlon running at 1.5 GHz, 256 MB DDR, 7200 RPM 80 GB HD 52m
11m
14m



Build world - Build/install Kernel

I made a script called update-build that
Copies over my make.conf
Does some housework
Makes a backup of /etc
Builds world
Makes a kernel based on my custom kernel config
Install's this kernel

Here's my update-build script
It assumes you decompress it under /root
----------------------------------------------------
# Make World
cp /root/update/build/make.conf /etc/make.conf
cd /usr/obj
chflags -R noschg *
rm -rf *
cp -Rp /etc /etc.old
cd /usr/src
make -j4 buildworld
echo Build World Complete

# Make/Install Kernel
cd /usr/src
make buildkernel KERNCONF=FREEBSD411ROCKS
make installkernel KERNCONF=FREEBSD411ROCKS
echo ""
echo Make/Install Kernel Complete
echo Please reboot to test the kernel
-----------------------------------------------------

Here's my make.conf
-----------------------
CFLAGS = -O -pipe
NOPROFILE =  TRUE
-----------------------

Important note on NOPROFILE
"A typical user will probably want to copy the CFLAGS and NO_PROFILE (or NOPROFILE on FreeBSD 5.X and older) lines found in /usr/share/examples/etc/make.conf (or in /etc/defaults/make.conf on FreeBSD 4.X) to /etc/make.conf and uncomment them."


I then boot into single user mode (boot -s) and mount all the filesystems (mount -a)
Finally I run this script called update-install that
Does a mergemaster (pre-build world)
Installs world
Does Mergemaster
Does more housework
Cleans up with portsclean

Here's my update-install script
It assumes you decompress it under /root
--------------------------------------------------
# Mergemaster
mergemaster -p

# Install World
cd /usr/src
make installworld
cd /usr/src/release/sysinstall
make all install
echo Install World Complete

# Mergemaster
mergemaster

# Clean up
cd /usr/obj
rm -rf *
portsclean  -CDLP
echo Build/Install World complete, please reboot
---------------------------------------------------

Reboot and enjoy your very fresh FreeBSD install !!