Update FreeBSD
Updated: 08/12/2005
General Information
This guide will walk a user through updating his source to follow FreeBSD's stable branch. Please make a full backup of the current system before following this guide.Requirements
Installation
Login as root (or login as a user and su to root). Install cvsup and fastest_cvsup with either of the following methods.|
# # # # |
cd /usr/ports/net/cvsup_without_gui make install distclean cd /usr/ports/sysutils/fastest_cvsup make install distclean |
|
# # |
pkg_add -r cvsup-without-gui pkg_add -r fastest_cvsup |
| # | cp /usr/share/examples/cvsup/stable-supfile /root |
| # | cvsup -L 2 -h `(fastest_cvsup -q -c us )` /root/stable-supfile |
/usr/src directory| # | cd /usr/src |
/usr/src/UPDATING. This file will contain information that may be needed to properly update the FreeBSD source.| # | make -j4 buildworld |
Note: The -j4 switch is used to spawn multiple processes and according the FreeBSD Handbook, testing shows that this speeds up building world even on a single CPU system.
GENERIC kernel, simply run the following command:[/code]| # | make buildkernel |
| # | make buildkernel KERNCONF=MYKERNEL |
Note: To create a custom configuration file, go to /usr/src/sys/i386/conf and make a copy of the GENERIC file; name it something like MYKERNEL. Editing the kernel configuration file is beyond the scope of this walk-through.
Note: Installing the kernel and world in single-user mode is not required. It is only the safest method. If you wish, you can do the entire process from multi-user mode.
| # | shutdown now |
|
# # # # |
fsck -p mount -u / mount -a -t ufs swapon -a |
/usr/src directory.| # | cd /usr/src |
GENERIC kernel, simply run the following command:
#
make installkernel
To install a newly built custom kernel, run the command as follows:
#
make installkernel KERNCONF=MYKERNEL
Reboot
#
reboot
On boot up, select option 4 to boot to single-user mode. Once in single-user mode, run the following commands to get access to the file system and the swap.
#
#
#
#
fsck -p
mount -u /
mount -a -t ufs
swapon -a
Change to the [code]/usr/src directory.| # | cd /usr/src |
mergemaster -p to compare only those files that are essential for the success of buildworld or installworld.| # | mergemaster -p |
/var/tmp/temproot. Now install the new world.| # | make installworld |
| # | mergemaster |
Note: Unfortunately the mergemaster is the most complex and the least amount of help is provided. Understanding how mergemaster works will help. It compares the configuration files in use on the current system with the new configuration files from the newly compiles source. It uses diff to display both files at the same time. Lines that are new and will be added if the new configuration file is installed have a plus (+) sign by them. Lines that will be removed from the configuration file if you install the new one have a minus (-) sign by them. One tip is that if the changes are only to comment lines (comment lines begin with a pound (#) sign) it is usually safe to install the new configuration file. Another tip is that if there is a minus (-) sign next to something that needs to be kept, do not install the new file but either leave the file to be dealt with manually or merge the two files.
Note: It is common to run mergemaster multiple times.
Reboot the system.| # | reboot |
Note: It is a good idea to update the ports tree after rebuilding from source. See the following guide for updating the ports tree.
http://www.bsdguides.org/guides/freebsd/misc/update_ports_tree.php
Author: Jared Barneck
rhyous at yahoo dot com