|
DiscussionAfter a fresh FreeBSD install, you'll want to connect to the official FreeBSD servers and download the latest code. The latest code will need to be compiled and installed. The steps are fairly easy but it will take time to compile everything. Downloading the latest code to keep your system up to date is recommended continuously throughout the life of the box. Since you should be doing it periodically anyway, best to do the first update after a fresh install when you don't have much to lose.CVSUPThe first goal is to install CVSUP. This is what you'll use to download the newest code from the FreeBSD CVS servers. Install CVSUP from packages like so: > pkg_add -r cvsup-without-guiNext you need to work on the CVSUP config file. The easiest way is to copy the example ones. First make a directory in /etc to store the configs in: > mkdir /etc/cvsupNext copy the example ports supfile to the config directory: > cp /usr/share/examples/cvsup/ports-supfile /etc/cvsupThere will be different example config files depending on whether you are running a stable version of FreeBSD or a development release. For the stable version: > cp /usr/share/examples/cvsup/stable-supfile /etc/cvsupFor the development version: > cp /usr/share/examples/cvsup/standard-supfile /etc/cvsupNow you need to edit or create an /etc/make.conf file to use these new CVSUP settings. With a text editor, create or open /etc/make.conf and add the following lines: > vi /etc/make.conf SUP_UPDATE=yes SUP=/usr/local/bin/cvsup SUPFLAGS=-g -L 1 SUPHOST=cvsup3.FreeBSD.org SUPFILE=/etc/cvsup/stable-supfile PORTSSUPFILE=/etc/cvsup/ports-supfilecvsup3.freebsd.org happens to be the closest FreeBSD CVS server to me. The SUPFILE entry would say standard-supfile instead of stable-supfile if you chose a development version of FreeBSD. This set of commands is available in the following /bin/sh script setup_sup.sh or setup_sup.txt. BUILD WORLDNow you can update your source tree. > cd /usr/src > make updateAlternatively, if you just want to update your ports collection rather than the entire source tree, change directory to /usr/ports. If you choose to just update the port collection, skip over the next section on make buildworld and pick up at installing portupgrade. > make buildworldWhen this is done, its time to recompile the kernel. A good practice I picked up on is to store your kernel config in root's home directory. > mkdir /root/kernels > cp /usr/src/sys/i386/conf/GENERIC /root/kernels/YOUR_KERNEL_NAME > ln -s /root/kernels/YOUR_KERNEL_NAME /usr/src/sys/i386/confYour kernel config is now stored in /root/kernels/ and for the kernel compiling process to work right a symlink to your kernel config is placed in /usr/src/sys/i386/conf/. Now edit the kernel config (/root/kernels/YOUR_KERNEL_NAME) with your favorite text editor and strip out any crap that doesn't pertain to your system. Be careful not to take something out that is essential for the system to work. Check out the FreeBSD Handbook and Google for hints on what's what. Now keep in mind, wherever I've mentioned i386 should be replaced if you're running a special system architecture like Alpha. When you're done messing with the kernel config compile it and if all goes well install it: > mergemaster -p > make buildkernel KERNCONF=YOUR_KERNEL_NAME > make installkernel KERNCONF=YOUR_KERNEL_NAME > reboot > cd /usr/src > make installworld > mergemaster > rm -fr /usr/obj/* (trust me) > rebootThis last batch of steps is copied from the suggestions in /usr/src/Makefile's comments. The comments in that file are good, read them. The only thing I changed is the position of the "mergemaster -p". Also removing /usr/obj/* was added. Thanks to Dave Vastine for the advice. PORTUPGRADEWhether you did the make update on /usr/src or /usr/ports, the following steps should be done. You'll be installing a useful program called portupgrade to keep your ports up to date from now on. > cd /usr/ports/sysutils/portupgrade > make install > rehash > portupgrade portupgradeThanks Alex for suggesting the portupgrade of portupgrade before doing portsdb. You'll want to issue the following steps every time you update your ports Makefiles with make update, or after installing new ports. > portsdb -uU (patience, this one takes a while and may appear hung) > portversion -vL =Portversion will show you which ports need to be updated. > portupgrade -ra > portsclean -C > portsclean -DDNow the ports are up to date, your sources are up to date, and your kernel is fine tuned. Here is where you start locking down the box and installing the necessary applications. COMMENTS
I'd appreciate any comments on this paper. I'm sure there are errors, better ways to explain things, inconsistencies, whatever.
Please let me know how I can improve it.
|