PART I. Keeping the FreeBSD base system up-to-date

fastest_cvsup

Code: # [color="Blue"]pkg_add -r fastest_cvsup[/color] # [color="blue"]fastest_cvsup -c all[/color] (...) >> Speed Daemons: - 1st: cvsup.pl.freebsd.org - 2nd: cvsup11.ua.freebsd.org - 3rd: cvsup5.de.freebsd.org

csup

/usr/share/examples/cvsup/

Code: # [color="blue"]cat > /root/stable-supfile << EOF *default host=[b]cvsup.pl.freebsd.org[/b] *default base=/var/db *default prefix=/usr *default release=cvs tag=RELENG_8 *default delete use-rel-suffix *default compress src-all EOF[/color]

Code: # [color="blue"]csup /root/stable-supfile[/color] Connected to 188.125.237.138 Updating collection src-all/cvs Edit src/bin/ed/buf.c Edit src/sbin/fsck_ffs/main.c Edit src/sbin/mdconfig/mdconfig.8 Edit src/sbin/mdconfig/mdconfig.c Edit src/share/man/man4/ath.4 Edit src/share/man/man4/ath_hal.4 Edit src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Edit src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Edit src/sys/dev/ahci/ahci.c Edit src/sys/fs/msdosfs/msdosfs_vnops.c Edit src/sys/fs/nfsclient/nfs_clbio.c Edit src/sys/fs/nfsserver/nfs_nfsdserv.c Edit src/sys/fs/nwfs/nwfs_io.c Edit src/sys/fs/smbfs/smbfs_io.c Edit src/sys/fs/tmpfs/tmpfs_vnops.c Edit src/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Edit src/sys/kern/uipc_usrreq.c Edit src/sys/kern/vfs_vnops.c Edit src/sys/nfsclient/nfs_bio.c Edit src/sys/sparc64/sbus/sbus.c Edit src/sys/sys/vnode.h Edit src/sys/ufs/ffs/ffs_inode.c Edit src/sys/ufs/ffs/ffs_vnops.c Finished successfully

devel/subversion16

csup

subversion

csup

Code: # [color="blue"]svn checkout svn://svn.freebsd.org/base/stable/9 /usr/src[/color]

svn

/usr/src

GENERIC

nice -n 20

make buildworld ...

Code: # [color="blue"]cd /usr/src[/color] # [color="blue"]rm -r -f /usr/obj[/color] # [color="blue"]make buildworld kernel KODIR=/boot/testing[/color] # [color="blue"]nextboot -k testing[/color] # [color="blue"]shutdown -r now[/color]

GENERIC

Code: # [color="blue"]cd /boot[/color] # [color="blue"]rm -r -f OLD[/color] # [color="blue"]mv kernel OLD[/color] # [color="blue"]mv testing kernel[/color]

Code: # [color="Blue"]killall dhclient moused[/color] # [color="blue"]/etc/rc.d/cron stop[/color] # [color="blue"]/etc/rc.d/devd stop[/color] # [color="blue"]/etc/rc.d/sshd stop[/color] # [color="blue"]/etc/rc.d/powerd stop[/color] # [color="blue"]/etc/rc.d/syslogd stop[/color]

sshd

Code: # [color="blue"]top -b[/color] last pid: 64835; load averages: 0.00, 0.00, 0.00 up 0+03:11:51 10:24:37 119 processes: 2 running, 117 sleeping Mem: 960M Active, 355M Inact, 4014M Wired, 6096K Cache, 8368K Buf, 2527M Free Swap: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 2178 root 1 54 0 10304K 2748K ppwait 0 0:00 0.00% csh 2174 root 1 45 0 21696K 1992K wait 0 0:00 0.00% login 2177 root 1 76 0 6912K 1284K ttyin 0 0:00 0.00% getty 2176 root 1 76 0 6912K 1284K ttyin 1 0:00 0.00% getty 2175 root 1 76 0 6912K 1284K ttyin 0 0:00 0.00% getty 114 root 1 76 0 2764K 1056K pause 0 0:00 0.00% adjkerntz

mergemaster

Code: # [color="blue"]cd /usr/src[/color] # [color="blue"]mergemaster -p[/color] # [color="blue"]make installworld[/color] # [color="blue"]mergemaster -iU[/color] # [color="blue"]make delete-old[/color] # [color="blue"]shutdown -r now[/color]

PACKAGESITE

-- once RELEASE is completed, there are only security fixes, there are no bug fixes-- bugs in STABLE tree are fixed-- security issues are also fixed in STABLE-- the RELEASE branch allows to use binary updates via freebsd-update tool for security fixes-- the STABLE branch requires compiling of the FreeBSD base systemWe need to clone the current cource tree if we want to build up to date STABLE branch FreeBSD's base system, we will also need to update our sources to the current state so its quite handy to find fastest server for Your location, it can be easily done by usingpackage.For my location it iswhich in most cases will be different ther for Your location, so remember to put Your's fastest in the next steps.Create simplethat will be used byto keep FreeBSD's base system sources up-to-date. There are useful examples underif you want to 'dig more'.Now lets get/update our sources to the current state, the list of edited/checked files will be quite different on Your box since I already have quite up-to-date sources, this will take more time if You do not have the sources on the disk.Alternatively, You can grab the sources by SVN protocol, but You will needport/package for that purpose. Its generally a lot faster/easier to 'setup' thenbut thehas one important advantage, its in the FreeBSD's base system, so its always available, anywhere. With SVN, You will have to add a package first which sometimes may be cumbersome. But as the FreeBSD source tree is kept under SVN it is possible that SVN will be part of the FreeBSD's base system one day.Its also important to mention, that sources downloaded byare not compatible with the sources grabbed by, so once You will decide which method to use, stick with it, unless You want to download the whole FreeBSD's source tree again. Below is the line needed to update the FreeBSD sources to 9-STABLE latest state.Its the same no matter if You download the whole tree or just doing an update from yesterday. Ifwill complain about anything, just delete theand type the command again.Now as we have the sources we can continue to building the FreeBSD's base system from source. As for editing the kernel config, You do not even have to bother about it, just use, this guide is not about stripping the base system and kernel components, its about keeping everything up-to-date. Of course if You want to, then use Your tweaked kernel config, it will not interfere with the rest of this guide. You may want to putin front ofline to make that build process less 'amusing' for your system. As instructions are completed, Your system will reboot.We are now proceeding to the second phase of the upgrade process, after normal boot (single user mode not required and definitely prohibited while doing upgrade over the network) stop all unneeded services (remember to keep sshd daemon alive if you are doing upgrade via network). If your system booted up properly, then You can make the new testing kernel the default one, at least there should not be any problems with thekernel configThe list of started processes will look something like that including (or not)for keeping up the network connection.Now we can continue to type rest of needed instructions to finish the update, thewill ask You for the differences in startup scripts that You have modified and configuration files, type 'I' to install the new/default config and/or script and select 'D' to leave the version that you have in the system, remember that You can also add these changes later, it may be not appreciate to install default firewall config or customized OpenSSH config while doing the network upgrade.After that second reboot You should have updates to STABLE branch FreeBSD's base system, I wrote 'should' because sometimes things do not go the way we want them to go, especially if you are doing it the first time as oncesing. It would be best to do these instructions as exercise under virtual machine like VirtualBox or QEMU.Also, if you do not feel that STABLE is 'production enought', then You may want to use STABLE packages along with RELEASE base system, You will need to define environment variablethat will point to ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/ at least for FreeBSD 8.x system.