How to configure FreeBSD on an Acer TravelMate 8371

In a previous post I've explained how to install FreeBSD 8.1-RELEASE on an Acer TravelMate 8371 and still be able to boot it. Now I'd like to share the details on the configuration which makes the OS usable in the first place. This is going to be pretty technical and a bit lengthy, and I'll make sure to include and explain all config files that I've created or edited. The reason why I'm elaborating on this stuff here is that The FreeBSD Laptop Compatibility List wouldn't let me create an entry.

I've got the following to work:

- graphics
- touchpad
- USB
- SD card reader
- ethernet
- wifi
- sound
- play DVDs and audio CDs from an external optical drive
- check battery status

Things that don't work as expected include:
- set the screen brightness via keys
- set the volume via keys
- use any of the acpi sleep modes

Things that I'd expect to work (according to dmesg) but can't test due to the lack of equipment or applications accessing the stuff:
- bluetooth
- webcam

At first, let's review the components of my box. The 8371 is sold in a couple of configurations, so please don't just blindly follow the instructions before making sure your box has the same bits and pieces inside as mine does. The full name of the laptop is Acer TravelMate TM8371-944G50n. According to a sticker on the palmrest (which I removed right after typing this), there is an Intel Core 2 Duo processor SU9400, an Intel GMA4500MHD graphics chip, 4GB of memory, a 500GB HDD, an Acer Nplify 802.11a/b/g/n WLAN chip, and Bluetooth 2.1+EDR, whatever that is. We'll see shortly that the WLAN is nothing to be afraid of, as pciconf knows it better than the sticker.

First one hint about the installation procedure which I forgot to mention last time. The current version (8.1-RELEASE) creates too small a / partition if you use the auto-layout feature of the partition editor. Make sure to have at least 1GB here, as you'll run out disk space with the default (500MB) as soon as you build a custom kernel - and you will have to. I've filed a bug report, but apparently this problem has already been fixed for the next release.

The first file to edit is /boot/loader.conf. This is the place to stick in things that should be loaded or set right at boot time.

--8<---
verbose_loading="YES" # print verbose loader output during boot
wlan_scan_ap_load="YES" # load wlan stuff
wlan_scan_sta_load="YES" # load wlan stuff
coretemp_load="YES" # intel temp sensor support
hw.psm.synaptics_support="1" # improved touchpad support
--8<---

Next is /etc/rc.conf, the system configuration file. This file contains two configurations for Ethernet (which I use most of the time) and WLAN (which I enable whenever I need it).

moused must be told which mouse to use. I set it to an external USB mouse as I was not able to use the touchpad under X if moused grabs it as a sysmouse here. Downside is that I don't have a console mouse if there is no USB mouse attached, but this not a high price to pay.

powerd is told to use hiadaptive mode when plugged in and adaptive mode when running on battery. This is to extend battery life as much as possible without sacrificing much speed.

devfs support needs to be added in order to support using an external USB optical drive. The ruleset mentioned here is defined in /etc/devfs.rules (see below)

linux support must be enabled for flashplugin - who wouldn't like to watch paint dry once in a while :-)


--8<---
# -- sysinstall generated deltas -- # Sat Nov 13 20:42:02 2010
# Created: Sat Nov 13 20:42:02 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="wombat.mininet"
ifconfig_re0="DHCP"
#wlans_iwn0="wlan0"
#ifconfig_wlan0="DHCP"
moused_enable="YES"
moused_port="/dev/ums0"
nfs_client_enable="YES"
nfs_server_enable="YES"
rpcbind_enable="YES"
sshd_enable="YES"
powerd_enable="YES" # Run powerd to lower our power usage.
powerd_flags="-a hiadaptive -b adaptive -i 90" # Flags to powerd (if enabled).
devfs_system_ruleset="localrules"
linux_enable="YES"
--8<---

/etc/devfs.rules is modified to allow access to an external USB optical drive for everyone. The name of the ruleset must match the one used in rc.conf.

--8<---
# devfs(8) rules for devices not available at boot time
[localrules=10]
add path 'cd*' mode 0666
add path 'xpt*' mode 0666
add path 'pass*' mode 0666
--8<---

/etc/fstab needs an additional entry for the flashplugin to work.
--8<---
[...]
linproc /usr/compat/linux/proc linprocfs rw 0 0
--8<---

One of my favourite pastimes is to build a custom kernel. Here it is actually necessary in order to support some of the hardware. As always, you should familiarize yourself with building custom kernels by reading the appropriate chapter in the FreeBSD handbook. I've removed a few things which aren't required obviously, although I wasn't really zealous. I'm sure you could dump even more. However, the lazy among you can get away with copying the GENERIC kernel configuration and adding the following lines:

--8<---
# Intel Wireless support
device iwn
device iwnfw

# SMBus support
device smbus
device smb
device ichsmb

# sound
device sound
device snd_hda
--8<---

The first entry is an interesting one. As mentioned previously, the palmrest sticker claimed there is an Acer Nplify WLAN on board. However, pciconf -lv reports this:

