# Gentoo on IBM Thinkpad T42

## 21582

Updated: 28.03.2005 (cpufreq, PCMCIA, Thinkpad extras)

Shortly after having received an IBM Thinkpad T42 (Model-No. 2373-6ZG) I've installed Gentoo on it.

As the installation guides I've found in this forum (and on other places in the www) were quite helpful when setting up my system, I would like to share the information that is necessary for setting up Gentoo on this machine.

1. Basic System

Just follow the Gentoo Linux x86 Handbook (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml).

Booting with a stage1-minimal LiveCD (2004.3), the kernel was able to detect the ethernet device and IIRC automatically loaded the e1000 module. Therefore, assigning an IP using dhcpcd wasn't any problem.

I've deleted the Rescue Partition (designation: "Compaq diagnostic"), as this model only has a 40GB harddisk and it shouldn't be any problem to receive some Rescue CDs from IBM on request.

If you would like to use the suspend-to-disk mode of your laptop, make sure to make a swap partition of appropriate size!

Now just follow the installation guide.

The next T42 relevant part is editing /etc/make.conf.

CHOST should be set to i686-pc-linux-gnu (surprise, surprise), CFLAGS and CXXFLAGS depend on the gcc version.

When using gcc 3.4.x or higher use

```
-march=pentium-m
```

for older versions use

```
-march=pentium3 -msse2
```

As some packages seem to have problems with gcc 3.3.x generated SSE2 code, it would perhaps be wise to remove the -msse2.

For the USE flags, make sure to add

```
mmx sse sse2
```

Once again, follow the installation guide. The next important section is kernel configuration. I assume you have decided to use a 2.6.x kernel.

Under Processor type and features, make sure you choose Pentium M as processor family.

Under Device Drivers - Networking Support - Ethernet 1000Mbit check the Intel PRO/1000 Gigabit Ethernet Support (e1000).

For later use by the X-Server, perhaps also include Device Drivers - Character Devices - Direct Rendering Manage and ATI Radeon from the list below.

Proceed with the installation guide, after reboot hopefully everything is working fine, including the ethernet connection.

2. X-Server

I've decided to use the xorg server:

```
emerge xorg-x11
```

The relevant parts from my xorg.conf:

```

...

Section "Module"

        Load  "record"

        Load  "extmod"

        Load  "dbe"

        Load  "dri"

        Load  "radeon"

        Load  "glx"

        Load  "xtrap"

        Load  "freetype"

        Load  "type1"

EndSection

Section "DRI"

        Mode   0666

EndSection

...

Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

        Option      "XkbRules" "xorg"

        Option      "XkbModel" "pc89"

        Option      "XkbLayout" "de"

        Option      "XkbVariant" "nodeadkeys"

EndSection

...

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "auto"

        Option      "Device" "/dev/usbmouse"

        Option      "ZAxisMapping" "4 5"

EndSection

...

Section "Device"

        Identifier  "Card0"

        Driver      "radeon"

        VendorName  "ATI Technologies Inc"

        BoardName   "Radeon Mobility M7 LW [Radeon Mobility 7500]"

        Option      "AGPMode" "4"

        Option      "Accel"

        Option      "AGPFastWrite" "Yes"

        Option      "EnablePageFlip" "on"

        Option      "DDCMode" "Yes"

        BusID       "PCI:1:0:0"

EndSection

...

```

/dev/usbmouse reacts on input of an attached USB mouse, but also when using the trackpoint and the touchpad, including all buttons. Therefore, I have not installed the synaptics drivers.

BTW, same behaviour for /dev/psaux and /dev/mouse. 

The Radeon Mobility 7500 is troublesome in terms of hardware acceleration, check the forum for further advice.

3. Sound

