Friday, December 28, 2012

Upgrading FreeBSD 8.2 to STABLE

After for a long time not posting blogspot. In my spare time making documentation for upgrading FreeBSD release to stable. This is old topic and so many documentation around but it's still important who is consider for upgrading FreeBSD to Stable one.

So whats the different between Current and Stable? Well, I think you should read this link :)

http://www.freebsd.org/doc/en/books/handbook/current-stable.html

This is my email server.

mail# uname -a
FreeBSD mail.myserver.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Tue Dec 25 00:22:30 WIT 2012     root@mail.myserver.com:/usr/obj/usr/src/sys/PAE-PF-ALTQ  i386
mail#

As we can see, is using FreeBSD 8.2-RELEASE, and I need to upgrade to STABLE one.

First, install cvsup using ports.
/usr/ports/net/cvsup
mail#make install clean
 ....
cp `cat ../M3TARGET`/cvpasswd.1 /usr/local/man/man1/cvpasswd.1
chmod 644 /usr/local/man/man1/cvpasswd.1
===>   Compressing manual pages for cvsup-without-gui-16.1h_4
===>   Registering installation for cvsup-without-gui-16.1h_4
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/sbin/cvsupd
/usr/local/bin/cvsup
/usr/local/bin/cvpasswd

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.cvsup.org/
mail#

After everything is OK, copy the default configuration of stable supfile in :
mail# cp /usr/share/examples/cvsup/stable-supfile /root/

Edit stable-supfile.

Here is for example :

*default host=CHANGE.TO.NEAREST.SERVER
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_8
*default delete use-rel-suffix

# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line.  (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress

## Main Source Tree.
#
# The easiest way to get the main source tree is to use the "src-all"
# mega-collection.  It includes all of the individual "src-*" collections.
# Please note:  If you want to track -STABLE, leave this uncommented.
src-all

mail# cvsup -g -L 2 stable-supfile &
Checkout src/usr.sbin/zzz/Makefile
Checkout src/usr.sbin/zzz/zzz.8
Checkout src/usr.sbin/zzz/zzz.sh
Shutting down connection to server
Finished successfully

[1]    Done                          cvsup -g -L 2 stable-supfile

Remove OLD obj in directory /usr/obj if needed.

Now is time to buildworld, because I custimize my kernel options, so I have to build kernel too.
You can skip this, if using default kernel options.

mail#cd /usr/src
mail# make buildworld
mail# make buildkernel KERNCONF=MYKERNEL

After for awhile, compile kernel is complete

text    data     bss     dec     hex filename
8465186  752516  608536 9826238  95efbe kernel.debug
objcopy --only-keep-debug kernel.debug kernel.symbols
objcopy --strip-debug --add-gnu-debuglink=kernel.symbols kernel.debug kernel
--------------------------------------------------------------
>>> Kernel build for MYKERNEL completed on Fri Dec 28 06:49:32 WIT 2012
--------------------------------------------------------------

mail# make installkernel KERNCONF=MYKERNELmail# make installworld
mail# reboot

Check server using this command below.

mail# uname -a
FreeBSD mail.myserver.com 8.3-STABLE FreeBSD 8.3-STABLE #0: Fri Dec 28 06:49:27 WIT 2012     root@mail.myserver.com:/usr/obj/usr/src/sys/PAE-PF-ALTQ  i386
mail#

Done.


No comments:

Post a Comment