FreeBSD 5.x on ThinkPad R40e: Installation Notes
Notes from installing and running FreeBSD on my laptop -- IBM ThinkPad R40e. I installed 5.3-RELEASE and then cvsup/buildworld-ed to 5.4-STABLE.
Installation
» Network card did not work for me during installation
» Escape to boot loader prompt (press key '6') and enter these commands:
set hw.ata.ata_dma="0"
set hw.ata.atapi_dma="0"
set hint.acpi.0.disabled="1"
boot
Without the first two, the CD-ROM keeps whirring without any progress. Without the second, the system hangs during startup.
Note: after installation, copy the lines above to /boot/loader.conf.local without the 'set' keyword. The 'boot', of course, is not needed.
» Install only distributions you need (I don't need Kerberos, for example)
» Install ports
Custom Kernel
I compiled a custom kernel right after installation. See handbook on how to compile FreeBSD kernel.
Specifically, my kernel has support for Broadcom Ethernet cards and USB mass-storage devices (flash drives). I have taken away support for IPv6, SCSI, and unnecessary device drivers.
X
Kernel security level can prevent X from starting. To disable it, add this line to /etc/rc.conf:
kern_securelevel_enable="NO"
Use xorgconfig to configure X. The video card driver is ati.
I had already got TrueType fonts to work in Linux, so I just copied TrueType/ directory from Linux to /usr/X11R6/lib/X11/fonts/ under FreeBSD. I also added corresponding FontPath line in /etc/X11/xorg.conf.
Update 2/Nov/05: I found webFonts.sh for Linux.
Sound
Add these lines in /boot/loader.conf.local:
sound_load="YES"
snd_t4dwave_load="YES"
Reboot and try playing an audio file. If you cannot hear any sound, try pressing the 'Increase Volume' button on the ThinkPad keyboard.
The default permissions are not enough to play audio CDs as ordinary user. Edit /etc/devfs.conf so that /dev/acd0 has permissions 0660. Add yourself to operator group in /etc/group.
Essential Software
Software like evolution, gaim, gimp, abiword, xmms, mplayer etc. are all present in the ports collection. Go to /usr/ports directory and do:
make search name=<packagename>
to get a particular port's directory in the hierarchy.
Afterwards, installing a port is as simple as going to the port directory and saying:
make
make install
The former fetches the source from its Web site and compiles it, doing the same for dependencies if any. The latter installs the port (along with dependencies, if any).
A port is removed through
make deinstall
in the same directory.
Alternatively, you can install software package from the CD-ROM (if available) through /stand/sysinstall utility.
Flash Plugin, Java and Java Plugin
For Macromedia Flash, see instructions for Konqueror, which work equally well on Mozilla.
After several false starts, FreeBSD-native JDK 1.4 worked for me. (/usr/ports/java/jdk14) It needs a mounted linprocfs filesystem, JDK sources, Linux JDK (for bootstrapping), and about 1.5GB of disk space. Well, if you really need it, you have it ...
Accessing Windows Partitions
Add lines like these to /etc/fstab:
/dev/ad0s5 /mnt/wind msdos rw,-u=<your_uid>,-g=<your_gid> 0 0
Accessing Flash Drives
Add a line like this to /etc/fstab:
/dev/da0s1 /mnt/usb msdos noauto,rw,-u=<your_uid>,-g=<your_gid> 0 0
Plug in the USB drive, wait for some time, and then mount it to access contents:
mount /mnt/usb
The same applies to accessing photos in a digital camera.
Printing
FreeBSD comes with the BSD lpr set of utilities. I use CUPS, instead: /usr/ports/print/cups-base and cups-lpr.
After installing, CUPS can be configured through your browser at http://localhost:631/. Rename /usr/bin/lp* to something else, so that they do not shadow the lp* in /usr/local/bin/.
To start CUPS daemon automatically upon system boot, rename cups.sh.sample to cups.sh in /usr/local/etc/ directory.
ACPI
ACPI causes the system to freeze during start-up in FreeBSD 5.3-RELEASE. In 5.4-STABLE, it is partially functional:
» suspend (sleep) works, but there is no way to 'wake up'
» battery status (AC/battery, battery-time remaining) works
» frequency scaling works, e.g. on my 2GHz processor, I can say sysctl dev.cpu.0.freq=1500
Wireless LAN
My D-Link DWL-G650+ card did not work, both with ath and ndis modules, on 5.3-RELEASE as well as 5.4-STABLE. The latter scheme is as follows:
cd /sys/modules/if_ndis
cp /windriverdir/sysfile.sys .; cp /windriverdir/inffile.inf .
ndiscvt -i inffile.inf -s sysfile.sys -o ndis_driver_data.h
make; make install
kldload ndis; kldload if_ndis
Misc Notes
» to disable sendmail, add this in /etc/rc.conf:
sendmail_enable="NONE"
» Exchange Connector does not work with Evolution 1.4. I cvsup-ped to 2.2 and then it was fine (see below).
» ssh -X can cause X protocol errors. To fix, add this to /etc/ssh/ssh_config:
ForwardX11Trusted yes
» By default, only root is allowed to mount filesystems. To overcome this problem, add this to /etc/sysctl.conf:
vfs.usermount=1
Syncing Ports
Use cvsup to synchronise /usr/ports to the latest versions/locations. It does not download any package -- instead, it just updates the Makefiles.
The command sequence is:
cp /usr/share/examples/cvsup/ports-supfile /root
(edit server address in this file)
cvsup -g -L 2 /root/ports-supfile
portsdb -Uu # update database
portversion -l "<" # show out-of-date packages
portupgrade -arR # download, compile, install all
More info on:
» cvsup/portupgrade
» dependency conflicts and resolution
I used this method to upgrade from GNOME 2.6 (5.3 default) to 2.10 (current).
In case you wish to download pre-compiled (binary) packages of ports instead of compiling their sources on your system, use -PP with portupgrade. You will probably also need to set PACKAGESITE variable:
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/
Syncing Base System
Use cvsup, this time with respect to /usr/src/. See the chapter 'The Cutting Edge' in the handbook. I followed the instructions to upgrade from 5.3-RELEASE to 5.4-STABLE.
I removed some components through make.conf (such as bluetooth, ipv6, etc.), so I wanted to make sure files related to them are gone. So, before doing the actual installworld, I did:
make installworld DESTDIR=/tmp/testinst
and then a directory diff on /bin, /etc, /lib, /sbin, /usr/bin, /usr/lib, /usr/sbin, /usr/share/info, /usr/share/man with their counterparts under /tmp/testinst. I removed files that were present currently that were not part of the new base system.
Syncing Documentation
Use cvsup again, with /usr/share/examples/cvsup/doc-supfile. Change hostname and base directory in the supfile. See FreeBSD Documentation Project Primer on next steps.
Use make install command to update your /usr/share/doc/ hierarchy, once you are done compiling the sources to the formats you like.
Appendix A: Partition Scheme
I have the following scheme of partition:
/ 5.0 GB # currently 2.2G used
/usr/src 2.5 GB # not really part of /, so its own partition
/usr/ports 5.0 GB # sometimes a large build area is needed
swap 0.5 GB # same as RAM
Appendix B: PCI Device Listing
root@FreeBSD:~# pciconf -l -v
hostb0@pci0:0:0: class=0x060000 card=0x00000000 chip=0xcab21002 rev=0x02
hdr=0x00
vendor = 'ATI Technologies Inc'
device = 'RS200 CPU to PCI Bridge'
class = bridge
subclass = HOST-PCI
pcib1@pci0:1:0: class=0x060400 card=0x00000000 chip=0x70101002 rev=0x00 hdr=0x01
vendor = 'ATI Technologies Inc'
device = 'RS200 PCI to AGP Bridge'
class = bridge
subclass = PCI-PCI
ohci0@pci0:2:0: class=0x0c0310 card=0x05401014 chip=0x523710b9 rev=0x03 hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'M5237 OpenHCI 1.1 USB Controller'
class = serial bus
subclass = USB
none0@pci0:3:0: class=0x070300 card=0x05351014 chip=0x545710b9 rev=0x00 hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'ALI N5457, M1563M AC97 Modem controller'
class = simple comms
subclass = generic modem
pcm0@pci0:4:0: class=0x040100 card=0x053e1014 chip=0x545110b9 rev=0x02 hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'ALI M5451 PCI AC-Link Controller Audio Device'
class = multimedia
subclass = audio
none1@pci0:6:0: class=0x068000 card=0x053c1014 chip=0x710110b9 rev=0x00 hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'ALI M7101 Power Management Controller'
class = bridge
isab0@pci0:7:0: class=0x060100 card=0x053b1014 chip=0x153310b9 rev=0x00 hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'ALI M1533 Aladdin IV ISA Bridge'
class = bridge
subclass = PCI-ISA
bge0@pci0:11:0: class=0x020000 card=0x05451014 chip=0x170d14e4 rev=0x01 hdr=0x00
vendor = 'Broadcom Corporation'
device = 'BCM5901 NetXtreme Fast Ethernet'
class = network
subclass = ethernet
cbb0@pci0:12:0: class=0x060700 card=0x05281014 chip=0xac56104c rev=0x00 hdr=0x02
vendor = 'Texas Instruments (TI)'
device = 'PCI1510 PC Card CardBus Controller'
class = bridge
subclass = PCI-CardBus
atapci0@pci0:15:0: class=0x0101fa card=0x053d1014 chip=0x522910b9 rev=0xc4
hdr=0x00
vendor = 'Acer Labs Incorporated (ALi)'
device = 'M1543 Southbridge EIDE Controller'
class = mass storage
subclass = ATA
none2@pci1:5:0: class=0x030000 card=0x053a1014 chip=0x43371002 rev=0x00 hdr=0x00
vendor = 'ATI Technologies Inc'
device = 'RS200M Mobility M6 (U2)'
class = display
subclass = VGA
root@FreeBSD:~#
This file created: 16/Dec/2005