Follow the Gentoo Alsa Guide (http://www.gentoo.org/doc/en/alsa-guide.xml).

The T42 has an Intel Sound Chip, so include 

```

ALSA_CARDS="intel8x0"

```

into /etc/make.conf before emerging alsa-driver.

4. Wireless LAN

The T42 has integrated WLAN:

```

lspci | grep 802.11

0000:02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abgNIC (rev 01)

```

The madwifi-driver work fine with the Atheros chipset.

Just follow the HOW-To from Gentoo WIKI (http://gentoo-wiki.com/index.php?title=HOWTO_Wireless_Configuration_and_Startup).

5. Powermanagement (ACPI)

Once again, there exists a nice How-To for setting up ACPI: http://www.gentoo.org/doc/en/power-management-guide.xml

cpufreq won't run (at least with gentoo-dev-sources-2.6.9), as the T42 has a Pentium M with the Dothan core which is not (yet) supported by speedstep-centrino.

speedfreq work's fine though.

Update: cpufreq now works with kernel 2.6.11. Under Power Management Options - CPU Frequency Scaling make sure to add Intel Enhanced SpeedStep and the ACPI tables (CONFIG_X86_SPEEDSTEP_CENTRINO,CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI ).

I've not yet tried standby, sleep or hibernation.

Take a look at section 11 of this guide for instructions on how to use the Fn+X key combinations to send your system into sleep mode.

6. Bluetooth

Just do what Gentoo Wiki tells you: http://gentoo-wiki.com/HOWTO_The_host-to-host_Bluetooth.

Don't forget to activate the bluetooth device with Fn+F5!

7. Infrared

not yet tested

8. Modem

Not tested and no intention to do so.

9. PCMCIA

Make sure to add Bus Options - PCCard (PCMCIA/CardBus) support and the appropriate bridge support (most likely CardBus yenta will work) to your kernel. PCMCIA network drivers can be found in Device Drivers - Networking Support - PCMCIA network device support.

First, you will need the PCMCIA Card Services. So

```

emerge pcmcia-cs

```

and perhaps add it to default runlevel. If so, make sure that yenta (or whatever bridge support you use) is listed in modules.autoload.d!

Now

```

modprobe yenta # or whatever bridge support you need

/etc/init.d/pcmcia start

modprobe pcnet_cs # the driver for my pcmcia network card

```

Check your dmesg output. A new device should be available now.

10. VGA-/TV-Out

VGA-Out worked flawlessly from scratch.

TV-Out is a subject for further investigations.

11. Thinkpad Extras

Thinkpads, like other notebooks, offer special keys for certain purposes.

The following keys or key combinations are hard-wired and work without any special drivers:

* Power Button  :Wink: 

* Increase/Decrease Volume

* Mute

* Fn+F5 (power up/down bluetooth)

* Fn+Pos1/End (increase/decrease brightness)

* Fn+PageUp (switch thinklight on/off)

In case you use KDE, you may want to activate the IBM Thinkpad KMilo plugin via Control Center - System Administration which will allow you to specify commands for certain buttons (i.e. "Access IBM").

In order to fire sleep events etc. we will have to install acpid and ibm_acpi:

```

emerge acpid ibm-acpi

```

(ibm-acpi may also be installed via the kernel configuration)

Add acpid to your default runlevel and add "ibm_acpi" to your modules.autoload.d.

acpid is explained in the Gentoo Powermanagement Guide (see section 5 in this guide).

ibm_acpi will recognize the thinkpad hotkeys (Fn+X) and forward all events to acpid.

In order to activate the keys, you will have to add the following line to /etc/conf.d/local.start:

```

# activate hotkeys via ibm_acpi

echo enable > /proc/acpi/ibm/hotkey

```

Restart acpid and press Fn+F3. Now check /var/log/acpid - you should see something similiar to

```

[Mon Mar 28 17:02:09 2005] received event "ibm/hotkey HKEY 00000080 00001003"

```

Lets define our actions for these events. First, create /etc/acpi/events/buttons:

```

# Fn keys

event=ibm/hotkey.*

action=/etc/acpi/actions/buttons_act.sh

```

This defines buttons_act.sh as our handler for all hotkey related events. Now create /etc/acpi/actions/buttons_act.sh:

```

#!/bin/bash

case "${1##ibm/hotkey HKEY 00000080 }" in

        "00001003") # Fn+F3

                /usr/bin/radeontool light off

                ;;

        "00001004") # Fn+F4

                echo 3 > /proc/acpi/sleep

                ;;

esac

```

Make this file executeable:

```

chmod +x /etc/acpi/actions/buttons_act.sh

```

In case you have not yet done so: 

```
emerge radeontool
```

Pressing Fn+F3 will switch off the LCD screen, Fn+F4 will send our system into sleep mode.

As you will have already seen, I'm not really a bash programmer. Especially the LCD switching will not work the way you will want it. Somehow the script should remember how often the button was pressed and appropriately use "off" or "on" as a parameter. If anyone could help me with this: Thank you!

Caution: Sleep Mode does not yet really work for me. Getting into sleep mode is no problem, however, waking up will lead to a reboot.Last edited by 21582 on Mon Mar 28, 2005 3:50 pm; edited 12 times in total

----------

## Deathwing00

Moved from Installing Gentoo by Earthwings request.

----------

## TecHunter

I just bought a T42, so your experiences will help me a lot. thanks!

----------

## Earthwings

I think cpufreq should run now on a 2.6.11 kernel.

----------

## blais

i bought a recent T42 with a different radeon card::

/proc/pci:    VGA compatible controller: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10] (rev 0).

I used fglrxconfig to setup my xorg server.

however i'm having some problems: glxgears does not run smoothly, it "blocks" every second or so, i still have to look into it, no idea what it could be.

----------

## MrStaticVoid

Just a note: my T41p (FireGL T2) can suspend and resume with the fglrx drivers and kernel agpgart using APM.

----------

## 21582

Added information regarding: cpufreq, PCMCIA and Thinkpad extras

----------

## blais

allrighty

after MUCH fiddling, i wrote a document that summarizes my own experience with installing Gentoo on the T42.  The online, up-to-date version will be kept at

http://furius.ca/techdoc/misc/thinkpad.html

I will paste it here for people searching:

=============================

  Thinkpad T42 Laptop Notes

=============================

:Author: Martin Blais <blais@furius.ca>

:Date: 2005-03-29

:Abstract:

   Some package notes about stuff specific to the Thinkpad T42 laptop.  Note

   that setup is covered in the gentoo.txt file.

.. contents::

.. section-numbering::

----------------

  Introduction

----------------

These are my notes on setting up a IBM Thinkpad T42 computer with a Gentoo

distribution.  Some of these notes may apply on other computer models or

brands.

Note that this is my working file and is the place when I keep ongoing

information about my laptop setup.  This file is thus due to change as often as

I find/try something new on my laptop setup (which should be for a while).

Kernel

~~~~~~

This document was written/updated for kernel 2.6.11.4.

---------------------------------

  What is important in a laptop

---------------------------------

I need the following features in a laptop:

- **power management**: this is the most important feature of all and is

  extremely important.  A laptop battery without power management does NOT last

  long enough for serious disconnected work.  When the laptop is running, some

  features need to be triggered to save power as much as possible.

- **suspending**: a lightweight method for turning off the computer. This makes

  it much convenient than to poweroff and reboot the machine everytime you need

  to move it.  There are two main approaches for doing this:

  1. suspend-to-disk (takes no battery at all)

  2. suspend-to-RAM (consumes about 5% of powersave consumption)

- **wireless**: a working wireless network interface.  I'm expecting to be able

  to list and change the connections easily, and to monitor them as well.

- **pointer input device**: some amount of configurability of the touchpad

  and/or trackpoint input devices.  I work with lots windows and sometimes I

  still need the mouse and I'm not going to be carrying an external USB mouse

  everywhere I go, so those need to be somewhat usable.

- **external keyboard**: support for an external keyboard.

All these aspects are explored in the sections below.

.. raw:: html

   <br clear='all' />

-----------------

  Compile Flags

-----------------

Starting at gcc-3.4 you can use -march=pentium-m for the Centrino

processors.  Set this up in /etc/make.conf

.. important:: FIXME TOOD 3.4 is not in gentoo stable yet, try this

   	       when it comes out.

------------------

  Kernel Support

------------------

This section outlines some general kernel support for laptops and laptop events.

There are two event protocols:

1. APM: advanced power management.  This is obsolete.  Do not use this.

2. ACPI: a complicated industry standard whose implementation has only recently

   been merged into the kernel.  *This is what we use.*

ACPI Support

~~~~~~~~~~~~

In the kernel

`````````````

Enable all the events that you will want to trigger scripts on in the kernel

configuration under ACPI support.

acpid

`````

emerge acpid::

  * sys-power/acpid

       Available versions:  1.0.1 1.0.2-r1 1.0.2-r2 ~1.0.4

       Installed:           1.0.2-r2

       Homepage:            http://acpid.sourceforge.net

       Description:         Daemon for Advanced Configuration and Power Interface

ibm-acpi driver

```````````````

::

  * app-laptop/ibm-acpi

       Available versions:  0.10

       Installed:           no

       Homepage:            http://ibm-acpi.sourceforge.net

       Description:         IBM ThinkPad ACPI extras

This is a Linux ACPI driver for the IBM ThinkPad laptops. It aims to support

various features of these laptops which are accessible through the ACPI

framework but not otherwise supported by the generic Linux ACPI drivers.

Features::

    The features currently supported are the following (see the README for

    detailed description):

    * Fn key combinations (hotkey)

      	 To enable hotkeys::

		echo enable > /proc/acpi/ibm/hotkey

		echo 0xFFFF > /proc/acpi/ibm/hotkey

         This enables the F keys only, not the special Access IBM button and the

         power button, etc.

    * Bluetooth enable and disable (bluetooth)

    * video output switching, expansion control (video)

    * ThinkLight on and off (light)

    * limited docking and undocking (dock)

    * UltraBay eject (bay)

    * CMOS control (cmos)

    * LED control (led)

    * ACPI sounds (beep)

    * temperature sensors (thermal)

    * Experimental: embedded controller register dump (ecdump)

    * Experimental: LCD brightness control (brightness)

    * Experimental: volume control (volume)

    * Experimental: fan speed, fan enable/disable (fan)

The ibm-acpi driver is part of kernel 2.6.10 and later (option

CONFIG_ACPI_IBM). The version included in the kernel may be older than the

latest release available from this web site.

(The T42 is explicitly supported.)

.. note:: We have disabled this with the kernel and emerged the package in

   	  Gentoo, which is more recent than the version that is in the kernel.

Interfaces to ACPI

~~~~~~~~~~~~~~~~~~

apcitool

````````

::

  * app-laptop/acpitool

       Available versions:  0.2.5 ~0.2.6

       Installed:           0.2.5

       Homepage:            http://freeunix.dyndns.org:8088/site2/acpitool.shtml

       Description:         A small command line application, intended to be a replacement for the apm tool

This is a rather lame C++ code that reads the files in /proc.

You could do better in 10 times less code in Python.

Note: fan status does not seem to work in acpitool.  I should fix that.

Thinkpad Drivers

~~~~~~~~~~~~~~~~

tpctl

`````

::

  * app-laptop/thinkpad

       Available versions:  3.2 4.1 4.3 4.3-r1 4.8 *~5.7 ~5.8

       Installed:           no

       Homepage:            http://tpctl.sourceforge.net

       Description:         Thinkpad system control kernel modules

  * app-laptop/tpctl

       Available versions:  3.2 4.2 4.4 4.4-r1 4.8 ~4.16

       Installed:           no

       Homepage:            http://tpctl.sourceforge.net/tpctlhome.htm

       Description:         Thinkpad system control user space programs

  * app-laptop/configure-thinkpad

       Available versions:  *~0.1-r3 *~0.7 *~0.8

       Installed:           no

       Homepage:            http://tpctl.sourceforge.net/configure-thinkpad.html

       Description:         Thinkpad GNOME configuration utility for tpctl

Execute ``man ./tpctl.1`` to see the tpctl man page.  More info::

  libsmapidev.o is a library of functions that can be used to access

  (some of) the features of the SMAPI BIOS via the smapi driver.

  (See below for information about drivers.)

  tpctl is a console interface to the drivers.

  ntpctl is an ncurses interface to the drivers.

  apmiser is a daemon that uses tpctl to control the power expenditure

  mode dynamically according to CPU load.  See the README file in the

  "apmiser" directory for more information.

  These programs require the "thinkpad drivers".  The object files

  thinkpad.o, smapi.o, superio.o, rtcmosram.o and thinkpadpm.o are

  drivers in the form of loadable kernel modules which serve as

  interfaces to the IBM System Management Application Program Interface

  (SMAPI) BIOS found in some IBM ThinkPad laptop computers and as

  drivers of certain ThinkPad hardware components.  Please see the

  README file in the thinkpad drivers tarball for more information.

  tpctlir will enable or disable the infrared port on ThinkPads with

  Programmable Option Select registers: e.g., the 760 and 765.  Newer

  ThinkPads such as the ThinkPad 600 do not seem to have these registers.

  See the README file in the "tpctlir" directory for more information.

.. important:: FIXME TODO

   I was not able to compile the app-laptop/thinkpad kernel drivers

   (2005-03-1 :Cool: .  Try again later.

-----------------

  Input Devices

-----------------

This section describes the various input devices.

Keyboard

~~~~~~~~

I like to have the Control key where the Caps-Lock key is located.

- in the console, I copy /usr/share/keymaps/i386/qwerty/us.map.gz

  to us-nocaps.map.gz and edit it by hand.  Then I change

  /etc/conf.d/keymaps::

      KEYMAP="us-nocaps"

- in X windows, I accomplish this with Xmodmap when logging in an

  xsession.

Mice (General Info)

~~~~~~~~~~~~~~~~~~~

I have three mouse devices that I use with the Thinkpad:

1. the Synaptics touchpad

2. the IBM trackpoint (the little red thing in the middle of the keyboard).

3. an external USB mouse

Note: the mouse buttons below the keyboard are associated with the trackpoint,

and not with the touchpad.

I use udev.  With the USB mouse plugged in, the following mouse devices are

listed under /proc/bus/input/devices::

  I: Bus=0011 Vendor=0001 Product=0001 Version=ab54

  N: Name="AT Translated Set 2 keyboard"

  P: Phys=isa0060/serio0/input0

  H: Handlers=kbd event0

  B: EV=120013

  B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe

  B: MSC=10

  B: LED=7

  I: Bus=0011 Vendor=0002 Product=0007 Version=0000

  N: Name="SynPS/2 Synaptics TouchPad"

  P: Phys=isa0060/serio1/input0

  H: Handlers=mouse0 event1

  B: EV=b

  B: KEY=6420 0 70000 0 0 0 0 0 0 0 0

  B: ABS=11000003

  I: Bus=0011 Vendor=0002 Product=0001 Version=0000

  N: Name="PS/2 Generic Mouse"

  P: Phys=synaptics-pt/serio0/input0

  H: Handlers=mouse1 event2

  B: EV=7

  B: KEY=70000 0 0 0 0 0 0 0 0

  B: REL=3

  I: Bus=0003 Vendor=046d Product=c00e Version=1110

  N: Name="Logitech USB-PS/2 Optical Mouse"

  P: Phys=usb-0000:00:1d.1-1/input0

  H: Handlers=mouse2 event3

  B: EV=17

  B: KEY=70000 0 0 0 0 0 0 0 0

  B: REL=103

  B: MSC=10

/dev/input contains::

  crw-------  1 root root 13, 64 Mar 29 07:07 event0

  crw-------  1 root root 13, 65 Mar 29 07:07 event1

  crw-------  1 root root 13, 66 Mar 29 07:07 event2

  crw-------  1 root root 13, 67 Mar 29 07:28 event3

  crw-r--r--  1 root root 13, 63 Mar 29 07:07 mice

  crw-r--r--  1 root root 13, 32 Mar 29 07:07 mouse0

  crw-r--r--  1 root root 13, 33 Mar 29 07:07 mouse1

  crw-r--r--  1 root root 13, 34 Mar 29 07:28 mouse2

cat'ting the various devices and fiddling each mice separately reveals which is

which (also see file above).

In my X configuration file, I have a section that includes all of them::

  Section "ServerLayout"

      ...

      InputDevice "Touchpad" "CorePointer"

      InputDevice "Trackpoint" "CorePointer"

      InputDevice "USBMouse" "CorePointer"

      InputDevice "Keyboard1" "CoreKeyboard"

Touchpad

~~~~~~~~

By default, the kernel gives me these messages::

  Synaptics Touchpad, model: 1

   Firmware: 5.9

   Sensor: 44

   new absolute packet format

   Touchpad has extended capability bits

   -> multifinger detection

   -> palm detection

   -> pass-through port

  input: SynPS/2 Synaptics TouchPad on isa0060/serio1

  serio: Synaptics pass-through port at isa0060/serio1/input0

  input: PS/2 Generic Mouse on synaptics-pt/serio0

There is a basic driver in the kernel for the Synaptics touchpads, but there is

a dedicated driver for Xorg, with a lot more advanced features.

::

  * x11-misc/synaptics

       Available versions:  0.13.6 0.14.0 ~0.14.1

       Installed:           no

       Homepage:            http://w1.894.telia.com/~u89404340/touchpad/

       Description:         Driver for Synaptics touchpads

To use it, you need to enable the following in kernel-2.6::

   CONFIG_INPUT_EVDEV

   CONFIG_MOUSE_PS2

You get two programs with this:

- synclient: cmdline configuration and query tool

- syndaemon: daemon to run from your xsession for palm detection (this disables

  the touchpad for a fixed delay after a key on the keyboard has been pressed,

  to avoid moving the mouse by accident when using the keyboard)

My input device declaration looks something like this::

   Section "Module"

      ...

      Load "synaptics"

   ...

   # Input devices section

   Section "InputDevice"

      Identifier "Touchpad"

      Driver "synaptics"

      Option "SendCoreEvents"

      Option "Device" "/dev/input/event1"

      Option "Protocol" "event"

      # Next line required only if you want to disable the mousepad while typing:

      Option "SHMConfig" "on"

      # The rest of the options are NOT required, just a default similar to the

      # Windows drivers with non of the extra features.

      Option "LeftEdge"      	        "1900"

      Option "RightEdge" 	 	"5400"

      Option "TopEdge" 		 	"1400"

      Option "BottomEdge" 	 	"4500"

      Option "FingerLow" 	 	"25"

      Option "FingerHigh" 	 	"30"

      Option "MaxTapTime" 	 	"180"

      Option "MaxTapMove" 	 	"220"

      Option "MaxDoubleTapTime"  	"180"

      Option "ClickTime" 	 	"100"

      Option "FastTaps" 	 	"0"

      Option "EmulateMidButtonTime"	"75"

      Option "VertScrollDelta" 		"0"

      Option "HorizScrollDelta" 	"0"

      Option "MinSpeed" "0		.06"

      Option "MaxSpeed" "0		.18"

      Option "AccelFactor" "0		.001"

      Option "EdgeMotionMinZ" 		"30"

      Option "EdgeMotionMaxZ" 		"160"

      Option "EdgeMotionMinSpeed" 	"1"

      Option "EdgeMotionMaxSpeed" 	"400"

      Option "EdgeMotionUseAlways" 	"0"

      Option "UpDownScrolling" 		"1"

      Option "TouchpadOff" 		"1"

      Option "GuestMouseOff" 		"0"

      Option "LockedDrags" 		"0"

      Option "RTCornerButton" 		"2"

      Option "RBCornerButton" 		"3"

      Option "LTCornerButton" 		"0"

      Option "LBCornerButton" 		"0"

      Option "TapButton1" 		"1"

      Option "TapButton2" 		"2"

      Option "TapButton3" 		"3"

      Option "CircularScrolling" 	"1"

      Option "CircScrollDelta" "0	.195"

      Option "CircScrollTrigger" 	"0"

      Option "CircularPad" 		"0"

      Option "PalmDetect" 		"1"

      Option "PalmMinWidth" 		"10"

      Option "PalmMinZ" 		"200"

      Option "CoastingSpeed" 		"0"

   EndSection

Circular scrolling is **fabulous**!  This is better than the Powerbook's

two-finger scrolling.  Also, multi-finger tapping works fine, with one, two and

three fingers. You can even tap 3-then-1 and hold.

GUIs to configure the touchpad

``````````````````````````````

qsynaptics

http://www.sourceforge.net/projects/qsynaptics

ltpconf

http://ltpconf.sourceforge.net/

I find that qsynaptics worked better for me.  I used it to set the

parameters for the touchpad and then I listed them with synclient

-l, changed my X configuration file and then I do not touch them.

Gestures

````````

.. important:: FIXME TOOD

   Look at a gestures implementation, which would allow me to draw some shapes

   on the touchpad and bind that to specific commands.  Somebody *must* have

   implemented this.

Links

`````

More info in gentoo wiki::

http://gentoo-wiki.com/HARDWARE_Synaptics_Touchpad

Trackpoint

~~~~~~~~~~

The trackpoint is the little red clitoris device in the middle of

the keyboard.  The trackpoint works with the standard mouse driver.

My X input device declaration for it::

  Section "InputDevice"

      Identifier "Trackpoint"

      Driver "mouse"

      Option "SendCoreEvents" # needed for multiple devices

      Option "Protocol"   "ExplorerPS/2"

      Option "Device"     "/dev/input/mouse1"

  EndSection

I find it works reasonably well with no trackpoint-specific

configuration.

IBM TrackPoint Linux kernel driver

``````````````````````````````````

From http://people.clarkson.edu/~evanchsa/ ::

  This is a driver I wrote for the 2.6.x series kernels for my

  TrackPoint. You can customize many settings with this extension

  to the psmouse module. The device is nothing more than an

  extension of the PS/2 protocol. You can modify the device's

  settings via files in /proc/trackpoint. NEW - The TrackPoint

  driver now supports middle button scrolling!

This is a simple kernel patch.

.. important:: FIXME TODO

   The patch does not apply on kerner-2.6.11 so I could not try it.fix the patch

   and try it.

The Linux Trackpoint Utilities

``````````````````````````````

From http://www.slac.stanford.edu/~strauman/pers/tp4utils/ ::

  [...]

  However, modern pointing devices, such as the IBM Trackpoint (R)

  contained in their ThinkPad computers exhibit more features than

  a basic PS2 mouse. (This also applies to touchpad devices, see

  e.g. here). The trackpoint hardware is capable to detect z-axis

  pressure and hence is inherently a three-dimensional device. Most

  popular software applications however are not able to deal with

  3D mouse input data. On the other hand, the trackpoint hardware

  supports various ways of mappingz-axis activity to other,

  essentially mouse button press/release events. Also, the

  trackpoint hardware has more configurable parameters than the

  traditional mouse resolution and scale.

.. important:: FIXME TODO / try this when it starts working with

   	       2.6.  Website seems active that this should happen soon.

GUIs for configuring the Trackpoint

```````````````````````````````````

configure-trackpoint

http://tpctl.sourceforge.net/configure-trackpoint.html

  Configure-trackpoint is a Gnome TrackPoint configuration tool written by

  Cheuksan Edward Wang (<wang02139_AT_gmail.com>). It uses the linux kernel 2.6

  TrackPoint driver written by Stephen Evanchik. At the moment this driver is not

  in the mainline kernel so you would need to apply his patch and compile your own

  kernel. Users of 2.4 kernel are recommended to use the Linux TrackPoint

  Utilities written by Till Straumann.

External USB mouse

~~~~~~~~~~~~~~~~~~

I like to plug a Logitech MouseMan Plus mouse with scroll wheel

when I'm at home.  The scroll wheel works fine.

In xorg.conf::

  Section "InputDevice"

      Identifier "USBMouse"

      Driver "mouse"

      Option "SendCoreEvents" # needed for multiple devices

      Option "Protocol"   "ExplorerPS/2"

      Option "Device"     "/dev/input/mouse2"

      Option "ZAxisMapping" "4 5" # for scroll wheel

  EndSection

.. important:: FIXME TODO

   If I start X without the USB mouse, and then I plug in the USB mouse, X does

   not realize that the mouse appeared and I cannot use it.  I need to log out

   and back in to have the external mouse work.  I wonder if there is an option

   to instruct Xorg to not try to detect the mouse and therefore to initialize

   the driver anyway.  Check this out further.

Laptop Buttons

~~~~~~~~~~~~~~

Laptops almost always-- except the powerbooks-- have some extra

buttons.  For example, on the Thinkpad there is a blue "Access IBM"

button and some volume control buttons next to it.  I want to make

use of some of those buttons somehow.

ThinkpadButtons

```````````````

::

  * app-laptop/tpb

       Available versions:  0.4.2 0.5.1 ~0.6.0 ~0.6.1 ~0.6.2 0.6.3

       Installed:           no

       Homepage:            http://savannah.nongnu.org/projects/tpb/

       Description:         IBM ThinkPad buttons utility

With TPB it is possible to bind a program to the ThinkPad, Mail, Home and Search

button. TPB can also run a callback program on each state change with the

changed state and the new state as options. So it is possible to trigger several

actions on different events. TPB has a on-screen display (OSD) to show volume,

mute, brightness and some other informations. Furthermore TPB supports a

software mixer, as the R series ThinkPads have no hardware mixer to change the

volume.

Installation:

- emerge tpb

- enable Character Devices -> /dev/nvram support in kernel, recompile

Fingerprint Reader

~~~~~~~~~~~~~~~~~~

.. important:: FIXME TODO

   I think this is not supported yet, but it would be awesome to replace

   entering my password for my GPG key.

Other Things

~~~~~~~~~~~~

tp-scroll

`````````

tp-scroll allows the use of the middle mouse button on a Trackpoint keyboard for

scrolling up and down in applications that support the use of the wheel on an

Intellimouse.  Basically, you hold the middle mouse button on the thinkpad and

use the trackpoint or touchpad to generate scroll events.

From http://rsim.cs.uiuc.edu/~sachs/tp-scroll/  ::

     INSTALLATION:

     1. gcc -o tp-scroll tp-scroll.c -lm

     2. mkfifo /dev/imouse

     3. In XF86Config, replace the InputDevice section:

        Section "InputDevice"

                Identifier  "Mouse0"

                Driver      "mouse"

                Option      "Device" "/dev/imouse"

                Option      "Protocol" "ExplorerPS/2"

                Option      "Emulate3Buttons" "off"

                Option      "ZAxisMapping" "4 5"

        EndSection

     4. disable gpm (sorry, doesn't play nice with gpm yet)

     5. add "[path]/tp-scroll /dev/mouse /dev/imouse" to rc.local.

  (Worked directly as above. Added script to /etc/init.d/local.start)

Warning: tp-scroll is nice if you want to use that, but it messes up with the

USB mouse.

.. note:: I do not use this since the circular scrolling provided by the

   	  Synaptics driver is so much better that this.

--------------------

  Power Management

--------------------

Here are the different types of power management that a laptop can implement:

- LCD power: reduce the intensity of the LCD or turn it off.  Remember that the

  LCD is battery consumer no.1;

- HDD power: spin down the drive when it is not being used;

- Current wireless interface (on/off);

- CPU power: CPU frequency scaling allows changing the speed of the CPU

  dynamically;

http://www.gentoo.org/doc/en/power-management-guide.xml

**Comparison to Apple Powerbook.** On the Powerbook with OSX they have very nice

power management available in the profiles:

1. wireless off

2. spindown hdd

3. backlight down to lowest setting

4. turn off the lcd after a delay

5. don't play with cd drive

6. clock down processor

Their energy profiles have:

- any amount of profiles is available

- each profile has two modes:

  - when AC power is on

  - when on battery mode

Profiles

~~~~~~~~

We have basically two usage patterns for power:

1. with the AC adapter plugged-in;

2. running off the battery;

The Gentoo documentation suggests using two different runlevels for this and

triggering on ACPI events.

.. important:: FIXME TODO

   Setup automated triggering of the two power usage profiles.

Battery Monitoring

~~~~~~~~~~~~~~~~~~

Question: what is an easy way to monitor the battery power?  Is there a nice GUI

for it?

.. important:: FIXME TODO

   Find a way to monitor the battery status and power usage.

We would like to monitor battery status (charging/discharging), consumption,

calculate remaining time, AC/battery, fan status and thermal info.

CPU Frequency Scaling

~~~~~~~~~~~~~~~~~~~~~

cpufreq started working at kernel 2.6.11.

You can interact with the cpufreq module by cat'ing files in

``/sys/devices/system/cpu/cpu0/cpufreq``.

LCD Display

~~~~~~~~~~~

The intensity of the display should be turned down when on battery mode. The T42

seems to do that automatically.  Nevertheless, we might want to turn off the

display temporarily sometimes.

app-laptop/radeontool

`````````````````````

::

       Available versions:  1.5-r1

       Installed:           no

       Homepage:            http://fdd.com/software/radeon/

       Description:         Control the backlight and external video output of ATI Radeon Mobility graphics cards

Radeontool is a hack I created to save some battery on my Dell Latitude C610

with an ATI Radeon Mobility graphics chip. Radeontool can turn off and on the

backlight and external video output. Radeontool requires lspci.

examples::

   radeontool dac off

.. important:: FIXME TODO

   Check how to set the DAC to off when running on the battery.

Hard-disk Drive

~~~~~~~~~~~~~~~

Flushing the HDD

````````````````

::

  * sys-block/noflushd

       Available versions:  2.6.3 2.7.3 ~2.7.4

       Installed:           no

       Homepage:            http://noflushd.sourceforge.net

       Description:         A daemon to spin down your disks and force accesses to be cached

The noflushd daemon delays hard disk buffer flushes for a time, or until the

next disk read occurs, thus reducing the number of spinups required, thus saving

battery power.

Wireless Power

~~~~~~~~~~~~~~

.. important:: FIXME TODO

  - how do you switch between wired/wireless/offline configs without rebooting?

    can it be automated with hotplug?

    (check in the power management guide, thre is the answer)

--------------

  Suspending

--------------

There are two modes of suspend that I'm mostly interested in:

1. Suspend-to-Disk (aka Hibernate / S4).

   This writes the contents of the memory in the swap (thus the swap must be

   larger than the RAM), and poweroff the machine. When rebooting, early in the

   rc init sequence that swap memory is restored.

   This is still a bit slow, but faster than a full reboot, and provides a crude

   method for session management (all applications remain on the desktop).

2. Suspend-to-RAM (aka Sleep / S3)

   The computer is not powered off, but rather put in a special

   hardware-supported mode where every devices is turned off, except a small

   portion of power is used for refreshing the memory.

   This allows the fastest recovery.  This is the mode that is commonly used in

   powerbooks.  However, the battery used for keeping the memory fresh drains

   the battery at a rate around 5% that of the machine running.  This should

   allow it to keep going for about two days, which is plenty enough if you

   use/plug the machine often, like I do.

There is some support in the kernel (namely, swsusp1), but the newer

implementation of software suspend is not merged yet.  It is called swsusp2.

Enable the sleep states in ACPI support in the kernel.

Links:

http://gentoo-wiki.com/HOWTO_Software_Suspend_v2

http://www.suspend2.net/

http://www.suspend2.net/HOWTO

Suspend-to-Disk / Hibernate

~~~~~~~~~~~~~~~~~~~~~~~~~~~

All the gory details here:

http://gentoo-wiki.com/HOWTO_Software_Suspend_v2

- emerge hibernate-script (~x86)

- install swsusp2, patch the kernel and recompile

  - Note: I had to compile the USB options as kernel modules for hibernate to

    work properly.

lphdisk

```````

I did not try this yet::

  * app-laptop/lphdisk

       Available versions:  0.9.1 0.9.1-r1

       Installed:           no

       Homepage:            http://www.procyon.com/~pda/lphdisk/

       Description:         utility for preparing a hibernation partition for APM Suspend-To-Disk

Suspend-to-RAM / Sleep

~~~~~~~~~~~~~~~~~~~~~~

- enable sleep states in the kernel (and associated stuff)

- boot the kernel with ``resume=`` option, e.g.

     kernel /vmlinuz-2.6.11.4 root=/dev/hda3 resume=/dev/hda3

  Problem: how can I turn the thing back on?  I press on anything and it doesn't

  turn itself back on.

.. important:: FIXME TODO

   - ask the swsusp2 mailing-list if their apparent support (or

     hibernate scripts) is better than the sleep implementation

     that is in the kernel

Wake

~~~~

The T42 support multiple modes of waking up from the suspend modes (e.g. from a

special packet coming from the network).  This could be nice to leave the

machine at home and turn it own remotely.  I think some BIOS fiddling will be

necessary to make this work.

.. important:: FIXME TODO

   Check out how this works.

Debugging

~~~~~~~~~

Tricks, from kernel source/Documentation/power/tricks.txt:

   Pavel Machek <pavel@suse.cz>

   If you want to trick swsusp/S3 into working, you might want to try:

   * go with minimal config, turn off drivers like USB, AGP you don't

     really need

   * turn off APIC and preempt

   * use ext2. At least it has working fsck. [If something seemes to go

     wrong, force fsck when you have a chance]

   * turn off modules

   * use vga text console, shut down X. [If you really want X, you might

     want to try vesafb later]

   * try running as few processes as possible, preferably go to single

     user mode.

   * due to video issues, swsusp should be easier to get working than

     S3. Try that first.

   When you make it work, try to find out what exactly was it that broke

   suspend, and preferably fix that.

------------

  Graphics

------------

- emerge ati-drivers ati-drivers-extra

- run::

    opengl-update ati

    /opt/ati/bin/fglrxconfig

  This creates the xorg.conf configuration file.

  I had to change "Keyboard" to "keyboard" (xdm wouldn't start).

  Use this:  /opt/ati/bin/fglrxinfo

My xorg.conf file is too big to quote here.

Radeon Mobility specific packages

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

  * app-laptop/radeontool

       Available versions:  1.5-r1

       Installed:           no

       Homepage:            http://fdd.com/software/radeon/

       Description:         Control the backlight and external video output of ATI Radeon Mobility graphics cards

Simple tool that allows to do very basic force of LCD off, etc.

Dual Screen Setup

~~~~~~~~~~~~~~~~~

.. important:: FIXME TODO

   - how do I set up dual screen display?

     do I need Xinerama?

---------

  Audio

---------

I'm using ALSA that comes with the kernel and it works fine.  In

/etc/make.conf::

   ALSA_CARDS="intel8x0"

There is also an integrated speaker on the T42, but it automatically shuts off

when the headphone jack is plugged in (I suppose that this a hardware thing and

it can't be changed, and I don't really mind).

--------------------

  Wired Networking

--------------------

The drivers already present work well with the T42's wired ethernet connection.

The interface shows up as eth0.

-----------------------

  Wireless Networking

-----------------------

Gentoo wireless documentation:

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

The interface is eth1 ::

  cd /etc/init.d

  ln -s net.lo net.eth1

This should depend on your hardware.  I order my T42 with then Intel 2200/BG

hardware.  There was an option for getting the IBM wireless hardware, which is

supposed to be supported by some Atheros (sp?) driver.

Drivers

~~~~~~~

ipw2200 driver

``````````````

HW is Intel 2200BG integrated on Thinkpad mobo

http://ipw2200.sourceforge.net/

- kernel: enable hotplug firmware loading

- kernel: enable net_radio (amateur)

- kernel: enable wireless

- kernel: enable crypto ARC4 and CRC32, MICHAEL MIC

- emerge baselayout recent

- emerge wireless-tools

- emerge ipw2200 ipw2200-firmware

- after compiling and installing all the wireless stuff above,

  reboot, and do::

     modprobe ipw2200

  And the iwtools start working.

ndiswrapper

```````````

::

  * If you would like to load this module automatically upon boot

  * please type the following as root:

  *     # echo "ndiswrapper" >> /etc/modules.autoload.d/kernel-2.6

  *

  * ndiswrapper requires .inf and .sys files from a Windows(tm) driver

  * to function. Download these to /root for example, then

  * run 'ndiswrapper -i /root/foo.inf'. After that you can delete them.

  * They will be copied to the proper location.

  * Once done, please run 'update-modules'.

  * check http://ndiswrapper.sf.net/phpwiki/index.php/List for drivers

  * Look for the following on that page for your driver:

  * 8086:101e 8086:4220

  * Please have a look at http://ndiswrapper.sourceforge.net/wiki/

  * for the FAQ, HowTos, Tips, Configuration, and installation

  * information.

  * IF UPGRADING FROM PRE-1.0!!!

  * You MUST re-install your Windows drivers.

  * Best way to do this is to run the following commands

  * mv /etc/ndiswrapper/{driver} /tmp

  * ndiswrapper -i /tmp/{driver}/{driver}.inf

linuxant

````````

Linuxant sells a commercial driver that wraps the Windows driver for the

wireless card and other devices.

Command-line tools

~~~~~~~~~~~~~~~~~~

The widely used wireless-tools is what you should use::

  * net-wireless/wireless-tools

       Available versions:  24 25-r1 26-r1 27_pre26 ~27_pre27 ~27_pre28 27 ~28_pre6

       Installed:           27

       Homepage:            http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html

       Description:         A collection of tools to configure wireless LAN cards

Fiddle with it like this::

  /etc/init.d/net.eth1 start

  iwconfig eth1 essid <essid>

  iwconfig eth1 key open <wep-key>

  iwlist eth1 scan

.. important:: FIXME TODO

   The Gentoo initscripts for wireless suck.  When attempting to connect it

   finds a different list of networks than the simple scan does.

   Besides, wireless connections need a GUI, to be able to dynamically edit

   profiles --you change networks all the time-- and to display signal strength.

   write something nice, along the lines of wifi_radar.py.

GUI configuration tools

~~~~~~~~~~~~~~~~~~~~~~~

- kwifimanager

- wlan-ui

- wifi radar (2)

Wireless Questions

~~~~~~~~~~~~~~~~~~

Note:

  Wireless networks come in two general flavors. The Linux folks call them

  "Managed" and "Ad-hoc". The Managed flavor is a large wireless network

  consisting of many access points. The NIC will go out and scan for the best

  access point and use that one. You do not have to specify things like the

  channel or the name of the access point. The Ad-hoc flavor is designed for a

  residence or workgroup - use this if you want the client to connect to one

  particular access point. As far as I know, the Managed and Ad-hoc modes are

  mutually exclusive - you can't use the Managed mode of the card to

  automatically search for access points in the Ad-hoc mode.

Question: how can I get better diagnostic of wireless failures?

Question: can a card connect with multiple networks at the same time?

Question: with two cards, could I connect to two networks at the same time?

Question: how come the scan list seems to come and go?

Question: what about dhcp, how does it work?  Do I need it?

Question: what is association?

Question: does my card have to remain fixed in a since channel?

Question: if you don't use DHCP, what other options are there?

Question: what is a cell, and what is an Access Point? see man iwconfig mode

Question: what is the difference between managed and adhoc modes?

	  Which is more common?

Question: what is the difference between the essid and the "nickname"?

  The nickname is something solely used as a convenience, and it is not to be

  taken seriously at all.  From the iwconfig man page::

    nick[name]

      Set the nickname, or the station name. Some 802.11 products do

      define it, but this is not used as far as the protocols (MAC,

      IP, TCP) are concerned and completely useless as far as

      configuration goes. Only some diagnostic tools may use it.

      Example :

           iwconfig eth0 nickname "My Linux Node"

Question: how do I implement creating a local network with other computers in

the vicinity, a la rendez-vous on the Mac?

--------------------

  External Devices

--------------------

Happy Hacker Lite 2 USB Keyboard

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

My Happy Hacker Lite 2 USB keyboard seems to work fine when I just

plug it in.

On my external keyboard, well, it already has the control key in its right

place.

.. important:: FIXME TODO /

  - how do I switch between USB keyboard and no USB keyboard config

    without logging off?  can I run a hotplug script to change

    xmodmap when the USB keyboard is plugged/unplugged?

  - the thinkpad has window-tab keys near the arrows on the lower

    right.  Can I map one of those keys to act exactly like on the

    HHKB, as a function key that would give me access to the

    home/end/arrow keys using the buttons left of the enter key?

    That would rock.

PCMCIA Cards

~~~~~~~~~~~~

- cardctl is in pcmcia-cs (useful for acpi support)

  emerge pcmcia-cs

USB Hard-disk Drive

~~~~~~~~~~~~~~~~~~~

- works just fine.  When I turn it on, the device file appears and I can mount

  it.  I have an appropriate line in /etc/fstab for it (with option ``noauto``).

-------------------

  Working Offline

-------------------

Local Cache

~~~~~~~~~~~

I would like to be able to trigger "something", then browse the web, then go

offline and be able to access the data that I've been browsing (without access

to the network).

I tried (2005-03-2 :Cool:  doing this with squid, installing it and configured with

``offline_mode on`` and it didn't just work.  There would need be more config

work to make this work nicely.  I think this would be possible.

.. important:: FIXME TODO

   Try to configure squid for storing offline cache for browsing.

---------

  Links

---------

Other people's pages about their experience with the Thinkpad.  Also check out

the Thinkpad webring below.

http://www.peteleonard.com/gentoo-t41p/

http://www.stanford.edu/~sanjiv/thinkpad/thinkpad.html

https://forums.gentoo.org/viewtopic-t-201356-highlight-tpctl+t42.html

http://t.webring.com/hub?ring=linuxthinkpad

http://wiki.version6.net/T42

http://forum.thinkpads.com/viewforum.php?f=9&sid=a2588146bdfd5f76512a657a34c40268

Gentoo thread on the T42

https://forums.gentoo.org/viewtopic-t-272843-highlight-t42+thinkpad.html

----------

## yem

Wow, great info here! You should get it linked from http://www.linux-laptop.net/

My own meagre notes are up at http://y3m.net/gentoo-on-t42/

----------

## Hydraulix

This is great! I'm planning on buying the T series ThinkPad in the near future. But I might wait for a 64 bit ThinkPad to come out. That fingerprint scanner is great. Hopefully there's support for this in Linux.

----------

## panlm

http://www.linux-on-laptops.com/ibm.html

----------

## TecHunter

3x for this good help! I just installed gentoo 2005.0 on my T42

I have one more question: If gcc in portage upgrade to 3.4.x, then can I simply modify -march in make.conf and reemerge gcc and something else?

----------

## Sm1

Here is a quick way to use radeontool to alternate turning on and off your LCD when you hit FN F3

```
                                                

if [[ -e /tmp/.radeonlock ]]

then

     /usr/bin/radeontool light on

     rm /tmp/.radeonlock

else

     /usr/bin/radeontool light off

     touch /tmp/.radeonlock

fi

;;

```

----------

## Sm1

A couple other solutions I have come up with:

ifplugd

This can be used to detect a link on eth0 and automatically enable/disable if there is a link or not

AccessIBM button

i used tpb to launch a script wireless.sh when accessibm is pressed.  This lets me enable and disable my wireless easily

```

if lsmod | grep ath_pci

then

        Xdialog --infobox "Wireless DISABLED" 5 20 3000

        /sbin/modprobe ath_pci -r;

        if [ -e /var/run/xsupplicant ]

        then

                sudo /etc/init.d/xsupplicant stop

                if [ -e /var/run/xsupplicant ]

                then

                        sudo /etc/init.d/xsupplicant zap

                fi

        fi

        if [ -e /var/run/kismet_server.pid ]

        then

                sudo /etc/init.d/kismet stop

                if [ -e /var/run/kismet_server.pid ]

                then

                        sudo /etc/init.d/kismet zap

                        sudo rm /var/run/kismet_server.pid

                fi

        fi

else

        ######################

        ##Always insert module

        /sbin/modprobe ath_pci

        ######################

        tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$

        trap "rm -f $tempfile" 0 1 2 5 15

        Xdialog --no-cancel --clear --title "Wireless Enabled" --menu "Atheros a/b/g Wireless Enabled.  What do you want to do?" 20 51 4 "CLOSE" "Choose the closest unsecured AP" "IBM" "Authenticate With IBM" "KISMET" "Scan using Kismet" "GKISMET" "Scan using Gkismet" 2> $tempfile

        retval=$?

        choice=`cat $tempfile`

        ######################

        #####Choose What to do

        ######################

        case $choice in

           IBM)

                   sudo /usr/bin/iwconfig ath0 essid IBM key 1234567890;

                   sudo /sbin/ifconfig ath0 up;

                   sudo /etc/init.d/xsupplicant start;

                   xterm -e "wavemon";;

           KISMET)

                   sudo killall runscript.sh;

                   sudo /etc/init.d/kismet start;

                   sleep 1;

                   Terminal -e "kismet_client";;

           GKISMET)

                   sudo killall runscript.sh;

                   sudo /etc/init.d/kismet start;

                   gkismet localhost;;

           CLOSE)

                   xterm -e "wavemon";;

        esac