iwn0@pci0:1:0:0: class=0x028000 card=0x13018086 chip=0x42328086 rev=0x00 hdr=0x00
vendor = 'Intel Corporation'
device = 'Carte Intel WiFi Link 5100 AGN (Intel WiFi Link 5100)'
class = network
re0@pci0:2:0:0: class=0x020000 card=0x02831025 chip=0x816810ec rev=0x02 hdr=0x00
vendor = 'Realtek Semiconductor'
device = 'Gigabit Ethernet NIC(NDIS 6.0) (RTL8168/8111/8111c)'
class = network
subclass = ethernet

So there's a plain ol' Intel chip. This is good for us as the Intel chip is supported, the Acer one apparently not (unless they're the same under the hood).

Finally, graphics need to be configured as well. Although xorg does a great job at just working out of the box these days, I needed to tweak a few things. I started by creating an xorg.conf from the xorg defaults (run this as root):

Xorg -configure

This will generate /root/xorg.conf which you should copy to /etc/X11/.

I'll list only those sections that were added or changed:

--8<---
Section "ServerFlags"
Option "AllowEmptyInput" "off"
EndSection

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Synaptics_Touchpad" "AlwaysCore"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

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

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us,de"
Option "XkbOptions" "grp:lwin_toggle,grp_led:scroll"
Option "XkbVariant" "nodeadkeys"
EndSection

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

Section "InputDevice"
Identifier "Synaptics_Touchpad"
Driver "Synaptics"
Option "Protocol" "psm"
Option "Device" "/dev/psm0"
Option "SendCoreEvents" "true"
Option "ZAxisMapping" "4 5 6 7"
Option "FingerLow" "26"
Option "FingerHigh" "31"
Option "HorizEdgeScroll" "1"
Option "MinSpeed" "0.1"
Option "MaxSpeed" "0.15"
Option "RTCornerButton" "2"
Option "RBCornerButton" "3"
Option "TapButton2" "2"
Option "TapButton3" "3"
EndSection
--8<---

The ServerFlags section must be inserted in order to get mouse and keyboard input to work at all. It is still a mystery to me why xorg defaults to not letting the user interact with it by means of a keyboard or a mouse. Does it expect to be yelled at?

The ServerLayout section receives an additional line that includes the touchpad. Make sure to use the "AlwaysCore" option, not a second "CorePointer" option as with the mouse. Xorg will be upset if you do this.

We'll have to load the synaptics module in order to get improved touchpad support. I tested the builtin touchpad support of the mouse driver as well, but I found it buggy as it inserted random additional mouse events like scroll or left click whenever I used the right touchpad button.

The keyboard is configured for two layouts. I prefer the US layout for programming tasks, but I need to keep the DE layout around for German texts and mails. As you can see, I finally found a way to make use of that apparently superfluous key with that weird Windoze logo on it: now it toggles my keyboard layouts :-)

The final sections set up the touchpad. I've arrived at the settings empirically, using the synclient(1) tool to change them on the fly. From top to bottom, I've made the touchpad slightly less sensitive, switched on horizontal scrolling, and limited the maximum speed to a value that avoids nausea. The last four lines add a middle mouse button at the top right corner and a right mouse button to the bottom right corner. This is convenient e.g. for opening new tabs in Firefox without having to move to the mechanical touchpad buttons.

That's about it. From here, everything else should work just as with your regular desktop in terms of configuration.

Kommentare

fmma meint:

how have you solved the problem with the screen brightness?
I have the same problem in pc-bsd
Dienstag 18 Januar 01:03

mhoenicka meint:

If you don't mind command lines, just use "xbacklight -set val", with 0<val<100. I'm running Xfce 4.6. There is a nifty panel plugin called "generic slider". This plugin simply runs a user-defined shell command using the numeric value that you slide to. Use something like the command above, and you'll be able to set the backlight brightness with your mouse. Good enough for me.
Dienstag 18 Januar 01:29

Frank meint:

Many thanks, will definite try, command line is no problem Screen brightness keys didn't work in PCBSD.
I also noticed your problem with the harddisk and the ACPI mode. Which BIOS version do you have. Do you know if upgrading to 1.28 would help.
Dienstag 18 Januar 16:11

Frank meint:

Another thought regarding the function key controlling the screen brightness.
Do you think something like
-----
keycode 239=XF86KbdBrightnessDown
keycode 123=XF86KbdBrightnessUp
------
in ~/.Xmodmap would work.
I got it from the archlinux wiki for the acer aspire one.
Dienstag 18 Januar 16:21

mhoenicka meint:

Sorry, but this doesn't seem to do me any good - it doesn't do anything here.
Mittwoch 19 Januar 00:26

mhoenicka meint:

One thing that I just happened to notice: The xorg.conf listing lacks the following line in the synaptics setup:

Option "MinSpeed" "0.1"

The blog post was updated accordingly
Donnerstag 09 Juni 22:46

Mein Kommentar

:

:
: