FreeBSD Part 1

To start this short series of articles, I'll give you some tips on what to expect if you decide to attempt this for yourself.

First, if you are trying to set up FreeBSD so you can put your old hardware to better use, this may not be the ultimate solution. It's just the solution I know best. My hardware (Dell Inspiron I1100) is slow. It's a Celeron 2.4GHz system, 640MB of memory, a 30GB disk, with an Intel 845 graphics chip that shares system memory. I already know it's going to take days to set up. Maybe a week. Like I said in my previous post, this is more of a hobby than attempting to be productive. As I get further into the install, I will attempt to discuss setting up a compiler slave to help speed this process up, but that's not for another article or two.

Also, if you're interested in what I'm writing about, but you have nice, new hardware, your system will take significantly less time to set up.

It Begins

The first thing to do is get a boot-able install image. I always grab the latest boot-only release CD image. This means a quicker download to get the CD, but a potentially longer download to get the system installed.

Next, I boot to the CD, and select a "Custom" install. Allocate the entire disk to FreeBSD, and select automatic partition sizes/labels. I choose "All" distribution sets, and say "Yes" to installing the ports collection. Select FTP "media," and suitable mirror. Commit! On a reasonable Internet connection, this might take an hour or two.

Once finished, configure some options to set the root password, time zone, and a wheel user for remote access. To make things easier (e.g. if I have to copy-paste from the web), I turn on sshd so I can do the rest of the installation from an existing desktop system.

Let the system reboot.

Once it's up, ssh into the system. Update the source code and ports.

Create a file at /var/db/sup/refuse and paste this in:
doc/bn_*
doc/da_*
doc/de_*
doc/el_*
doc/es_*
doc/fr_*
doc/hu_*
doc/it_*
doc/ja_*
doc/mn_*
doc/nl_*
doc/no_*
doc/pl_*
doc/pt_*
doc/ru_*
doc/sr_*
doc/tr_*
doc/zh_*


Create another file at /var/db/sup/releng with this:
*default host=cvsup4.us.freebsd.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_7_2
*default delete use-rel-suffix
*default compress
src-all
ports-all tag=.


#csup /var/db/sup/releng

This will take a little while. As of writing this (2009-10-02), this will get the 3rd patch for FreeBSD 7.2. Once that's finished, I'll customize the kernel. For this install, I comment out the debug symbols, most SCSI stuff, NICs I'll never use, and the firewire devices. If you've never customized a FreeBSD kernel before, there's great information in the handbook.

Once customized and recompiled, I reboot the system, and get ready for the fun.

First, a few basic things:

Create /boot/loader.conf like this:
autoboot_delay="2"
beastie_disable="YES"
snd_driver_load="YES"


In /boot/device.hints add a line:
hint.psm.0.flags="0x1000"
This allows the laptop's touch pad to work.

In /etc/X11/xorg.conf use this config (work in progress):
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/lib/X11/fonts/misc/"
FontPath "/usr/local/lib/X11/fonts/TTF/"
FontPath "/usr/local/lib/X11/fonts/OTF"
FontPath "/usr/local/lib/X11/fonts/Type1/"
FontPath "/usr/local/lib/X11/fonts/100dpi/"
FontPath "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
Load "extmod"
Load "record"
Load "dbe"
Load "glx"
Load "dri"
Load "dri2"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Dell 1024x768 Laptop Display Panel"
Option "DPMS"
HorizSync 31.5-48.5
VertRefresh 59.0-75.0
EndSection

Section "Device"
#Option "ShadowFB"
#Option "DefaultRefresh"
#Option "ModeSetClearScreen"
Identifier "Card0"
Driver "intel"
VendorName "Intel Corporation"
BoardName "82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1024x768"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768"
EndSubSection
EndSection


At that point, the basic parts of the system should be working. You should already be able to start up a generic X terminal (the mouse won't work yet without one more service), but you're ready to move on to the next step.