fi

```

As for the touchpad, the synaptics driver is actually really good.  I use the trackpoing often, but then I use the right side of the touchpad for scrolling windows, which is really convenient for me.

The other thing I do is enable those little keys above the arrows.  These are back and forward for me in firefox.  Use keyconfig to remap keys in firefox

```

xmodmap -e "keycode 234 = F19"

xmodmap -e "keycode 233 = F20"

```

----------

## Sm1

On another note, I got ACPI s3 and s4 to work, here is my default.sh for /etc/acpi/default.sh

```

#!/bin/sh

# Event script for IBM Thinkpad R51

group=${1/\/*/}

action=${1/*\//}

case "$group" in

        # standard acpi button events

        button)

                case "$action" in

                        # powerbutton

                        power)  #/sbin/init 0

                                echo 4 > /proc/acpi/sleep

                                ;;

                        # lid open/close

                        lid)

                                if [[ -n `grep open /proc/acpi/button/lid/LID/state` ]] ; then

                                        #$dpms_force on

                                        /usr/bin/radeontool light on

                                else

                                        #$dpms_force off

                                        /usr/bin/radeontool light off

                                fi

                                ;;

                        # everything else -- undefined

                        *)      logger "ACPI action $action is not defined"

                                ;;

                esac

                ;;

        # ibm-acpi events

        ibm)

                case "$action" in

                        # Fn+F# hotkey

                        hotkey)

                                case "$4" in

                                        # F3 - turn off lcd

                                        00001003)

                                                if [[ -e /tmp/.radeonlock ]]

                                                then

                                                        /usr/bin/radeontool light on

                                                        rm /tmp/.radeonlock

                                                else

                                                        /usr/bin/radeontool light off

                                                        touch /tmp/.radeonlock

                                                fi

                                                ;;

                                        # F4 - sleep

                                        00001004)

                                                rmmod ehci_hcd ohci_hcd uhci_hcd

                                                /usr/local/sbin/vbetool vbestate save > /tmp/vbestat e

                                                chvt 1

                                                echo 3 > /proc/acpi/sleep

                                                /usr/local/sbin/vbetool post

                                                /usr/local/sbin/vbetool vbestate restore < /tmp/vbes tate

                                                chvt 7

                                                rm -f /tmp/vbestate

                                                modprobe ehci_hcd

                                                modprobe ohci_hcd

                                                modprobe uhci_hcd

                                                ;;

                                        # F5 - bluetooth

                                        00001005)

                                                ;;

                                        # F7 - switch display

                                        00001007)

                                                ;;

                                        # F8 - display expand

                                        00001008)

                                                echo expand_toggle > /proc/acpi/ibm/video

                                                ;;

                                        # F9 - ???

                                        00001009)

                                                ;;

                                        # F12 - hibernation

                                        0000100c)

                                                rmmod ehci_hcd ohci_hcd uhci_hcd

                                                /usr/local/sbin/vbetool vbestate save > /tmp/vbestat e

                                                chvt 1

                                                echo 4 > /proc/acpi/sleep

                                                /usr/local/sbin/vbetool post

                                                /usr/local/sbin/vbetool vbestate restore < /tmp/vbes tate

                                                chvt 7

                                                rm -f /tmp/vbestate

                                                modprobe ehci_hcd

                                                modprobe ohci_hcd

                                                modprobe uhci_hcd

                                                ;;

                                        esac

                                ;;

                        *)      logger "ibm/$action is no defined"

                                ;;

                esac

                ;;

        *)

                logger "ACPI group $group / action $action is not defined"

                ;;

esac

```

You will need a copy of vbetool which you can get here

http://www.srcf.ucam.org/%7Emjg59/vbetool/

and the patch for it which you can get here

http://sourceforge.net/mailarchive/message.php?msg_id=10770502

To enable LCD blanking you will need to use radeontool which I believe is in portage

----------

## fennex

 *Sm1 wrote:*   

> On another note, I got ACPI s3 and s4 to work, here is my default.sh for /etc/acpi/default.sh

 

What exactly do you mean with s3 and s4? Can I also use the sleep and hybernate commands with these files?

 *cb100 wrote:*   

> Lets define our actions for these events. First, create /etc/acpi/events/buttons:
> 
> Code:
> 
> # Fn keys
> ...

 

I got bluetooth starting when pressing FN-F5, so it would be easy to expand is to use "sleep" and "hybernate"

Thanks,

Fennex

----------

## Sm1

fennex, 

yes this is meant to expand on that same file.  add the two sections for s3 (sleep) and s4 (hibernate), as I have in mine.  Install the tool vbetool which I linked to there.  I personally had to remove USB drivers prior to being able to sleep, so thats what I do.  I also needed to save the video state (which is what vbetool does).  You might have to personally experiment with these - but this is what works for me.

----------

## fennex

Hi

you get your T42 to sleep, just add 

```
acpi_sleep=s3_bios
```

to your kernel parameters in grub.conf and you can get rid of vbetool mentioned above. You need to have 

```
CONFIG_ACPI_SLEEP=y
```

enabled in your kernel as well.

Fennex

----------

## Sm1

vbetool is required only when using fglrx.  If you are using xorg's builtin radeon, then you won't need to use it.

----------

## fennex

Well...

I use the fglrx drivers and it also works quiet well here.

----------

## Sm1

Well now thats rather odd that you got that to work to be honest, me and pretty much everyone else on the linux-thinkpad mailing list has had issues with fglrx and suspending.

We have all sent the boot parameters, switched to radeonfb from vesafb, and unloaded any other modules that could cause issues.  It was narrowed down to the bottom line issue being fglrx, and the only solution was the one I propsed to the mailing list to use vbetool.  If it works for you without it though, your the first in a very large number of people.

----------

## fennex

Ok

I did it your way and it works also on the second attempt to sleep  :Smile: 

In order to get hybernating working, do I have to pass acpi_sleep=s4_bios to the kernel as I did for s3?

Thanks, Fennex

----------

## blais

 *Quote:*   

> 
> 
> The other thing I do is enable those little keys above the arrows. These are back and forward for me in firefox. Use keyconfig to remap keys in firefox 

 

did you know shift+wheel does that too?

also about those buttons:  i would like to map the rightmost one to do like the Fn key on the happy hacker keyboard.  not sure it can be done...

----------

## Sm1

For hibernate to work, just pass the same argument you were passing before.  I didn't have any luck with software suspend2 patches, but software suspend seems to work fine now that I use vbetool.

blais:

I did know that firefox can do shift wheel for back/forward, but when reading some thing I dont have my hands on a mouse, but only arrow keys and this is convenient.  When using a mouse (or trackpoint for that matter), I just use all in one gestures.

----------

## xchric

After I emerge ibm-acpi

I cant see folder /proc/acpi/ibm created

and when i press Fn+F3

I did not see this message 

received event "ibm/hotkey HKEY 00000080 00001003"

how can i get this to work

thanks

----------

## Sm1

After you have emerged ibm-acpi, you have to load that module.

```

modprobe ibm-acpi

```

This will load it for the current boot, but add it into your 

/etc/modules.autoload.d/kernel2.6

Add the line

```

ibm-acpi

```

So that it will load on the next boot

----------

## ultraslacker

 *Quote:*   

>  Option "MinSpeed" "0 .06"
> 
> Option "MaxSpeed" "0 .18" 
> 
> Option "CircularScrolling" "1"
> ...

 

There shouldn't be a space before the decimals.

----------

## xchric

Has someone got the built-in mic work?

no idea how to configure the mic.

----------

## ultraslacker

Mic works - I've used it with alsa 1.0.8 (in 2.6) and 1.0.9rc.  Once I got the sound working it didn't require any special effort.

Check that you have the mic volume up and unmuted in alsamixer.

----------

## xchric

I have tried

and it works

perfect!!  :Very Happy: 

----------

## xchric

I failed on the Fn+F3

I followed exactly the steps including creating sh scripts in /etc/acpi/events /actions

But when I hit Fn+F3, nothing happen

I did check the /var/log/acpi and the Fn+F3 was recognized

----------

## Sm1

Check the way you have it setup:

Your /etc/acpi/events/default should point to wthe scipt that you want to handle all these interactions.  In my case 

```
action=/etc/acpi/tp.sh %e

```

And then I place all my actions in tp.sh

----------

## rapolder

Hi,

I'm using software suspend 2 on my thinkpad

hibernating to disk works fine.

but hibernating to ram doesnt work.

after "echo 3 > /proc/acpi/sleep" it goes to sleep.

I can then see the led of the moon.

but how can I awake from sleep? after pressing the powerbutton i.e. the notebook boots as usual

thanks

----------

## Sm1

You have to press the "fn" to wake up

----------

## rapolder

in this case it starts a usual boot as well !?

----------

## Earthwings

IIRC the default /etc/acpi/defaults.sh from acpid shuts down the computer when the "button/power" event is recognized which happens when you press the power button  :Wink:  Just comment that line in there. Btw. it's better to use sys-power/hibernate-script to activate the different sleep modes instead of directly echoing numbers to /sys/... or /proc/...

----------

## Sm1

Earthwings, 

there is a problem using fglrx as i mentioned earlier in this post.  You have to use another means to go into s3 or s5, and that solution has to include vbetools and switching vt's.  Hibernate-script doesn't handle this (at least not by default).

----------

## Earthwings

Oh, sorry, I just read the last three posts or so  :Embarassed: 

----------

## rapolder

jep and hibernate-sleep leeds to the same problem

----------

## M4tteo

Thank you so much for you "fast howto" i configured my T43 without problems  :Wink: 

----------

## linpacman

Did anyone got the trackpoint driver from http://people.clarkson.edu/~evanchsa/ working?

I patched my gentoo-sources 2.6.11-r9 and recompiled the kernel without mistakes. But there is no module trackpoint.h, which would be loadable in xorg.conf. I think, this module must be in /usr/lib/modules/input/ but it isn't. I tried with psmouse as kernel module and fix in the kernel.

Has anyone an idea how to get the trackpoint driver working?

----------

## stormer

I bought this T42 about a month ago.  Compiled loads of stuff (not all because I was switching from Dell I6000 to this laptop) and never had any thermal troubles.  Since last week, my laptop is overheating at fullspeed of 1.7 GHz.  It shuts down on a critical temperature (between 90 and 95 C).  I juste can't find what's going wrong.  I made lots of tests, and find my cpu lot cooler with acpi disabled and lot more cooler with APM enable.  Switching from 600 Mhz (33%) on acpi to 1.7 cause my cpu to gain 16 degrees (43 -> 59) wich is not suppose to change while cpu runs idle calls.

Any idea, known story, solutions ?

thanks

----------

## Guglie

cb100: thanks for the howto, but I have some problems with some scripts

 *cb100 wrote:*   

> 
> 
> Lets define our actions for these events. First, create /etc/acpi/events/buttons:
> 
> ```
> ...

 

That doesn't work for me: that code exec the script /etc/acpi/actions/buttons_act.sh without arguments.

I've used %e to send the arguments and it works fine:

```

# Fn keys

event=ibm/hotkey.*

action=/etc/acpi/actions/buttons_act.sh %e
```

 *cb100 wrote:*   

> 
> 
> As you will have already seen, I'm not really a bash programmer. Especially the LCD switching will not work the way you will want it. Somehow the script should remember how often the button was pressed and appropriately use "off" or "on" as a parameter. If anyone could help me with this: Thank you!

 

I've done that:

buttons_act.sh

```

#!/bin/bash

case "$4" in

  "00001003") # Fn+F3

     FILE="/usr/local/light_state"

     

     if [ -f $FILE ] ;

     then

       STATE=`cat $FILE`

     else    

       echo 0 > $FILE

       STATE=0

     fi

     if [ "$STATE" = "0" ] ;

     then

       radeontool light on

       echo "1" > $FILE

     elif [ "$STATE" = "1" ] ;

     then

       radeontool light off

       echo "0" > $FILE

     fi

   ;;

   

   "00001004") # Fn+F4

       echo 3 > /proc/acpi/sleep

   ;;

esac
```

that's all (for the moment  :Laughing:  )

----------

## bllgtse

Hello, I tried this code to sleep, and as I read this thread before, i though it was efficient, but ... nope

```

    chvt 1

    vbetool vbestate save >/tmp/vbestate

    echo 3 > /proc/acpi/sleep

    vbetool post

    #modprobe fglrx

    vbetool vbestate restore </tmp/vbestate

    chvt 2

    rm -f /tmp/vbestate

```

and added this parameter to the kernel in grub.conf

```

    acpi_sleep=s3_bios

```

And I use fglrx module to have hardware acceleration

I can't set my laptop sleeping... It wakes up but not cleanly, i have to restart X

NB1: my ohci, uhci, ... are builtin the kernel, and i tried to remove fglrx before the sleep and reinsert it after but nothing changed

NB2: My ipw2100 driver seems to wake up cleanly (i kept it by mistake) but i prefer to remove it manually

----------

## icantux

This is all quite confusing...   :Shocked: 

I have a T42 and trying to get at least three functions working here that are important to me without addtional "customized" tweaking (see below): close-lid sleep, turn off LCD on fn-F3 and sleep (fn-F4). From what I gather here, the sleep function is a stickler; turn off LCD (fn-F3) will only work if acpi, ibm-acpi, and radeontools are installed (using emerge) and includes an additional script; close-lid sleep will only work with additional scripting as well as acpi-ibm-acpi, and radeontool installed.

The problem I find with all these posts (a personal comment, in no way demeaning to the authors) is that the scripts are all "customized" and will not work without additional "customized" tweaking to their individual systems. In a word: inconsistent. For instance, with all due respect, 

cb100's method is somewhat fubar-ed because of a) need to create various dir-ies and files as opposed to using the existing files in /etc/acpi and  b) a missing parameter in the script as Guglie pointed out as well as creating a bunch of new files and directories to handle a simple event (LCD turn off ... fn-F3). 

```

cb100's original code missing "%e" parameter for proper function

# Fn keys

event=ibm/hotkey.*

action=/etc/acpi/actions/buttons_act.sh  ("%e" missing to end this script line)

```

On the other hand, Guglie's proposed script will not help the average user because of some "customized tweaking" ... eg.

```

 !/bin/bash

case "$4" in

  "00001003") # Fn+F3

     FILE="/usr/local/light_state"     <---------- where does this come in ??? no such file on regular gentoo install!

     

     if [ -f $FILE ] ;

     then

       STATE=`cat $FILE`  ... etc... etc...

```

The third proposal made by Sm1 although provides a solution for the LCD turn-off feature (fn-F3) seems to make use of "vbetools" for other functions and due to which the functions may or may not work depending on additional enabled features or installed drivers (fglrx, for instance).

This isn't a rant on anyone's attempt to get the IBM Thinkpad functions to work as, of course, there will be individual attempts to make these work. However, are there any clear set of instructions (foolproof) that exist for gentoo users to activate these functions in such a way that would work on any Thinkpad without "customized tweaking" as seen above?

... if nothing exists, I'll write up a set of instructions for the un-initiated to at least allow the general user to make use of those functions that actually do work without software/driver conflict . A big thanks goes out to all those here that added their voice in an attempt to make these functions work.

//alsac

----------

## 21582

 *alsac wrote:*   

> 
> 
> cb100's method is somewhat fubar-ed because of a) need to create various dir-ies and files as opposed to using the existing files in /etc/acpi and  b) a missing parameter in the script as Guglie pointed out as well as creating a bunch of new files and directories to handle a simple event (LCD turn off ... fn-F3). 
> 
> 

 

Thank you  :Wink: 

But to get ibm_acpi working, I just added two custom files (encapsulation!) in order to properly handle and forward the ACPI events.

We all just posted our personal fixes, hoping to help people out there looking for some hints.

So -  I fully agree with you.

Our way of making the functions of our T42's work properly with Gentoo are solution attempts, no more, no less.

So if you find a better way (=minimal adjustments from portage installed packages) I'm sure everyone will appreciate it.Last edited by 21582 on Tue Oct 18, 2005 11:43 am; edited 1 time in total

----------

## Guglie

 *alsac wrote:*   

> FILE="/usr/local/light_state"     <---------- where does this come in ??? no such file on regular gentoo install!

 

That is true: when the script run for the first time the script create this wile (a better solution could be use a file in  the home directory of the user or to store the variable in the RAM)

 *alsac wrote:*   

> The problem I find with all these posts (a personal comment, in no way demeaning to the authors) is that the scripts are all "customized" and will not work without additional "customized" tweaking to their individual systems.

 

Eheh, I know that I'm not a professional developer  :Smile:  : I wrote my script to fix my problem and I posted it on this forum: if somebody find it usefull he can use or work on it.

Unfortunally the Thinkpads works very good with the Windows XP patched by IBM: if a person will use another OS he should know that it is not a simple thing.  

 *cb100 wrote:*   

> So if you find a better way (=minimal adjustments from portage installed packages) I'm sure everyone will appreciate it.

 

That is sure   :Wink: 

----------

## herrzattacke

I use this... and it works quite well.

```

 # F3 - turn off lcd

                                        00001003) 

                  /usr/bin/radeontool light |grep off  1>&2 && /usr/bin/radeontool light on || /usr/bin/radeontool light off

               ;;

```

----------

## anggarda

Hiello fellow t42 users. 

Hope this helps someone, I had a horrid time getting my soundcard to work using alsa. 

After much much scouring, the sound problem were due to incorrect settings in the mixer. 

I sorta enable    

 *  Headphone Jack Sense

 * Line Jack Sense

Please, please, please disable both options to have sound. 

Salut.

----------

## ~L~

 *Sm1 wrote:*   

> 
> 
> The other thing I do is enable those little keys above the arrows.  These are back and forward for me in firefox.  Use keyconfig to remap keys in firefox
> 
> ```
> ...

 

I recently bought a T42 and I'm slowly trying to get things to work...

Does anyone know how I could change these buttons to scrolling function of the mouse. I absolutely need the middle button, so I don't like to use trackpoint for this.  Google didn't get me anywhere...

thanks for a lot for all the tips  :Very Happy: 

----------

## ~L~

Nevermind...

I changed to synaptics and the touchpad scrolling is ok for me.

 *blais wrote:*   

> 
> 
>    If I start X without the USB mouse, and then I plug in the USB mouse, X does
> 
>    not realize that the mouse appeared and I cannot use it.  I need to log out
> ...

 

Does anyone know a solution for this problem?

EDIT:

I had to point the device to /dev/input/mice and not /dev/input/mouse2.Last edited by ~L~ on Wed Nov 23, 2005 12:11 pm; edited 1 time in total

----------

## seringen

anyone tried the latest ati-drivers that supposedly work with suspension?

----------

## misto

 *seringen wrote:*   

> anyone tried the latest ati-drivers that supposedly work with suspension?

 

Yes, thats right, they finally work with standby  :Smile: 

----------

## krizz

Hello there, another T42 owner here (I don't 0wn it yet though  :Smile:  ),

I have been screwing around with hibernation for a while now...and I have some problems with hibernate-ram under X.org.

I started with a clean gentoo installation, installed X.org and used the ati-drivers as display drivers. I did the xorg.conf configuration with fglrxconfig. I use VESA-tng as a framebuffer driver, they work nice together, no problems when switching forth and back to X from the framebuffer console.

After that, I did the gentoo tutorial about powermanagement: http://www.gentoo.org/doc/en/power-management-guide.xml

Frequency scaling and the battery runlevel worked right away, blanking the screen under X.org did NOT. I have troubles with hibernate-ram too. I got hibernate-ram to work from the framebuffer console, but not in X.org.

Here's what I've did:

I have the 'sleep states' option for ACPI compiled in:

```
grep "SLEEP" /usr/src/linux/.config

CONFIG_ACPI_SLEEP=y
```

I have hibernate-script and vbetool installed:

```
emerge -p hibernate-script vbetool

These are the packages that I would merge, in order:

Calculating dependencies   ...done!

[ebuild   R   ] sys-power/hibernate-script-1.12

[ebuild   R   ] sys-apps/vbetool-0.3
```

Then I had to fiddle around with /etc/hibernate/ram.conf before I could get it to work from framebuffer console. Here's my /etc/hibernate/ram.conf (commented lines left out):

```
UseSysfsPowerState mem

Verbosity 0

LogFile /var/log/hibernate.log

LogVerbosity 1

Distribution gentoo

XDisplay :0

SaveClock restore-only

IbmAcpi yes

RadeonTool yes

UnloadBlacklistedModules yes

LoadModules auto

GentooModulesAutoload yes

EnableVbetool yes

VbetoolPost yes
```

I have several kernel parts compiled as modules (command invoked under X):

```
lsmod

Module                  Size  Used by

fglrx                 429312  9

button                  4880  0

psmouse                36484  0

usbhid                 29124  0

yenta_socket           24588  0

rsrc_nonstatic         12032  1 yenta_socket

pcmcia_core            36176  2 yenta_socket,rsrc_nonstatic

ehci_hcd               30728  0

uhci_hcd               30928  0

usbcore               109696  4 usbhid,ehci_hcd,uhci_hcd

vfat                   11200  1

cpufreq_performance     1664  1

cpufreq_conservative     6308  0

cpufreq_ondemand        5340  0

cpufreq_powersave       1472  0

acpi_cpufreq            5192  1

ibm_acpi               24192  0

ati_agp                 6732  0

agpgart                29512  2 fglrx,ati_agp

firmware_class          8000  0

video                  13892  0

thermal                10504  0

processor              18684  2 acpi_cpufreq,thermal

battery                 7556  0

ac                      3332  0

e1000                 103156  0

rtc                    10808  0

```

In /boot/grub/grub.conf I have the kernel parameter acpi_sleep=s3_bios.

When I hibernate-ram/resume under framebuffer-console (VESA-tng), everything is fine. When I hibernate under X.org, the hibernation is ok, but at the resume a problem comes up. On resume everything is loaded; even X.org comes back with the right screen and the system seems to be stable, but when I try to scroll a webpage or move a window, it gets f'cked up (window borders are not redrawn etc.), here's an impression:

http://i5.photobucket.com/albums/y189/krizzzz/fglrx_fckedup.jpg

And then after a while it just hangs (if I don't restart X.org).

I'm very sure It's the ati-drivers because If I do a kernel-recompile and 'forget' to re-emerge the ati-drivers package, resume works ok.

I also tried to compile-in the modules that are on the /etc/hibernate/blacklisted-modules but that didn't help.

Here's some further info:

```
uname -a

Linux tornado 2.6.14-gentoo-r2 #1 PREEMPT Tue Nov 22 11:21:46 CET 2005 i686 Intel(R) Pentium(R) M processor 1.70GHz GenuineIntel GNU/Linux
```

```
flgrxinfo

display: :0.0  screen: 0

OpenGL vendor string: ATI Technologies Inc.

OpenGL renderer string: MOBILITY RADEON 9600 Generic

OpenGL version string: 1.3.5461 (X4.3.0-8.19.10)
```

```
tail /var/log/hibernate.log

Starting suspend at Tue Nov 22 11:59:27 CET 2005

hibernate-ram: [01] Executing CheckLastResume ... 

hibernate-ram: [01] Executing LockFileGet ... 

hibernate-ram: [01] Executing NewKernelFileCheck ... 

hibernate-ram: [10] Executing EnsureSysfsPowerStateCapable ... 

hibernate-ram: [11] Executing XHacksSuspendHook1 ... 

hibernate-ram: [12] Executing IbmAcpiStartSuspend ... 

hibernate-ram: [89] Executing SaveKernelModprobe ... 

hibernate-ram: [91] Executing ModulesUnloadBlacklist ... 

hibernate-ram: [95] Executing XHacksSuspendHook2 ... 

hibernate-ram: [97] Executing VbetoolSaveState ... 

[H[Jhibernate-ram: [98] Executing RadeonToolBacklightOff ... 

hibernate-ram: [99] Executing DoSysfsPowerStateSuspend ... 

hibernate-ram: Activating sysfs power state mem ...

hibernate-ram: [98] Executing RadeonToolBacklightOn ... 

hibernate-ram: [97] Executing VbetoolRestoreState ... 

hibernate-ram: [91] Executing GentooModulesAutoload ... 

Loading modules listed /etc/modules.autoload.d/kernel-2.6

Loading rtc

Loading e1000

Loading ac

Loading battery

Loading button

Loading thermal

Loading video

Loading firmware_class

Loading agpgart

Loading ati-agp

Loading ibm_acpi

Loading acpi_cpufreq

Loading cpufreq_powersave

Loading cpufreq_ondemand

Loading cpufreq_conservative

Loading cpufreq_performance

hibernate-ram: [90] Executing ModulesLoad ... 

hibernate-ram: [89] Executing RestoreKernelModprobe ... 

hibernate-ram: [85] Executing XHacksResumeHook2 ... 

hibernate-ram: [70] Executing ClockRestore ... 

hibernate-ram: [12] Executing IbmAcpiEndResume ... 

hibernate-ram: [11] Executing XHacksResumeHook1 ... 

hibernate-ram: [01] Executing NoteLastResume ... 

hibernate-ram: [01] Executing LockFilePut ... 

Resumed at Tue Nov 22 12:59:45 CET 2005
```

No strange things in /var/log/Xorg.0.log, /var/log/acpid or /var/log/messages.

My gentoo-installation is only two weeks old.

Can somebody help me?

----------

## NewB

if you are interested in the tv-out here is how i got it to work:

start the X-server like this :

```
startx -- -layout tv
```

with official ati drivers and this xorg config:

```

Section "ServerLayout"

   Identifier     "single"

   Screen         "fglLCD" 0 0

   InputDevice    "TP Keyboard"

   InputDevice    "UltraNav" "CorePointer"

   InputDevice    "usbmouse"

EndSection

Section "ServerLayout"

        Identifier     "tv"

        Screen         "fglTV" 0 0

        Screen         "fglLCD" RightOf "fglTV"

        InputDevice    "TP Keyboard"

        InputDevice    "UltraNav" "CorePointer"

        InputDevice    "usbmouse"

        Option         "Xinerama" "false"

EndSection

Section "ServerLayout"

   Identifier     "CRT"

   Screen         "fglLCD_crt" 0 0

   Screen         "fglLCD" LeftOf "fglLCD_crt"

   InputDevice    "TP Keyboard"

   InputDevice    "UltraNav" "CorePointer"

   InputDevice    "usbmouse"

   Option          "Xinerama" "false"

EndSection

Section "Files"

    FontPath   "/usr/share/fonts/ttf-bitstream-vera/"

    FontPath   "/usr/share/fonts/terminus/"

    FontPath   "/usr/share/fonts/corefonts/"

    FontPath   "/usr/share/fonts/freefont/"

    FontPath   "/usr/share/fonts/artwiz/"

    FontPath   "/usr/share/fonts/misc/"

    FontPath   "/usr/share/fonts/75dpi/:unscaled"

    FontPath   "/usr/share/fonts/100dpi/:unscaled"

    FontPath   "/usr/share/fonts/encodings/"

    FontPath   "/usr/share/fonts/TTF/"

    FontPath   "/usr/share/fonts/sharefont/"

    FontPath   "/usr/share/fonts/lfp-fix/"

    FontPath   "/usr/share/fonts/75dpi/"

    FontPath   "/usr/share/fonts/100dpi/"

    FontPath   "/usr/share/fonts/unifont/"

    FontPath   "/usr/share/fonts/ttf/ja/aqua"

    FontPath   "/usr/share/fonts/sharefont"

    RgbPath   "/usr/lib/X11/rgb"

    FontPath    "/usr/share/fonts/truetypes"

EndSection

Section "Module"

   Load        "ddc"

   Load        "GLcore"

   Load        "bitmap"

   Load        "dbe"

   Load        "extmod"

   SubSection "extmod"

      #Option   "omit xfree86-dga"

   EndSubSection

   Load        "glx"

   Load        "record"

   Load        "freetype"

   Load        "v4l"

   Load        "ddc"

   Load        "dri"

   Load        "speedo"

   Load        "type1"

   Load        "synaptics"

   Load        "record"

EndSection

Section "InputDevice"

   Identifier     "TP Keyboard"

   Driver         "kbd"

   Option          "CoreKeyboard"

   Option          "XkbModel" "pc105"

   Option          "XkbLayout" "fr_CH"

EndSection

#Section "Extensions"

#       Option      "Composite"   "Enable"

#   Option      "RENDER"   "true"

#EndSection

Section "InputDevice"

   Identifier     "UltraNav"

   Driver         "synaptics"

   Option          "CorePointer"

   Option          "Device" "/dev/psaux"

   Option          "Protocol" "auto-dev"

   Option          "LeftEdge" "1900"

   Option          "RightEdge" "5400"

   Option          "TopEdge" "1900"

   Option          "BottomEdge" "4000"

   Option          "FingerLow" "25"

   Option          "FingerHigh" "30"

   Option          "MaxTapTime" "180"

   Option          "MaxTapMove" "220"

   Option          "VertScrollDelta" "100"

   Option          "MinSpeed" "0.06"

   Option          "MaxSpeed" "0.18"

   Option         "AccelFactor" "0.0010"

   Option          "SHMConfig" "on"

#     Option         "Repeater"      "/dev/ps2mouse"

EndSection

Section "InputDevice"

   Identifier     "usbmouse"

   Driver         "mouse"

   Option          "SendCoreEvents" "true"

   Option          "Device" "/dev/input/mice"

   Option          "Protocol" "ImPS/2"

   Option          "ZAxisMapping" "4 5"

EndSection

Section "Monitor"

   #HorizSync   28-50

   #VertRefresh   60 #43-75

   Identifier   "TP LCD"

   Option           "DPMS"

EndSection

Section "Monitor"

   Identifier      "External Monitor"

#   HorizSync   30.0-96.0

#   VertRefresh   48.0-120.0

   Option           "DPMS"

EndSection

Section "Monitor"

   Identifier      "Television"

   HorizSync   30-60

   VertRefresh   50-70

   Option          "DPMS"

EndSection

Section "Device"

    Identifier                          "fgl0"

    Driver                              "fglrx"

    Option "MonitorLayout"              "LVDS, NONE" #STV"

    Option "IgnoreEDID"                 "off"

    Option "ScreenOverlap"              "0"

# === FSAA Management ===

    Option "TVStandard"                 "PAL-D"

    Option "TVHSizeAdj"                 "30"

    Option "FSAAEnable"                 "no"

    Option "FSAAScale"                  "0"

    Option "FSAADisableGamma"           "no"

    Option "FSAACustomizeMSPos"         "no"

    Option "FSAAMSPosX0"                "0.000000"

    Option "FSAAMSPosY0"                "0.000000"

    Option "FSAAMSPosX1"                "0.000000"

    Option "FSAAMSPosY1"                "0.000000"

    Option "FSAAMSPosX2"                "0.000000"

    Option "FSAAMSPosY2"                "0.000000"

    Option "FSAAMSPosX3"                "0.000000"

    Option "FSAAMSPosY3"                "0.000000"

    Option "FSAAMSPosX4"                "0.000000"

    Option "FSAAMSPosY4"                "0.000000"

    Option "FSAAMSPosX5"                "0.000000"

    Option "FSAAMSPosY5"                "0.000000"

# === Misc Options ===

    Option "Video Overlay"              "on"

    Option "PseudoColorVisuals"         "off"

    Option "UseFastTLS"                 "2"

    Option "BlockSignalsOnLock"         "on"

    Option "UseInternalAGPGART"         "yes"

    Option "ForceGenericCPU"            "no"

    Option "NvAGP"         "1"

    Option "AGPMode"         "4"

    Option "EneblePageFlip"      "True"

    Option "IgnoreEDID"         "off"

    Option "backingstore"               "true"

    BusID "PCI:1:0:0"    # vendor=1002, device=4c66

    Screen 0

EndSection

Section "Device"

    Identifier                          "fgl0_crt"

    Driver                              "fglrx"

    Option "MonitorLayout"              "LVDS, CRT" #STV"

    Option "IgnoreEDID"                 "off"

    Option "TVStandard"                 "PAL-D"

    Option "TVHSizeAdj"                 "30"

    Option "HSync2"                     "30.0-96.0"

    Option "VRefresh2"                  "48.0-120.0"

    Option "ScreenOverlap"              "0"

# === FSAA Management ===

    Option "FSAAEnable"                 "no"

    Option "FSAAScale"                  "0"

    Option "FSAADisableGamma"           "no"

    Option "FSAACustomizeMSPos"         "no"

    Option "FSAAMSPosX0"                "0.000000"

    Option "FSAAMSPosY0"                "0.000000"

    Option "FSAAMSPosX1"                "0.000000"

    Option "FSAAMSPosY1"                "0.000000"

    Option "FSAAMSPosX2"                "0.000000"

    Option "FSAAMSPosY2"                "0.000000"

    Option "FSAAMSPosX3"                "0.000000"

    Option "FSAAMSPosY3"                "0.000000"

    Option "FSAAMSPosX4"                "0.000000"

    Option "FSAAMSPosY4"                "0.000000"

    Option "FSAAMSPosX5"                "0.000000"

    Option "FSAAMSPosY5"                "0.000000"

# === Misc Options ===

Option "Video Overlay"              "on"

    Option "PseudoColorVisuals"         "off"

    Option "UseFastTLS"                 "2"

    Option "BlockSignalsOnLock"         "on"

    Option "UseInternalAGPGART"         "yes"

    Option "ForceGenericCPU"            "no"

    Option "AGPMode"                    "4"

    Option "EneblePageFlip"             "True"

    Option "IgnoreEDID"                 "off"

    Option "backingstore"               "true"

    BusID "PCI:1:0:0"    # vendor=1002, device=4c66

    Screen 1

EndSection

Section "Device"

    Identifier                          "fgl1"

    Driver                              "fglrx"

    Option "IgnoreEDID"                 "off"

    Option "ScreenOverlap"              "0"

# === TV Options ===

    Option "NoTV"                       "no"

    Option "TVStandard"                 "PAL-D"

    Option "TVHSizeAdj"                 "30"

    Option "TVVSizeAdj"                 "0"

    Option "TVHPosAdj"                  "0"

    Option "TVVPosAdj"                  "0"

    Option "TVHStartAdj"                "0"

    Option "TVColorAdj"                 "0"     

    Option "GammaCorrectionI"           "0x06419064"

    Option "GammaCorrectionII"          "0x06419064"

# === FSAA Management ===

Option "Video Overlay"              "on"

    Option "PseudoColorVisuals"         "off"

    Option "FSAAEnable"                 "no"

    Option "FSAAScale"                  "0"

    Option "FSAADisableGamma"           "no"

    Option "FSAACustomizeMSPos"         "no"

    Option "FSAAMSPosX0"                "0.000000"

    Option "FSAAMSPosY0"                "0.000000"

    Option "FSAAMSPosX1"                "0.000000"

    Option "FSAAMSPosY1"                "0.000000"

    Option "FSAAMSPosX2"                "0.000000"

    Option "FSAAMSPosY2"                "0.000000"

    Option "FSAAMSPosX3"                "0.000000"

    Option "FSAAMSPosY3"                "0.000000"

    Option "FSAAMSPosX4"                "0.000000"

    Option "FSAAMSPosY4"                "0.000000"

    Option "FSAAMSPosX5"                "0.000000"

    Option "FSAAMSPosY5"                "0.000000"

# === Misc Options ===

    Option "UseFastTLS"                 "2"

    Option "BlockSignalsOnLock"         "on"

    Option "UseInternalAGPGART"         "yes"

    Option "ForceGenericCPU"            "no"

    Option "NvAGP"                      "1"

    Option "AGPMode"                    "4"

    Option "EneblePageFlip"             "True"

    Option "IgnoreEDID"                 "off"

    Option "backingstore"               "true"

    BusID "PCI:1:0:0"    # vendor=1002, device=4c66

    Screen 1

EndSection

Section "Screen"

   Identifier "fglLCD"

   Device     "fgl0"

   Monitor    "TP LCD"

   DefaultDepth     24

   SubSection "Display"

      Depth     24

      Modes    "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"

   EndSubSection

EndSection

Section "Screen"

   Identifier "fglLCD_crt"

   Device     "fgl0_crt"

   Monitor    "External Monitor"

   DefaultDepth     24

   SubSection "Display"

      Depth     24

      Modes    "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"

   EndSubSection

EndSection

Section "Screen"

   Identifier "fglTV"

   Device     "fgl1"

   Monitor    "Television"

   DefaultDepth     24

   SubSection "Display"

      Depth     24

      Modes     "640x480"

   EndSubSection

EndSection

Section "DRI"

   Mode         0666

EndSection

```

----------

## R!tman

Hi all,

yesterday I started installing Gentoo on my new T43p. I am very happy with it so far, but I am stuck at a strange power management thing. I followed this guide and got most of it to work.

The problems I have are related to frequency sccaling. cpufreqd is started in both runlevels, battery and default, as you can see.

```
Runlevel: battery

 xdm                                                                                     [ started ]

 sshd                                                                                    [ started ]

 acpid                                                                                   [ started ]

 local                                                                                   [ started ]

 vixie-cron                                                                              [ started ]

 syslog-ng                                                                               [ started ]

 net.eth0                                                                                [ started ]

 netmount                                                                                [ started ]

 cpufreqd                                                                                [ started ]

 lcd-brightness                                                                            [   off ]

Runlevel: default

 xdm                                                                                     [ started ]

 sshd                                                                                    [ started ]

 acpid                                                                                   [ started ]

 local                                                                                   [ started ]

 vixie-cron                                                                              [ started ]

 syslog-ng                                                                               [ started ]

 net.eth0                                                                                [ started ]

 netmount                                                                                [ started ]

 cpufreqd                                                                                [ started ]
```

The runlevels do not differ except for lcd-brightness:

```
diff /etc/runlevels/default/ /etc/runlevels/battery/

Only in /etc/runlevels/battery/: lcd-brightness
```

If I start the computer in battery mode or ac mode, cpufreqd is started at startup. But it only seems to work in ac mode.

Starting the computer in ac mode gives me a reduced frequency with

```
watch grep \"cpu MHz\" /proc/cpuinfo
```

but starting the computer in battery does not show a decreased frequency.

Any help is greatly appreciated  :Wink: .

R!tman

EDIT: I took the part about cpufreq-set out, as it does work. User error  :Wink: !

Only cpufreqd does not seem to work in battery mode.

----------

## R!tman

Hmm...

it seems to have been the /etc/cpufreqd.conf given in the HOWTO. With the one that comes with the ebuild it works (better). I will have to fine tune it.

EDIT: The reason was that somehow always the rule "battery_low" was used, although I was at 97% capacity. 

I have not yet solved this, but I am using ondemand for all battery things now.

----------

## Bryan.Rank

Kriz I think I got this one nailed, as sleep to RAM finally works on my T42p.  My problem was just like yours and I was pulling my hair out.  I was doing a couple things wrong.  First was auto-loading the agpgart module (I think it might said to do exlicitly put agpart in autoload.d in the gentoo ati HOWTO, but if you read the realease notes on the ATI web pages  https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/linux_8.20.8.html buried down deep it tells you not to do this and that the fglrx module will not work correctly if the agpgart module is loaded.  Funny thing when I had it loaded, there were no errors in any logs, everything "looked" fine.  

Anyhow here is my autoload config for the IBM Laptop... (/etc/modules.autoload.d/kernel-2.6)

 *Quote:*   

> 
> 
> # madwifi stuff so wireless LAN will work
> 
> ath_hal
> ...

 

The other really brain dead thing I was doing was using the wrong agp chipset support.  I had ATI chipset configured as a module, when the T42p really uses the intel AGP chipset (even though it has an ATI video card).  Below is what my kernel config looks like now.

```

Devices->

  CharacterDevices->

   <M> /dev/agpgart (AGP Support) 

   < >   ALI chipset support

   < >   ATI chipset support

   < >   AMD Irongate, 761, and 762 chipset support

   < >   AMD Opteron/Athlon64 on-CPU GART support

 <M>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support 

```

Hope this helps.

BryanLast edited by Bryan.Rank on Sat Jan 07, 2006 6:16 am; edited 1 time in total

----------

## narcis

Can I somehow enable the trackpoint, but disable the touchpad in X, or vice versa?

Thanks for the nice howto, I'll have a try at it later...

----------

## pcsabi

 *krizz wrote:*   

> 
> 
> When I hibernate-ram/resume under framebuffer-console (VESA-tng), everything is fine. When I hibernate under X.org, the hibernation is ok, but at the resume a problem comes up. On resume everything is loaded; even X.org comes back with the right screen and the system seems to be stable, but when I try to scroll a webpage or move a window, it gets f'cked up (window borders are not redrawn etc.), here's an impression:
> 
> 

 

Hi krizz,

Do you have a solution ?

I have the same problem. The strange thing that the Xorg restart is not needed, it is enough to restart X session. ( After login the same X server is running without any problem... )

Thanks,

----------

## Life is a Bug

Thanks for this great post. It helped me a lot so far.

Anyway i am stuck at one point at the moment. I cant get tpb to work

I emerged tpb

```
 USE="xosd" emerge tpb
```

and then i changed the tpb config to my needs

```
gedit /etc/tpbrc
```

i also enabled /dev/nvram in kernel and recompiled it

now when i start tpb and press some buttons nothing happens

```
tpb -d
```

in the tpbrc i told tpb to execute  a shell script when i press the ibm button but that doesnt seem to work

for testing i tried:

```
tpb -- daemon -- verbose --osd=ON --thinkpad="echo 'pressed'"
```

and again i dont get any output when i press that button

Can anybody help me please?  :Smile: 

Thanks

----------

## R!tman

 *Life is a Bug wrote:*   

> Thanks for this great post. It helped me a lot so far.
> 
> Anyway i am stuck at one point at the moment. I cant get tpb to work
> 
> I emerged tpb
> ...

 

Does anything happen when you execute tpb as root?

----------

## Life is a Bug

 *R!tman wrote:*   

>  *Life is a Bug wrote:*   Thanks for this great post. It helped me a lot so far.
> 
> Anyway i am stuck at one point at the moment. I cant get tpb to work
> 
> I emerged tpb
> ...

 

No, i didnt even test it yet as a non-root user

edit: by the way I am using a T40 but that shouldnt make any difference since it is also supported by tpb (refering to the tpb homepage)

----------

## astrodelgato

I've installed the synaptics driver, but I can get the motion on the touchpad to work. The buttons work fine. TrackPoint also works fine.

```
> cat /proc/bus/input/devices

I: Bus=0011 Vendor=0001 Product=0001 Version=ab54

N: Name="AT Translated Set 2 keyboard"

P: Phys=isa0060/serio0/input0

S: Sysfs=/class/input/input0

H: Handlers=kbd event0 

B: EV=120013

B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe

B: MSC=10

B: LED=7

I: Bus=0011 Vendor=0002 Product=0007 Version=0000

N: Name="SynPS/2 Synaptics TouchPad"

P: Phys=isa0060/serio1/input0

S: Sysfs=/class/input/input1

H: Handlers=mouse0 event1 

B: EV=b

B: KEY=6420 0 70000 0 0 0 0 0 0 0 0

B: ABS=11000003

I: Bus=0000 Vendor=0000 Product=0000 Version=0000

N: Name="hdaps"

P: Phys=

S: Sysfs=/class/input/input2

H: Handlers=js0 event2 

B: EV=9

B: ABS=3

I: Bus=0011 Vendor=0002 Product=000a Version=0000

N: Name="TPPS/2 IBM TrackPoint"

P: Phys=synaptics-pt/serio0/input0

S: Sysfs=/class/input/input3

H: Handlers=mouse1 event3 

B: EV=7

B: KEY=70000 0 0 0 0 0 0 0 0

B: REL=3
```

relevant bits of xorg.conf:

```
Section "Module"

        Load    "record"

        Load    "extmod"

        Load    "dbe"

        Load    "dri"

        Load    "radeon"

        Load    "glx"

        Load    "xtrap"

        Load    "type1"

        Load    "freetype"

        Load    "synaptics"

EndSection

Section "InputDevice"

    Identifier    "Mouse1"

    Driver      "mouse"

    Option      "Protocol"      "auto"

    Option      "Device"        "/dev/input/mice"

    Option  "ZAxisMapping"  "4 5"

EndSection

Section "InputDevice"

Identifier "Touchpad"

Driver "synaptics"

#Option "SendCoreEvents"

Option "CorePointer"

Option "Device" "/dev/input/mouse0"

Option "Protocol" "auto-dev"

# Next line required only if you want to disable the mousepad while typing:

Option "SHMConfig" "on"

# The rest of the options are NOT required, just a default similar to the

# Windows drivers with non of the extra features.

Option "LeftEdge" "1900"

Option "RightEdge" "5400"

Option "TopEdge" "1400"

Option "BottomEdge" "4500"

Option "FingerLow" "25"

Option "FingerHigh" "30"

Option "MaxTapTime" "180"

Option "MaxTapMove" "220"

Option "MaxDoubleTapTime" "180"

Option "ClickTime" "100"

Option "FastTaps" "0"

Option "EmulateMidButtonTime" "75"

Option "VertScrollDelta" "0"

Option "HorizScrollDelta" "0"

Option "MinSpeed" "0 .06"

Option "MaxSpeed" "0 .18"

Option "AccelFactor" "0 .001"

Option "EdgeMotionMinZ" "30"

Option "EdgeMotionMaxZ" "160"

Option "EdgeMotionMinSpeed" "1"

Option "EdgeMotionMaxSpeed" "400"

Option "EdgeMotionUseAlways" "0"

Option "UpDownScrolling" "1"

Option "TouchpadOff" "off"

Option "GuestMouseOff" "0"

Option "LockedDrags" "0"

Option "RTCornerButton" "2"

Option "RBCornerButton" "3"

Option "LTCornerButton" "0"

Option "LBCornerButton" "0"

Option "TapButton1" "1"

Option "TapButton2" "2"

Option "TapButton3" "3"

Option "CircularScrolling" "1"

Option "CircScrollDelta" "0 .195"

Option "CircScrollTrigger" "0"

Option "CircularPad" "0"

Option "PalmDetect" "1"

Option "PalmMinWidth" "10"

Option "PalmMinZ" "200"

Option "CoastingSpeed" "0"

EndSection

Section "ServerLayout"

    Identifier  "Main Layout"

    Screen      "Screen 1"

    InputDevice "Mouse1" "CorePointer"

    InputDevice "Touchpad" "AlwaysCore"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection
```

----------

## El Tazar

Changing 

```
Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

        Option      "XkbModel" "pc89"

EndSection
```

to:

```
Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

        Option      "XkbModel" "microsoftinet"

EndSection
```

Will make X recognise the keypresses from the Thinkpad Forward and Backward buttons as XF86Forward and XF86Back respectively. This is done natively without the use of tpb. Only problem is that you now have the "M" word in your config file  :Wink: 

Really nice for controlling a music player or going between virtual desktops.

----------

## El Tazar

My serverlayout for having the touchpad working is as follows

```
Section "ServerLayout"

    Identifier  "Server Layout"

    Screen      "Screen0"

    InputDevice "Touchpad" "CorePointer"

    InputDevice "Trackpoint" "CorePointer"

    InputDevice "External"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection
```

astrodelgato -> wouldn't this option

```
Option "TouchpadOff" "off" 
```

do what it says, ie. turn the touchpad off thus explaining your problems?

----------

## astrodelgato

 *Quote:*   

> astrodelgato -> wouldn't this option
> 
> Code:
> 
> Option "TouchpadOff" "off"
> ...

 

I copied that option from one of the posts on the first page, but I think I mistakenly put "off" instead of "1". Changing that and also disabling that option doesn't seem to have any effect, though.

Per your config, I just changed my Touchpad to "CorePointer" instead of "AlwaysCore" and it worked...for a minute or so. I launched Firefox and then after that the Touchpad wouldn't respond any more. I tested this several more times and as soon as Firefox comes up, the cursor sticks.

----------

## El Tazar

Here's the full file then

```
# **********************************************************************

# DRI Section

# **********************************************************************

Section "dri"

# Access to OpenGL ICD is allowed for all users:

    Mode 0666

# Access to OpenGL ICD is restricted to a specific user group:

#    Group 100    # users

#    Mode 0660

EndSection

# **********************************************************************

# Module section -- this  section  is used to specify

# which dynamically loadable modules to load.

# **********************************************************************

#

Section "Module"

    Load        "dbe"     # Double buffer extension

    Load "synaptics"

# This loads the miscellaneous extensions module, and disables

# initialisation of the XFree86-DGA extension within that module.

    SubSection  "extmod"

      Option    "omit xfree86-dga"   # don't initialise the DGA extension

    EndSubSection

# This loads the Type1 and FreeType font modules

    Load        "type1"

    Load        "freetype"

# This loads the GLX module

    Load        "glx"   # libglx.a

    Load        "dri"   # libdri.a

EndSection

# **********************************************************************

# Files section.  This allows default font and rgb paths to be set

# **********************************************************************

Section "Files"

# The location of the RGB database.  Note, this is the name of the

# file minus the extension (like ".txt" or ".db").  There is normally

# no need to change the default.

    RgbPath   "/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (which are concatenated together),

# as well as specifying multiple comma-separated entries in one FontPath

# command (or a combination of both methods)

# 

# If you don't have a floating point coprocessor and emacs, Mosaic or other

# programs take long to start up, try moving the Type1 and Speedo directory

# to the end of this list (or comment them out).

# 

   FontPath    "/usr/share/fonts/misc:unscaled"

   FontPath    "/usr/share/fonts/Type1"

   #FontPath    "/usr/share/fonts/X"

   FontPath    "/usr/share/fonts/TTF"

   FontPath    "/usr/share/fonts/corefonts"

   FontPath    "/usr/share/fonts/freefont"

   FontPath    "/usr/share/fonts/sharefonts"

   FontPath    "/usr/share/fonts/terminus"

   FontPath    "/usr/share/fonts/ttf-bitstream-vera"

   #FontPath    "/usr/share/fonts/unifont"

   FontPath    "/usr/share/fonts/75dpi:unscaled"

   FontPath    "/usr/share/fonts/100dpi:unscaled"

   FontPath    "/usr/share/fonts/artwiz"

   FontPath    "/opt/Mathematica5.0/SystemFiles/Fonts/Type1"

   FontPath    "/opt/Mathematica5.0/SystemFiles/Fonts/Common/Type1:unscaled"

   FontPath    "/opt/Mathematica5.0/SystemFiles/Fonts/AFM:unscaled"

   FontPath    "/opt/Mathematica5.0/SystemFiles/Fonts/BDF:unscaled" 

   FontPath     "/usr/share/fonts/misc/"

   FontPath     "/usr/share/fonts/CID/"

   FontPath      "/usr/share/fonts/Speedo/"

# The module search path.  The default path is shown here.

#    ModulePath "/usr/X11R6/lib/modules"

EndSection

# **********************************************************************

# Server flags section.

# **********************************************************************

Section "ServerFlags"

# Uncomment this to cause a core dump at the spot where a signal is 

# received.  This may leave the console in an unusable state, but may

# provide a better stack trace in the core dump to aid in debugging

#    Option "NoTrapSignals"

# Uncomment this to disable the <Crtl><Alt><BS> server abort sequence

# This allows clients to receive this key event.

#    Option "DontZap"

# Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching

# sequences.  This allows clients to receive these key events.

#    Option "Dont Zoom"

# Uncomment this to disable tuning with the xvidtune client. With

# it the client can still run and fetch card and monitor attributes,

# but it will not be allowed to change them. If it tries it will

# receive a protocol error.

#    Option "DisableVidModeExtension"

# Uncomment this to enable the use of a non-local xvidtune client. 

#    Option "AllowNonLocalXvidtune"

# Uncomment this to disable dynamically modifying the input device

# (mouse and keyboard) settings. 

#    Option "DisableModInDev"

# Uncomment this to enable the use of a non-local client to

# change the keyboard or mouse settings (currently only xset).

#    Option "AllowNonLocalModInDev"

EndSection

# **********************************************************************

# Input devices

# **********************************************************************

# **********************************************************************

# Core keyboard's InputDevice section

# **********************************************************************

Section "InputDevice"

    Identifier   "Keyboard1"

    Driver   "kbd"

# For most OSs the protocol can be omitted (it defaults to "Standard").

# When using XQUEUE (only for SVR3 and SVR4, but not Solaris),

# uncomment the following line.

#    Option "Protocol"   "Xqueue"

    Option "AutoRepeat" "500 30"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))

#    Option "Xleds"      "1 2 3"

#    Option "LeftAlt"    "Meta"

#    Option "RightAlt"   "ModeShift"

# To customise the XKB settings to suit your keyboard, modify the

# lines below (which are the defaults).  For example, for a non-U.S.

# keyboard, you will probably want to use:

#    Option "XkbModel"   "pc102"

# If you have a US Microsoft Natural keyboard, you can use:

#    Option "XkbModel"   "microsoft"

#

# Then to change the language, change the Layout setting.

# For example, a german layout can be obtained with:

#    Option "XkbLayout"  "de"

# or:

#    Option "XkbLayout"  "de"

#    Option "XkbVariant" "nodeadkeys"

#

# If you'd like to switch the positions of your capslock and

# control keys, use:

#    Option "XkbOptions" "ctrl:swapcaps"

# These are the default XKB settings for XFree86

#    Option "XkbRules"   "xfree86"

#    Option "XkbVariant" ""

#    Option "XkbOptions" ""

#    Option "XkbDisable"

    Option "XkbRules"   "xfree86"

    #Option   "XkbModel" "pc89"

    Option   "XkbModel" "microsoftinet"

    Option "XkbLayout"   "dk"

EndSection

# **********************************************************************

# Core Pointer's InputDevice section

# **********************************************************************

Section "InputDevice"

    Identifier   "Trackpoint"

    Driver "mouse"

    Option "SendCoreEvents"

    Option "Protocol" "ExplorerPS/2"

    Option "Device" "/dev/input/mouse1"

EndSection

Section "InputDevice"

    Identifier   "External"

    Driver "mouse"

    Option "SendCoreEvents"

    Option "Protocol" "Auto"

    Option "Device" "/dev/input/mouse2"

    #Option "Device" "/dev/input/mice"

    Option "ZAxisMapping" "4 5"

EndSection

Section "InputDevice"

   Identifier "Touchpad"

   Driver "synaptics"

   Option "SendCoreEvents"

   Option "Device" "/dev/input/event1"

   Option "Protocol" "event"

   # Next line required only if you want to disable the mousepad while typing:

   Option "SHMConfig" "on"

   # The rest of the options are NOT required, just a default similar to the Windows drivers with non of the extra features.

   Option "LeftEdge" "1900"

   Option "RightEdge" "5400"

   Option "TopEdge" "1400"

   Option "BottomEdge" "4500"

   Option "FingerLow" "25"

   Option "FingerHigh" "30"

   Option "MaxTapTime" "180"

   Option "MaxTapMove" "220"

   Option "VertScrollDelta" "100"

   Option "MinSpeed" "0.02"

   Option "MaxSpeed" "0.18"

   Option "AccelFactor" "0.0010"

   Option "CircularScrolling"          "1"

   Option "CircScrollDelta"            "0.1"

   Option "CircScrollTrigger"          "7"

   Option "HorizScrollDelta" "0"

EndSection

# **********************************************************************

# Monitor section

# **********************************************************************

# Any number of monitor sections may be present

Section "Monitor"

    Identifier  "Monitor0"

    HorizSync   31.5 - 91.1

    VertRefresh 20 - 60

    Option "DPMS"

# === mode lines based on GTF ===

# VGA @ 100Hz

# Modeline "640x480@100" 43.163 640 680 744 848 480 481 484 509 +hsync +vsync

# SVGA @ 100Hz

# Modeline "800x600@100" 68.179 800 848 936 1072 600 601 604 636 +hsync +vsync

# XVGA @ 100Hz

# Modeline "1024x768@100" 113.309 1024 1096 1208 1392 768 769 772 814 +hsync +vsync

# 1152x864 @ 60Hz

# Modeline "1152x864@60" 81.642 1152 1216 1336 1520 864 865 868 895 +hsync +vsync

# 1152x864 @ 85Hz

# Modeline "1152x864@85" 119.651 1152 1224 1352 1552 864 865 868 907 +hsync +vsync

# 1152x864 @ 100Hz

# Modeline "1152x864@100" 143.472 1152 1232 1360 1568 864 865 868 915 +hsync +vsync

# 1280x960 @ 75Hz

# Modeline "1280x960@75" 129.859 1280 1368 1504 1728 960 961 964 1002 +hsync +vsync

# 1280x960 @ 100Hz

# Modeline "1280x960@100" 178.992 1280 1376 1520 1760 960 961 964 1017  +hsync +vsync

# SXGA @ 100Hz

# Modeline "1280x1024@100" 190.960 1280 1376 1520 1760 1024 1025 1028 1085 +hsync +vsync

# SPEA GDM-1950 (60Hz,64kHz,110MHz,-,-): 1280x1024 @ V-freq: 60.00 Hz, H-freq: 63.73 KHz

# Modeline "GDM-1950"  109.62  1280 1336 1472 1720  1024 1024 1026 1062 -hsync -vsync

# 1600x1000 @ 60Hz

# Modeline "1600x1000" 133.142 1600 1704 1872 2144 1000 1001 1004 1035 +hsync +vsync

# 1600x1000 @ 75Hz

# Modeline "1600x1000" 169.128 1600 1704 1880 2160 1000 1001 1004 1044 +hsync +vsync

# 1600x1000 @ 85Hz

# Modeline "1600x1000" 194.202 1600 1712 1888 2176 1000 1001 1004 1050 +hsync +vsync

# 1600x1000 @ 100Hz

# Modeline "1600x1000" 232.133 1600 1720 1896 2192 1000 1001 1004 1059 +hsync +vsync

# 1600x1024 @ 60Hz

# Modeline "1600x1024" 136.385 1600 1704 1872 2144 1024 1027 1030 1060 +hsync +vsync

# 1600x1024 @ 75Hz

# Modeline "1600x1024" 174.416 1600 1712 1888 2176 1024 1025 1028 1069 +hsync +vsync

# 1600x1024 @ 76Hz

# Modeline "1600x1024" 170.450 1600 1632 1792 2096 1024 1027 1030 1070 +hsync +vsync

# 1600x1024 @ 85Hz

# Modeline "1600x1024" 198.832 1600 1712 1888 2176 1024 1027 1030 1075 +hsync +vsync

# 1920x1080 @ 60Hz

# Modeline "1920x1080" 172.798 1920 2040 2248 2576 1080 1081 1084 1118 -hsync -vsync

# 1920x1080 @ 75Hz

# Modeline "1920x1080" 211.436 1920 2056 2264 2608 1080 1081 1084 1126 +hsync +vsync

# 1920x1200 @ 60Hz

# Modeline "1920x1200" 193.156 1920 2048 2256 2592 1200 1201 1203 1242 +hsync +vsync

# 1920x1200 @ 75Hz

# Modeline "1920x1200" 246.590 1920 2064 2272 2624 1200 1201 1203 1253 +hsync +vsync

# 2048x1536 @ 60

# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync

# 2048x1536 @ 60

# Modeline "2048x1536" 266.952 2048 2200 2424 2800 1536 1537 1540 1589 +hsync +vsync

# 1400x1050 @ 60Hz M9 Laptop mode 

# ModeLine "1400x1050" 122.000 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync

# 1920x2400 @ 25Hz for IBM T221, VS VP2290 and compatible display devices

# Modeline "1920x2400@25" 124.620 1920 1928 1980 2048 2400 2401 2403 2434 +hsync +vsync

# 1920x2400 @ 30Hz for IBM T221, VS VP2290 and compatible display devices

# Modeline "1920x2400@30" 149.250 1920 1928 1982 2044 2400 2402 2404 2434 +hsync +vsync

EndSection

# **********************************************************************

# Graphics device section

# **********************************************************************

# Any number of graphics device sections may be present

# === ATI device section ===

Section "Device"

    Identifier                          "ATI Graphics Adapter"

    Driver                              "fglrx"

# ### generic DRI settings ###

# === disable PnP Monitor  ===

    #Option                              "NoDDC"

# === disable/enable XAA/DRI ===

    Option "no_accel"                   "no"

    Option "no_dri"                     "no"

# === misc DRI settings ===

    Option "mtrr"                       "off" # disable DRI mtrr mapper, driver has its own code for mtrr

# ### FireGL DDX driver module specific settings ###

# === Screen Management ===

    Option "DesktopSetup"               "0x00000100" 

    Option "MonitorLayout"              "AUTO, NONE"

    Option "IgnoreEDID"                 "off"

    Option "HSync2"                     "unspecified" 

    Option "VRefresh2"                  "unspecified" 

    Option "ScreenOverlap"              "0" 

# === TV-out Management ===

    Option "NoTV"                       "yes"     

    Option "TVStandard"                 "NTSC-M"     

    Option "TVHSizeAdj"                 "0"     

    Option "TVVSizeAdj"                 "0"     

    Option "TVHPosAdj"                  "0"     

    Option "TVVPosAdj"                  "0"     

    Option "TVHStartAdj"                "0"     

    Option "TVColorAdj"                 "0"     

    Option "GammaCorrectionI"           "0x00000000"

    Option "GammaCorrectionII"          "0x00000000"

# === OpenGL specific profiles/settings ===

    Option "Capabilities"               "0x00000000"

# === Video Overlay for the Xv extension ===

    Option "VideoOverlay"               "on"

# === OpenGL Overlay ===

# Note: When OpenGL Overlay is enabled, Video Overlay

#       will be disabled automatically

    Option "OpenGLOverlay"              "off"

# === Center Mode (Laptops only) ===

    Option "CenterMode"                 "off"

# === Pseudo Color Visuals (8-bit visuals) ===

    Option "PseudoColorVisuals"         "off"

# === QBS Management ===

    Option "Stereo"                     "off"

    Option "StereoSyncEnable"           "1"

# === FSAA Management ===

    Option "FSAAEnable"                 "no"

    Option "FSAAScale"                  "1"

    Option "FSAADisableGamma"           "no"

    Option "FSAACustomizeMSPos"         "no"

    Option "FSAAMSPosX0"                "0.000000"

    Option "FSAAMSPosY0"                "0.000000"

    Option "FSAAMSPosX1"                "0.000000"

    Option "FSAAMSPosY1"                "0.000000"

    Option "FSAAMSPosX2"                "0.000000"

    Option "FSAAMSPosY2"                "0.000000"

    Option "FSAAMSPosX3"                "0.000000"

    Option "FSAAMSPosY3"                "0.000000"

    Option "FSAAMSPosX4"                "0.000000"

    Option "FSAAMSPosY4"                "0.000000"

    Option "FSAAMSPosX5"                "0.000000"

    Option "FSAAMSPosY5"                "0.000000"

# === Misc Options ===

    Option "UseFastTLS"                 "0"

    Option "BlockSignalsOnLock"         "on"

    Option "UseInternalAGPGART"         "yes"

    Option "ForceGenericCPU"            "no"

    BusID "PCI:1:0:0"    # vendor=1002, device=4e50

    Screen 0

    Option "DynamicClocks" "on"

EndSection

# **********************************************************************

# Screen sections

# **********************************************************************

# Any number of screen sections may be present.  Each describes

# the configuration of a single screen.  A single specific screen section

# may be specified from the X server command line with the "-screen"

# option.

Section "Screen"

    Identifier  "Screen0"

    Device      "ATI Graphics Adapter"

    Monitor     "Monitor0"

    DefaultDepth 24

    #Option "backingstore"

    Subsection "Display"

        Depth       24

        Modes       "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"

        ViewPort    0 0  

    EndSubsection

EndSection

# **********************************************************************

# ServerLayout sections.

# **********************************************************************

# Any number of ServerLayout sections may be present.  Each describes

# the way multiple screens are organised.  A specific ServerLayout

# section may be specified from the X server command line with the

# "-layout" option.  In the absence of this, the first section is used.

# When now ServerLayout section is present, the first Screen section

# is used alone.

Section "ServerLayout"

    Identifier  "Server Layout"

    Screen "Screen0"

    InputDevice "Touchpad" "CorePointer"

    InputDevice "Trackpoint" "CorePointer"

    InputDevice "External"

    InputDevice "Keyboard1" "CoreKeyboard"

EndSection

```

----------

## astrodelgato

Thanks for posting your config. I copied your settings and now it works. I'm not certain, but the issue might have been that some of the options, which I copied from a post on the first page of this thread, had spaces in the values that probably shouldn't have been there.

----------

## stormer

Hi, I've been working on TV_OUT on my T42 using radeon 7500.  This is not completly suported yet but maybe some people will be intrested.

First you nead old atitvout

```
emerge atitvout
```

Then prepare a new Xorg config file that uses vesa driver with a 640x480 resolution (don't try 1024x768, vesa is too slow).

The reason we need vesa is because Xorg accelerated radeon driver deactivate video switching (Still need to seek this code to see what we can do).

Then make sure you are sudoer (visudo) and you can start any movie on TV screen using this script :

```
#!/bin/bash

#

# Script used to play movie on TV using ATI Radeon 7500

#

TV_DISPLAY=10

(sudo X -br -config /etc/X11/xorg.conf.tv :$TV_DISPLAY &)

export DISPLAY=:$TV_DISPLAY

sleep 3

( xine -f -g $1 &)

sleep 3

sudo atitvout -f t

```

Note you'll need Xine if you do not costumized this script.  When done, hit CTRL-BKSPC and visual will be restored on you LCD.

I've tried lot of LRMI calls, but for now I'm still unable to find a patch that allow clone display on both LCD and TV.  At least I know this is possible since this was case in M$t Windows. Other issue, ACPI do not provide routine to activate of deactivate TV (DSTD returns doing nothing . . .).  For now I've patch ibm_acpi to show up tv display status.

If anyone have some technical information that he is allowed to share, this would be appreciate.

----------

## icantux

Hello all,

Is there a nice acpi event script to control some of the function keys (Fn-F3, Fn-F4, Fn-F5 wifi control, and lid)? I've been looking all over and can't find any consistency. 

I was thinking of just using the event scripts (/etc/acpi) from Ubuntu (I love how the Fn buttons  "just work" in Ubuntu!!) until I realized that the scripts point to all sorts of directories and "extras"  that aren't on my machine and I'm not sure where to look for substitute modules (right word? ) ... 

... for example:

the ubuntu script for blanking the screen (blankscreen.sh) is simple enough (I think - I have no idea how to write this stuff, except to explain to others how to make something work), but it's useless on my gentoo lappy.

```

#!/bin/bash

. /etc/default/acpi-support

. /usr/share/acpi-support/power-funcs

for x in /tmp/.X11-unix/*; do

    displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`

    getXuser;

    if [ x"$XAUTHORITY" != x"" ]; then

        export DISPLAY=":$displaynum"

   . /usr/share/acpi-support/screenblank

    fi

done

```

.... no "acpi-support" on gentoo ...

Any pointers for a "default.sh" that would do the F3, F4, F5 and F12 keys and lid open/close? I'd settle for only F3 and F4 at this point!!

Any thoughts on the script gurus here to "tweak" the Ubuntu code there and make some "generic" code available here for ThinkPad users (at gentoo docs)?

----------

## stormer

Hi,

there is the one I wrote :

Note: You need radeontools, ibm-acpi (in kernel), hibernate-script and acpid running

First in /etc/conf.d/local.start

```
# Activate ACPI hotkeys

echo 0x8DC > /proc/acpi/ibm/hotkey

echo enable > /proc/acpi/ibm/hotkey
```

Then in /etc/acpi/events/ibm_hotkey

```
# IBM hotkey

event=ibm[ /]hotkey.*

action=/etc/acpi/actions/hotkey.sh %e
```

Then in /etc/acpi/actions/hotkey.sh

```
#!/bin/sh

set $*

case "$4" in

        00001003) # Standby

            /etc/acpi/actions/suspend.sh

            ;;

        00001004) # Sleep

            /etc/acpi/actions/sleep.sh

            ;;

        00001005) # Wireless

            if [ "`iwconfig eth1 | grep \"Tx-Power=off\"`" == "" ]

            then

                    /etc/init.d/net.eth1 stop

                    iwconfig eth1 txpower off

            else

                    iwconfig eth1 txpower on

                    /etc/init.d/net.eth1 start

            fi

            ;;

        00001007) # Switch video output (need BIOSHotkey enabled in Xorg)

            echo video_switch > /proc/acpi/ibm/video

            ;;

        00001008) # Expand

            echo expand_toggle > /proc/acpi/ibm/video

            ;;

        0000100c) # Hibernate

            /etc/acpi/actions/hibernate.sh

            ;;

        *) # Unknown

            logger "IBM Hotkey $4 is not supported."

            ;;

esac
```

Finally to hibernate and suspend

In /etc/acpi/actions/hibernate.sh

```

#!/bin/bash

# Do not sleep while shuting down

RUNLEVEL=`/sbin/runlevel | gawk -F" " '{ print $2 }'`

case $RUNLEVEL in

        [06])

            HIBERNATE="false"

            ;;

        *)

            HIBERNATE="true"

            ;;

esac

[ -f /tmp/hibernate_active ] && HIBERNATE="false"

# If it is time, do the job

if [ "$HIBERNATE" == "true" ]; then

        touch /tmp/hibernate_active

        /usr/sbin/hibernate

        /usr/sbin/laptop_mode auto

        rm -f /tmp/hibernate_active

fi

```

In /etc/acpi/actions/sleep.sh

```

#!/bin/bash

# Do not sleep while shuting down

RUNLEVEL=`/sbin/runlevel | gawk -F" " '{ print $2 }'`

case $RUNLEVEL in

        [06])

            SLEEP="false"

            ;;

        *)

            SLEEP="true"

            ;;

esac

# Do not sleep while going to hibernate

if [ -f "/tmp/hibernate_active" ]; then

        SLEEP="false"

fi

# Do not sleep if asked to

if [ -f "/tmp/no_sleep" ]; then

        SLEEP="false"

fi

# If it is time, do the job

if [ "$SLEEP" == "true" ]; then

        /sbin/cardctl suspend

        /usr/sbin/laptop_mode stop

        /usr/sbin/hibernate-sleep

        /usr/sbin/laptop_mode auto

        /sbin/cardctl resume

else

        /etc/acpi/actions/suspend.sh

fi

```

In /etc/acpi/actions/suspend.sh

```
#!/bin/bash

if [ -f /tmp/light_off ]

then

        radeontool light on

        rm -rf /tmp/light_off

else

        radeontool light off

        touch /tmp/light_off

fi

```

----------

## icantux

Sweet! Thanks very much. I'll give this a whirl and let you know how it turns out!   :Smile: 

----------

## gen24all

 *stormer wrote:*   

> 
> 
> # If it is time, do the job
> 
> if [ "$SLEEP" == "true" ]; then
> ...

 

Does that even exist?

I am using /usr/sbin/hibernate-ram and my laptop goes into suspend mode and wakes up "immediately". Any ideas why this could be happening?

Thanks.

----------

## icantux

Hmm... I just looked through my /usr/sbin directory and I don't have any of the mentioned hibernate features even listed there. No "laptop_mode", no "hibernate-ram" or "hibernate-sleep" ... something I need to emerge?

EDIT: scratch that... figured out I needed to emerge "laptop-mode-tools" and "hibernate-script" ... Now to test those scripts

----------

## icantux

 *stormer wrote:*   

> Hi,
> 
> there is the one I wrote :
> 
> Note: You need radeontools, ibm-acpi (in kernel), hibernate-script and acpid running
> ...

 

Thanks for the scripts and all, but they don't work for me. 

When I invoke Fn-F3 the screen blanks out for a second and immediately comes back on. Same with FnF4 (sleep), same with toggling wireless radio (FnF5)... turns things off for a second and right back on.

..... and the quest to get these buttons working continues. ....

----------

## jmanko

icantux,  what isn't working?

can you post what you did so far?

----------

## icantux

Well I got things working now. Lots of digging and googling I found a set of scripts with beep feedback --> here,  set it all up and BLAM! ... all the buttons work well now. 

My install notes for getting the thinkpad buttons working are in this post: 

https://forums.gentoo.org/viewtopic-t-450062.html

The only thing that still doesn't work is the "lid" action. I've yet to find a suitable script that will allow my system to re-awaken without getting all messed up or without having to reboot.

----------

## jmanko

I'm glad everything is working.  Thanks for posting your install notes.  That will help others.

----------

