Helio/handbook

From FBSD_tips

Jump to: navigation, search

ARTICLE STILL BEING WRITTEN, PRE-DRAFT

The FreeBSD system has evolved alot since the 2.0 days. However, alot of references and documents, as well as users, are ignorant of how the system as done so. For example, the FreeBSD handbook, while concise, ignores some key improvements.

Contents

[edit] First Boot

[edit] Updating your system

The first step taken on a fresh install is to update your FreeBSD version and apply all security updates and errata since your CDs were pressed. Note that the FTP servers aren't 'magically' updated with security updates, so that applies as well.

There are two different methods, with their own pros/cons. DO NOT JUST USE ONE BECAUSE OF HISTORICAL REASONS. They are there for a reason.

[edit] Binary Updates

Use If: you are running any -RELEASE branch in the 6 tree, and have no need to recompile your system (recompiling because you can is bad, during a compile the build system embeds certain specific things that cause the hashes for two identical binaries to be different. This is bad, as it causes unneeded deltas, and makes it more difficult to track bugs. If you'd like an explanation as to why reference http://bsdimp.blogspot.com)

The command is simple:

freebsd-update fetch install

or, as is the case right now:

freebsd-update -s update1.freebsd.org fetch install

A lot of users will insist on using csup/buildkernel/buildworld; This is incorrect, there are legitimate reasons why you do not want to always do this and it seems most freebsd developers have referenced this. The obsessive use of compiling from source among the userbase has lead to FreeBSD being stunted in certain areas.

As an aside, freebsd-update will also update your source code if you installed it from the FreeBSD cd, so, for most workloads, you won't ever need to run csup. Leave the cvsup servers alone for the users/developers who need them.

[edit] Updating from Source

Use If: you are running any -STABLE branch, a -RELEASE before 6.0, or HEAD, or have a legitimate need to rebuild your system.

First update your source using the built in csup tool, via this method:

csup -h cvsupXX.freebsd.org /usr/share/examples/cvsup/standard-supfile

where cvsupXX.freebsd.org is a mirror from this list: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS

Then cd /usr/src, read /usr/src/UPDATING before doing anything, then build the system via this method:

rm -r /usr/obj/*
make buildworld
make buildkernel

then install the kernel via this method:

make installkernel INSTKERNNAME="FreeBSD62pX"

where X is the revision of the kernel build you're on (first would be p1, second p2). In this way you will have a log of kernels that you've installed, in case at a later date a bug is discovered that requires you to go back more then 1 build.

Now, use the kernel on the next boot by adding kernel="FreeBSD62pX" to /boot/loader.conf.

[edit] If the reboot fails

Escape to the loader prompt in the boot menu, and type:

unload
load /boot/kernel/kernel
boot

This will unload the broken kernel, and use the kernel you installed off the CD, and then edit /boot/loader.conf to something workable.

[edit] If the reboot works

Run these two commands in single user mode:

mergemaster -p
cd /usr/src/
make installworld
mergemaster

Then reboot.

Personal tools