upgrading the FreeBSD kernel

I’ve decided to take on the task of learning to upgrade the FreeBSD kernel. Here are the steps that I took upgrading to the 6.2 release:

  1. Copy the standard-supfile to either your home directory or the /root directory.
    cp /usr/share/examples/cvsup/standard-supfile /root
  2. Edit the copied standard-supfile to reflect the following changes:
    • change the host to a mirror
    • make sure the release=csv tag=RELENG_6_2 where 6_2 is the version to upgrade to
  3. while in the directory where the copied standard-supfile is (in this case, /root):
    cvsup standard-supfile
    This syncs your /usr/src with the current version.
  4. cd /usr/src make buildworld This takes a little time.
  5. make buildkernel This makes the kernel
  6. make installkernel
  7. INSTEAD OF issuing the make buildkernel, make installkernel, you can issue a make kernel which handles both items for you.
  8. Once the kernel has been installed, reboot the system.
  9. If you are staying within a release (i.e., 6.2 prerelease to 6.2 stable) you can bypass this step… mergemaster -p
  10. su to root. cd /usr/src make installworld
  11. mergemaster
  12. reboot

Addition on July 30, 2008:

For a quicker mergemaster, you can do the following after make installworld

  • cd /etc/rc.d/
  • rm *
  • mergemaster -i

ADDITIONAL INFORMATION:

Sometimes it’s necessary to clean up after an old install (I recently got the following:
make: don't know how to make /usr/src/usr.bin/make/sprite.h. Stop
)

cd /usr/src
make cleandir
make cleandir

If that doesn’t work:

cd /usr/obj
chflags -R noschg *
rm rf *

Comments are closed.