Difference between revisions of "Installing Ubuntu 8.10 (Intrepid Ibex) on a ThinkPad X61"

From ThinkWiki
Jump to: navigation, search
(Table of keycodes for special keys and key combinations)
 
(86 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[User:Jdthood|I]] installed Ubuntu 8.10 on a ThinkPad {{X61}} model [[7673-CTO]].
 
[[User:Jdthood|I]] installed Ubuntu 8.10 on a ThinkPad {{X61}} model [[7673-CTO]].
 
= Information about this model =
 
  
 
== Some available accessories for this model ==
 
== Some available accessories for this model ==
Line 20: Line 18:
 
</pre>
 
</pre>
  
== glxgears ==
+
== <tt>glxgears</tt> output ==
 
<pre>
 
<pre>
 
$ glxgears
 
$ glxgears
3655 frames in 5.0 seconds = 730.939 FPS
+
3581 frames in 5.0 seconds = 716.195 FPS
 +
3704 frames in 5.0 seconds = 740.681 FPS
 +
3687 frames in 5.0 seconds = 737.260 FPS
 +
3601 frames in 5.0 seconds = 720.102 FPS
 +
</pre>
 +
 
 +
== <tt>tp_smapi</tt> and <tt>hdaps</tt> ==
 +
The tp_smapi package includes the <tt>tp_smapi</tt> driver and the customized <tt>hdaps</tt> driver.
 +
 
 +
To have the <tt>tp_smapi</tt> and <tt>hdaps_ec</tt> modules loaded on boot, add the lines
 +
<pre>
 +
tp_smapi
 +
hdaps_ec
 +
</pre>
 +
to the <tt>/etc/modules</tt> file.
 +
 
 +
Version 0.37 of <tt>tp_smapi</tt> is included in Ubuntu Jaunty (in the <tt>linux-image-2.6.28-11-generic</tt> package).
 +
 
 +
Version 0.40 is available upstream.
 +
 
 +
The 0.40 version makes the following <tt>/sys</tt> files available:
 +
<pre>
 +
$ cd /sys/devices/platform/smapi
 +
$ ls -aF *
 +
ac_connected  driver@  modalias  smapi_request  subsystem@  uevent
 +
 
 +
BAT0:
 +
.                    current_avg      first_use_date  inhibit_charge_minutes  power_avg                remaining_running_time      temperature
 +
..                    current_now      force_discharge  installed              power_now                remaining_running_time_now  voltage
 +
barcoding            cycle_count      group0_voltage  last_full_capacity      remaining_capacity      serial
 +
charging_max_current  design_capacity  group1_voltage  manufacture_date        remaining_charging_time  start_charge_thresh
 +
charging_max_voltage  design_voltage  group2_voltage  manufacturer            remaining_percent        state
 +
chemistry            dump            group3_voltage  model                  remaining_percent_error  stop_charge_thresh
 +
 
 +
BAT1:
 +
.                    current_avg      first_use_date  inhibit_charge_minutes  power_avg                remaining_running_time      temperature
 +
..                    current_now      force_discharge  installed              power_now                remaining_running_time_now  voltage
 +
barcoding            cycle_count      group0_voltage  last_full_capacity      remaining_capacity      serial
 +
charging_max_current  design_capacity  group1_voltage  manufacture_date        remaining_charging_time  start_charge_thresh
 +
charging_max_voltage  design_voltage  group2_voltage  manufacturer            remaining_percent        state
 +
chemistry            dump            group3_voltage  model                  remaining_percent_error  stop_charge_thresh
 +
 
 +
driver:
 +
.  ..  bind  module  smapi  uevent  unbind
 +
 
 +
power:
 +
.  ..  wakeup
 +
 
 +
subsystem:
 +
.  ..  devices  drivers  drivers_autoprobe  drivers_probe  uevent
 +
</pre>
 +
 
 +
=== <tt>tp_smapi</tt> ===
 +
<tt>tp_smapi</tt> allows ThinkPad battery charging to be controlled.
 +
 
 +
To set charge thresholds that are kinder to lithium ion batteries:
 +
<pre>
 +
# cd /etc/init.d
 +
# cat <<EOF >tp-smapi
 +
#!/bin/sh
 +
case "$1" in
 +
  start)
 +
echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
 +
echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
 +
;;
 +
esac
 +
EOF
 +
# chmod ugo+x tp-smapi
 +
# update-rc.d tp-smapi start 90 S .
 
</pre>
 
</pre>
  
= Issues =
+
=== <tt>hdaps</tt> ===
  
== HDAPS ==
+
==== Can't load the standard Ubuntu <tt>hdaps</tt> module ====
=== Can't load the <tt>hdaps</tt> module ===
 
 
<pre>
 
<pre>
 
# modprobe hdaps
 
# modprobe hdaps
Line 38: Line 103:
 
</pre>
 
</pre>
  
The <tt>hdaps</tt> and the <tt>thinkpad_ec</tt> module conflict. Either one can be loaded in the absence of the other.
+
The <tt>hdaps</tt> and the <tt>thinkpad_ec</tt> modules shipped in Intrepid and Jaunty (4 March 2009) conflict with each other.
 
+
Either one can be loaded in the absence of the other.
Apparently an <tt>hdaps_ec</tt> module is needed but neither Intrepid nor Jaunty (4 March 2009) includes it.
+
This is mentioned [[tp_smapi#Bundled_hdaps_driver|on the tp_smapi page]].
 
 
The <tt>hdaps</tt> module loaded:
 
  
 +
With the <tt>hdaps</tt> module loaded, <tt>hdapsd</tt> prints an error message:
 
<pre>
 
<pre>
 
Setting up hdapsd (1:0.0.20070803-2) ...
 
Setting up hdapsd (1:0.0.20070803-2) ...
Line 49: Line 113:
 
  please read /usr/share/doc/hdapsd/README.Debian
 
  please read /usr/share/doc/hdapsd/README.Debian
 
</pre>
 
</pre>
 
+
The mentioned file says:
The latter file says:
 
  
 
  hdapsd needs the hdaps kernel module and the hdaps_protect patch
 
  hdapsd needs the hdaps kernel module and the hdaps_protect patch
 
  in the kernel so it WON'T work out-of-the-box on a Debian machine yet.
 
  in the kernel so it WON'T work out-of-the-box on a Debian machine yet.
  Look at http://thinkwiki.org/wiki/HDAPS for additional information.
+
  Look at [http://www.thinkwiki.org/wiki/HDAPS http://thinkwiki.org/wiki/HDAPS] for additional information.
 +
 
 +
Bottom line: The newer version of the <tt>hdaps</tt> driver furnished by [[tp_smapi|the tp_smapi project]] is needed but neither Intrepid nor Jaunty (4 March 2009) includes this driver.
  
 
Bug reported: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/297213
 
Bug reported: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/297213
  
== Docking ==
+
===== Workaround =====
 
+
Install the <tt>tp_smapi</tt> and <tt>hdaps</tt> drivers built from the upstream sources.
=== Do something on undock and dock ===
+
First install the Linux headers and necessary kernel build tools and [http://sourceforge.net/project/showfiles.php?group_id=1212 download the tp_smapi tarball].
 
+
Then:
To arrange for some action to be taken on undock and dock, add an /etc/udev/rules.d/55-thinkpad-local.rules file containing the following
 
 
<pre>
 
<pre>
KERNEL=="dock.0", ATTR{docked}=="1", RUN+="/etc/thinkpad/dock.sh 1"
+
$ tar xzvf tp_smapi-0.40.tgz
KERNEL=="dock.0", ATTR{docked}=="0", RUN+="/etc/thinkpad/dock.sh 0"
+
$ cd tp_smapi-0.40
</pre>
+
$ sudo make load HDAPS=1
and add an /etc/thinkpad/dock.sh file containing something like the following:
+
$ lsmod|head -4
<pre>
+
Module                  Size  Used by
#!/bin/sh
+
hdaps                  18648  0  
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
+
tp_smapi              29712  0
echo Docked: $DOCKED | logger -t $0
+
thinkpad_ec            15000  2 hdaps,tp_smapi
case "$DOCKED" in
 
        "0")
 
                # Do something
 
                ;;
 
        "1")
 
                # Do something else
 
                ;;
 
esac
 
 
</pre>
 
</pre>
  
Here is the content of /var/log/syslog resulting from this sequence of actions:
+
==== <tt>hdaps</tt> at work ====
* Press the "undock" button on the left side of the [[UltraBase X6]]
+
The image below shows <tt>hdaps-gl</tt> correctly portraying the spatial orientation of the laptop.
* Remove the X61 from the UltraBase X6
+
 
* Insert the X61 back into the UltraBase X6 with various peripherals attached
+
[[File:HDAPS working on ThinkPad X61.jpg|320 px]]
  
 
<pre>
 
<pre>
-- Pressed the undock button here --
+
$ cd /sys/devices/platform/hdaps
 
+
$ ls -aF
Mar  5 12:56:02 triffid kernel: [31768.846089] ACPI: \_SB_.GDCK - undocking
+
./         invert            oversampling_ratio        sampling_rate
Mar  5 12:56:02 triffid kernel: [31768.850304] usb 2-4: USB disconnect, address 8
+
../       keyboard_activity position                  subsystem@
Mar  5 12:56:02 triffid kernel: [31768.850311] usb 2-4.1: USB disconnect, address 9
+
calibrate modalias          power/                   temp1
Mar  5 12:56:03 triffid kernel: [31768.917622] usb 2-4.2: USB disconnect, address 10
+
driver@   mouse_activity    running_avg_filter_order uevent
Mar  5 12:56:03 triffid /etc/thinkpad/dock.sh: Docked: 0
+
$ cat invert
 
+
6
-- Removed X61 from UltraBase X6 here --
 
 
 
Mar  5 12:56:40 triffid kernel: [31806.417127] 0000:00:19.0: eth0: Link is Down
 
Mar  5 12:56:40 triffid NetworkManager: <info>  (eth0): carrier now OFF (device state 8)
 
Mar  5 12:56:40 triffid NetworkManager: <info>  (eth0): device state change: 8 -> 2
 
Mar  5 12:56:40 triffid NetworkManager: <info>  (eth0): deactivating device (reason: 40).
 
Mar  5 12:56:40 triffid NetworkManager: <info>  eth0: canceled DHCP transaction, dhcp client pid 25911
 
Mar  5 12:56:40 triffid NetworkManager: <info>  Policy set 'Auto bb55-lubbers' (wlan0) as default for routing and DNS.
 
Mar  5 12:56:40 triffid avahi-daemon[3772]: Withdrawing address record for 192.168.1.35 on eth0.
 
Mar  5 12:56:40 triffid avahi-daemon[3772]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.35.
 
Mar  5 12:56:40 triffid avahi-daemon[3772]: Interface eth0.IPv4 no longer relevant for mDNS.
 
Mar  5 12:56:40 triffid x-session-manager[13353]: DEBUG(+): GsmDBusClient: obj_path=/org/freedesktop/PowerManagement interface=org.freedesktop.PowerManagement method=OnBatteryChanged
 
Mar  5 12:56:40 triffid x-session-manager[13353]: DEBUG(+): GsmDBusClient: obj_path=/org/freedesktop/PowerManagement interface=org.freedesktop.PowerManagement method=PowerSaveStatusChanged
 
Mar  5 12:56:42 triffid pulseaudio[13457]: module-alsa-sink.c: Increasing wakeup watermark to 90.00 ms
 
Mar  5 12:56:44 triffid pulseaudio[13457]: module-alsa-sink.c: Increasing wakeup watermark to 100.00 ms
 
 
 
-- Inserted the X61 into the UltraBase X6 here --
 
 
 
Mar  5 12:57:02 triffid anacron[26310]: Anacron 2.3 started on 2009-03-05
 
Mar  5 12:57:02 triffid anacron[26310]: Normal exit (0 jobs run)
 
Mar  5 12:57:02 triffid anacron[26369]: Anacron 2.3 started on 2009-03-05
 
Mar  5 12:57:02 triffid anacron[26369]: Normal exit (0 jobs run)
 
Mar  5 12:57:02 triffid x-session-manager[13353]: DEBUG(+): GsmDBusClient: obj_path=/org/freedesktop/PowerManagement interface=org.freedesktop.PowerManagement method=OnBatteryChanged
 
Mar  5 12:57:02 triffid x-session-manager[13353]: DEBUG(+): GsmDBusClient: obj_path=/org/freedesktop/PowerManagement interface=org.freedesktop.PowerManagement method=PowerSaveStatusChanged
 
Mar  5 12:57:02 triffid kernel: [31828.384758] ACPI: \_SB_.GDCK - docking
 
Mar  5 12:57:02 triffid kernel: [31828.589049] usb 2-4: new high speed USB device using ehci_hcd and address 11
 
Mar  5 12:57:02 triffid kernel: [31828.721419] usb 2-4: configuration #1 chosen from 1 choice
 
Mar  5 12:57:02 triffid kernel: [31828.722409] hub 2-4:1.0: USB hub found
 
Mar  5 12:57:02 triffid kernel: [31828.722465] hub 2-4:1.0: 4 ports detected
 
Mar  5 12:57:03 triffid kernel: [31829.232108] usb 2-4.1: new low speed USB device using ehci_hcd and address 12
 
Mar  5 12:57:03 triffid kernel: [31829.364574] usb 2-4.1: configuration #1 chosen from 1 choice
 
Mar  5 12:57:03 triffid kernel: [31829.373005] input: Microsoft Comfort Curve Keyboard 2000 as /devices/pci0000:00/0000:00:1a.7/usb2/2-4/2-4.1/2-4.1:1.0/input/input18
 
Mar  5 12:57:03 triffid kernel: [31829.412125] generic-usb 0003:045E:00DD.000A: input,hidraw0: USB HID v1.11 Keyboard [Microsoft Comfort Curve Keyboard 2000] on usb-0000:00:1a.7-4.1/input0
 
Mar  5 12:57:03 triffid kernel: [31829.424150] input: Microsoft Comfort Curve Keyboard 2000 as /devices/pci0000:00/0000:00:1a.7/usb2/2-4/2-4.1/2-4.1:1.1/input/input19
 
Mar  5 12:57:03 triffid kernel: [31829.456127] generic-usb 0003:045E:00DD.000B: input,hidraw1: USB HID v1.11 Device [Microsoft Comfort Curve Keyboard 2000] on usb-0000:00:1a.7-4.1/input1
 
Mar  5 12:57:03 triffid NetworkManager: <info>  (eth0): carrier now ON (device state 2)
 
Mar  5 12:57:03 triffid NetworkManager: <info>  (eth0): device state change: 2 -> 3
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) starting connection 'Auto eth0'
 
Mar  5 12:57:03 triffid NetworkManager: <info>  (eth0): device state change: 3 -> 4
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) started...
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) starting...
 
Mar  5 12:57:03 triffid NetworkManager: <info>  (eth0): device state change: 4 -> 5
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) successful.
 
Mar  5 12:57:03 triffid kernel: [31829.507200] 0000:00:19.0: eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 2 of 5 (Device Configure) complete.
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
 
Mar  5 12:57:03 triffid NetworkManager: <info>  (eth0): device state change: 5 -> 7
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Beginning DHCP transaction.
 
Mar  5 12:57:03 triffid dhclient: Internet Systems Consortium DHCP Client V3.1.1
 
Mar  5 12:57:03 triffid dhclient: Copyright 2004-2008 Internet Systems Consortium.
 
Mar  5 12:57:03 triffid dhclient: All rights reserved.
 
Mar  5 12:57:03 triffid dhclient: For info, please visit http://www.isc.org/sw/dhcp/
 
Mar  5 12:57:03 triffid dhclient:
 
Mar  5 12:57:03 triffid dhclient: wmaster0: unknown hardware address type 801
 
Mar  5 12:57:03 triffid NetworkManager: <info>  dhclient started with pid 26444
 
Mar  5 12:57:03 triffid NetworkManager: <info>  Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
 
Mar  5 12:57:03 triffid NetworkManager: <info>  DHCP: device eth0 state changed normal exit -> preinit
 
Mar  5 12:57:03 triffid dhclient: wmaster0: unknown hardware address type 801
 
Mar  5 12:57:03 triffid dhclient: Listening on LPF/eth0/00:1d:72:96:e4:31
 
Mar  5 12:57:03 triffid dhclient: Sending on  LPF/eth0/00:1d:72:96:e4:31
 
Mar  5 12:57:03 triffid dhclient: Sending on  Socket/fallback
 
Mar  5 12:57:03 triffid kernel: [31829.540257] usb 2-4.2: new low speed USB device using ehci_hcd and address 13
 
Mar  5 12:57:03 triffid kernel: [31829.643955] usb 2-4.2: configuration #1 chosen from 1 choice
 
Mar  5 12:57:03 triffid kernel: [31829.654901] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:1a.7/usb2/2-4/2-4.2/2-4.2:1.0/input/input20
 
Mar 5 12:57:03 triffid kernel: [31829.685098] generic-usb 0003:046D:C00E.000C: input,hidraw2: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:1a.7-4.2/input0
 
Mar 5 12:57:04 triffid /etc/thinkpad/dock.sh: Docked: 1
 
Mar  5 12:57:07 triffid dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
 
Mar  5 12:57:07 triffid dhclient: DHCPOFFER of 192.168.1.35 from 192.168.1.254
 
Mar  5 12:57:07 triffid dhclient: DHCPREQUEST of 192.168.1.35 on eth0 to 255.255.255.255 port 67
 
Mar  5 12:57:07 triffid dhclient: DHCPACK of 192.168.1.35 from 192.168.1.254
 
Mar  5 12:57:07 triffid NetworkManager: <info>  DHCP: device eth0 state changed preinit -> bound
 
Mar  5 12:57:07 triffid NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) scheduled...
 
Mar  5 12:57:07 triffid NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) started...
 
Mar  5 12:57:07 triffid NetworkManager: <info>   address 192.168.1.35
 
Mar  5 12:57:07 triffid NetworkManager: <info>    prefix 24 (255.255.255.0)
 
Mar  5 12:57:07 triffid NetworkManager: <info>    gateway 192.168.1.254
 
Mar  5 12:57:07 triffid NetworkManager: <info>    hostname 'dhcppc2'
 
Mar 5 12:57:07 triffid NetworkManager: <info>    nameserver '192.168.1.254'
 
Mar  5 12:57:07 triffid NetworkManager: <info>    domain name 'lokaal'
 
Mar  5 12:57:07 triffid NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
 
Mar  5 12:57:07 triffid NetworkManager: <info>  Activation (eth0) Stage 4 of 5 (IP Configure Get) complete.
 
Mar  5 12:57:07 triffid NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
 
Mar  5 12:57:07 triffid avahi-daemon[3772]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.35.
 
Mar  5 12:57:07 triffid avahi-daemon[3772]: New relevant interface eth0.IPv4 for mDNS.
 
Mar  5 12:57:07 triffid avahi-daemon[3772]: Registering new address record for 192.168.1.35 on eth0.IPv4.
 
Mar  5 12:57:07 triffid dhclient: bound to 192.168.1.35 -- renewal in 13934 seconds.
 
Mar  5 12:57:08 triffid NetworkManager: nm_ip4_config_add_nameserver: assertion `nameserver != s' failed
 
Mar  5 12:57:08 triffid NetworkManager: nm_ip4_config_add_nameserver: assertion `nameserver != s' failed
 
Mar  5 12:57:08 triffid NetworkManager: <info>  Policy set 'Auto bb55-lubbers' (wlan0) as default for routing and DNS.
 
Mar  5 12:57:08 triffid NetworkManager: <info>  (eth0): device state change: 7 -> 8
 
Mar  5 12:57:08 triffid NetworkManager: nm_ip4_config_add_nameserver: assertion `nameserver != s' failed
 
Mar  5 12:57:08 triffid NetworkManager: <info>  Policy set 'Auto eth0' (eth0) as default for routing and DNS.
 
Mar  5 12:57:08 triffid NetworkManager: <info>  Activation (eth0) successful, device activated.
 
Mar  5 12:57:08 triffid NetworkManager: <info>  Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
 
Mar  5 12:57:08 triffid ntpdate[26538]: adjust time server 91.189.94.4 offset 0.018127 sec
 
 
</pre>
 
</pre>
  
Ref: http://marc.info/?l=linux-thinkpad&m=123416226107039&w=2
+
== Docking ==
 +
I had hoped that with Ubuntu I would be able to dock and undock the X61, but I was disappointed.
  
 
=== Hard freeze on undock from UltraBase ===
 
=== Hard freeze on undock from UltraBase ===
 
The ThinkPad {{X61}} can be docked in the [[UltraBase X6]] which has an [[Ultrabay Slim]] into which an optical drive can be installed such as the [[Ultrabay Slim Multi-Burner III Drive]].
 
The ThinkPad {{X61}} can be docked in the [[UltraBase X6]] which has an [[Ultrabay Slim]] into which an optical drive can be installed such as the [[Ultrabay Slim Multi-Burner III Drive]].
  
If the X61 is removed from the UltraBase then it seizes up, presumably because the kernel can no longer see the optical drive.
+
If the X61 is removed from the UltraBase then the X61 freezes, presumably because the kernel can no longer see the optical drive.
  
 
A sufficient solution is to "delete" the optical drive before undocking.
 
A sufficient solution is to "delete" the optical drive before undocking.
 
<pre>echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete</pre>
 
<pre>echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete</pre>
  
It doesn't seem to be necessary to write to <tt>/sys/bus/platform/devices/dock.0/undock</tt> as some suggest.
+
It doesn't seem to be necessary or even helpful to write to other files such as <tt>[[#/sys/devices/platform/dock.0|/sys/devices/platform/dock.0]]</tt> or <tt>[[#/proc/acpi/ibm/bay|/proc/acpi/ibm/bay]]</tt> as some suggest.
  
It does seem necessary to do this, however, ''before'' pressing the "undock" button on the UltraBase X6.
+
However, it does seem to be necessary to delete the optical drive ''before'' pressing the "undock" button on the UltraBase X6.
  
After reattaching the UltraBase, do
+
After reattaching the UltraBase, this:
 
<pre>echo 0 0 0 > /sys/class/scsi_host/host1/scan</pre>
 
<pre>echo 0 0 0 > /sys/class/scsi_host/host1/scan</pre>
to cause the optical drive to be noticed by the kernel.
+
causes the kernel to notice the optical drive again.
  
 
Note that it is possible that the device number be something other than 1:0:0:0.  Do, e.g.,
 
Note that it is possible that the device number be something other than 1:0:0:0.  Do, e.g.,
Line 225: Line 183:
 
Bug reported: https://bugs.launchpad.net/ubuntu/+bug/242638
 
Bug reported: https://bugs.launchpad.net/ubuntu/+bug/242638
  
=== /proc/acpi/ibm/bay ===
+
=== No <tt>/proc/acpi/ibm/dock</tt> ===
There is a /proc/acpi/ibm/bay file with the following contents (with the X61 docked in the [[UltraBase X6]] with a [[Ultrabay Slim Multi-Burner III Drive]] in the [[Ultrabay|Ultrabay Slim]] port).
 
<pre>
 
# cat bay
 
status:        occupied
 
commands:      eject
 
</pre>
 
  
=== No /proc/acpi/ibm/dock ===
 
 
The file <tt>/proc/acpi/ibm/dock</tt> does not exist even though the <tt>thinkpad-acpi</tt> module is loaded and the X61 is booted while docked in the [[UltraBase X6]].
 
The file <tt>/proc/acpi/ibm/dock</tt> does not exist even though the <tt>thinkpad-acpi</tt> module is loaded and the X61 is booted while docked in the [[UltraBase X6]].
So, instructions in [http://ibm-acpi.sourceforge.net/README the thinkpad-acpi README] and elsewhere that make reference to this file can be followed.
+
So, instructions in [http://ibm-acpi.sourceforge.net/README the thinkpad-acpi README] and elsewhere that make reference to this file cannot be followed.
  
<tt>lsmod</tt> reveals that the <tt>dock</tt> and <tt>bay</tt> modules are loaded.  There is a <tt>/sys/devices/platform/dock.0</tt> directory with:
+
=== <tt>/sys/devices/platform/dock.0</tt> ===
 +
 
 +
There is a <tt>/sys/devices/platform/dock.0</tt> directory with:
 
<pre>
 
<pre>
 
# cd /sys/devices/platform/dock.0
 
# cd /sys/devices/platform/dock.0
Line 265: Line 218:
 
1
 
1
 
</pre>
 
</pre>
 +
 +
In Jaunty at least, doing
 +
<pre>
 +
echo 1 > /sys/devices/platform/dock.0/undock
 +
</pre>
 +
does strange things.  The first time I tried it it logged me out of GNOME but did not disconnect the external monitor connected to the dock.  After I logged back in, the same command did cause the disconnection of the external monitor.
 +
 +
=== <tt>/proc/acpi/ibm/bay</tt> ===
 +
When the <tt>thinkpad_acpi</tt> module is loaded there is a <tt>/proc/acpi/ibm/bay</tt> file with the following contents (with the X61 docked in the [[UltraBase X6]] with a [[Ultrabay Slim Multi-Burner III Drive]] in the [[Ultrabay|Ultrabay Slim]] port).
 +
<pre>
 +
# cat bay
 +
status:        occupied
 +
commands:      eject
 +
</pre>
 +
 +
Doing
 +
<pre>
 +
echo eject > /proc/acpi/ibm/bay
 +
</pre>
 +
after
 +
<pre>
 +
echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete
 +
</pre>
 +
causes the light on the drive in the Ultrabay Slim to go out.
 +
 +
Doing the "eject" without first doing the "delete" mentioned earlier causes a system hang.
 +
 +
=== <tt>dock</tt> and <tt>bay</tt> modules ===
 +
 +
In Intrepid the <tt>lsmod</tt> command reveals that the <tt>dock</tt> and <tt>bay</tt> modules are loaded.
 +
 +
In Jaunty these modules are no longer present. 
 +
* In Linux 2.6.28 the <tt>bay</tt> driver code was incorporated into the <tt>dock</tt> driver.
 +
* In Jaunty the <tt>dock</tt> driver is built integrally rather than modularly.
 +
 +
<pre>
 +
$ cd /boot
 +
$ grep DOCK config*
 +
config-2.6.27-11-generic:CONFIG_ACPI_DOCK=m
 +
config-2.6.28-11-generic:CONFIG_ACPI_DOCK=y
 +
</pre>
 +
 +
=== Do something on undock and dock ===
 +
 +
To arrange for some action to be taken on undock and dock, add an /etc/udev/rules.d/55-thinkpad-local.rules file containing the following
 +
<pre>
 +
KERNEL=="dock.0", ATTR{docked}=="1", RUN+="/etc/thinkpad/dock.sh 1"
 +
KERNEL=="dock.0", ATTR{docked}=="0", RUN+="/etc/thinkpad/dock.sh 0"
 +
</pre>
 +
and add an /etc/thinkpad/dock.sh file containing something like the following:
 +
<pre>
 +
#!/bin/sh
 +
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
 +
echo Docked: $DOCKED | logger -t $0
 +
case "$DOCKED" in
 +
        "0")
 +
                # Do something
 +
                ;;
 +
        "1")
 +
                # Do something else
 +
                ;;
 +
esac
 +
</pre>
 +
 +
Ref: http://marc.info/?l=linux-thinkpad&m=123416226107039&w=2
  
 
== Keys ==
 
== Keys ==
Line 289: Line 307:
 
* [[How to get special keys to work]]
 
* [[How to get special keys to work]]
  
But reported: https://bugs.launchpad.net/ubuntu/hardy/+source/linux/+bug/217504/
+
Bug reported: https://bugs.launchpad.net/ubuntu/hardy/+source/linux/+bug/217504/
  
 
=== Fn-F5 emits KEY_RADIO instead of KEY_WLAN ===
 
=== Fn-F5 emits KEY_RADIO instead of KEY_WLAN ===
Line 297: Line 315:
 
=== Table of keycodes for special keys and key combinations ===
 
=== Table of keycodes for special keys and key combinations ===
  
While investigating the above problem I researched what key codes the various special keys and key combinations generate on this ThinkPad using various tools.  The observations (which haven't been double-checked yet) are summarized in the following table.
+
While investigating the above problem I researched what key codes the various special keys and key combinations generate on this ThinkPad using various tools.  The observations (which haven't been double-checked yet) are summarized in the following table.  The ThinkVantage key is only seen by <tt>xev</tt> in Jaunty, not in Intrepid.
  
 
* [https://wiki.ubuntu.com/LaptopTestingTeam/HotkeyResearch Instructions for <tt>showkey</tt>, <tt>acpi_listen</tt>, <tt>xev</tt> and GNOME keyboard shortcuts methods]
 
* [https://wiki.ubuntu.com/LaptopTestingTeam/HotkeyResearch Instructions for <tt>showkey</tt>, <tt>acpi_listen</tt>, <tt>xev</tt> and GNOME keyboard shortcuts methods]
Line 303: Line 321:
  
 
{| border="1" cellspacing="0" cellpadding="2"
 
{| border="1" cellspacing="0" cellpadding="2"
! key combination !! extra function symbol !! <tt>showkey</tt> scancode !! <tt>showkey</tt> keycode !! <tt>input-events</tt> !! <tt>acpi_listen</tt> !! <tt>xev</tt> !! GNOME keyboard shortcuts
+
! Key combination !! Extra function symbol !! Scan code<br>(<tt>showkey&nbsp;-s</tt>)<br><i>(hex)</i> !! Key code<br>(<tt>showkey&nbsp;-k</tt>) !! Input event<br>(<tt>input-events</tt>) !! ACPI event<br>(<tt>acpi_listen</tt>) !! X event<br>(<tt>xev</tt>) !! Keyboard Shortcuts name
 
|-
 
|-
 
| {{key|⟦◁̸}} (loudspeaker icon with stroke) || || e0 20 e0 a0 || 113 || (none) || (none) || 121 || XF86AudioMute
 
| {{key|⟦◁̸}} (loudspeaker icon with stroke) || || e0 20 e0 a0 || 113 || (none) || (none) || 121 || XF86AudioMute
Line 311: Line 329:
 
| {{key|⟦◁▴}} (loudspeaker icon, up arrow) || || e0 30 e0 b0 || 115 || (none) || (none) || 123 || XF86AudioRaiseVolume
 
| {{key|⟦◁▴}} (loudspeaker icon, up arrow) || || e0 30 e0 b0 || 115 || (none) || (none) || 123 || XF86AudioRaiseVolume
 
|-
 
|-
| {{ibmkey|ThinkVantage|#495988}} || || e0 1f e0 9f || 360 || KEY_VENDOR || ibm/hotkey HKEY 00000080 00001018 || (none) || (none)
+
| {{ibmkey|ThinkVantage|#495988}} || || e0 1f e0 9f || 360 || KEY_VENDOR || ibm/hotkey HKEY 00000080 00001018 || 156 || XF86Launch1
 
|-
 
|-
 
| {{ibmkey|Fn|#494949}} || || e0 63 e0 e3 || 143 || || (none) || 151 || XF86WakeUp
 
| {{ibmkey|Fn|#494949}} || || e0 63 e0 e3 || 143 || || (none) || 151 || XF86WakeUp
Line 321: Line 339:
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F3|#494949}} || battery || e0 71 e0 f1 || 236 || KEY_BATTERY || ibm/hotkey HKEY 00000080 00001003 || (none) || (none)
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F3|#494949}} || battery || e0 71 e0 f1 || 236 || KEY_BATTERY || ibm/hotkey HKEY 00000080 00001003 || (none) || (none)
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|F4|#494949}} || crescent moon || e0 5f e0 df || 142; 142 || KEY_SLEEP || ibm/hotkey HKEY 00000080 00001004 || (none) || XF86Sleep
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|F4|#494949}} || || e0 5f e0 df || 142; 142 || KEY_SLEEP || ibm/hotkey HKEY 00000080 00001004 || (none) || XF86Sleep
 
|-
 
|-
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F5|#494949}} || radiating computer || (none) || 385 || KEY_RADIO || ibm/hotkey HKEY 00000080 00001005 || (none) || (none)
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F5|#494949}} || radiating computer || (none) || 385 || KEY_RADIO || ibm/hotkey HKEY 00000080 00001005 || (none) || (none)
Line 331: Line 349:
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F8|#494949}} || trackpoint, line, trackpad || e0 79 e0 f9 || 192 || KEY_F22 || ibm/hotkey HKEY 00000080 00001008 || (none) || (none)
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F8|#494949}} || trackpoint, line, trackpad || e0 79 e0 f9 || 192 || KEY_F22 || ibm/hotkey HKEY 00000080 00001008 || (none) || (none)
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|F9|#494949}} || computer, eject symbol || 6f ef || 194 || KEY_F24 || ibm/hotkey HKEY 00000080 00001009 || (none) || (none)
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|F9|#494949}} || computer, || 6f ef || 194 || KEY_F24 || ibm/hotkey HKEY 00000080 00001009 || (none) || (none)
 
|-
 
|-
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F10|#494949}} || || e0 63 || 143 || (none) || (none) || (none) || XF86WakeUp
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F10|#494949}} || || e0 63 || 143 || (none) || (none) || (none) || XF86WakeUp
Line 339: Line 357:
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F12|#494949}} || screen, arrow, diskpack || e0 25 e0 a5 || 205 || KEY_SUSPEND || ibm/hotkey HKEY 00000080 0000100c || (none) || (none)
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|F12|#494949}} || screen, arrow, diskpack || e0 25 e0 a5 || 205 || KEY_SUSPEND || ibm/hotkey HKEY 00000080 0000100c || (none) || (none)
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|Home|#494949}} || sun, up arrow || e0 54 e0 d4 e0 54 e0 d4 || 225; 225 || KEY_BRIGHTNESSUP || ibm/hotkey HKEY 00000080 00001010, video LCD0 00000086 00000000 || (none) || XF86MonBrightnessUp
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|Home|#494949}} || ☀▴ || e0 54 e0 d4 e0 54 e0 d4 || 225; 225 || KEY_BRIGHTNESSUP || ibm/hotkey HKEY 00000080 00001010, video LCD0 00000086 00000000 || (none) || XF86MonBrightnessUp
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|End|#494949}} || sun, down arrow || e0 4c e0 cc e0 4c e0 cc || 224; 224 || KEY_BRIGHTNESSDOWN || ibm/hotkey HKEY 00000080 00001011, video LCD0 00000087 00000000 || (none) || XF86MonBrightnessDown
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|End|#494949}} || ☀▾ || e0 4c e0 cc e0 4c e0 cc || 224; 224 || KEY_BRIGHTNESSDOWN || ibm/hotkey HKEY 00000080 00001011, video LCD0 00000087 00000000 || (none) || XF86MonBrightnessDown
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|PgUp|#494949}} || illuminated lamp || (none) || (none) || (none) || (none) || (none) ||
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|PgUp|#494949}} || illuminated overhead lamp || (none) || (none) || (none) || (none) || (none) ||
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|Space|#494949}} || screen with hourglass ("zoom" symbol) || (none) || 372 || KEY_ZOOM || ibm/hotkey HKEY 00000080 00001014 || (none) || (none)
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|Space|#494949}} || screen with magnifying glass ("zoom" symbol) || (none) || 372 || KEY_ZOOM || ibm/hotkey HKEY 00000080 00001014 || (none) || (none)
 
|-
 
|-
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|→|#494949}} || barred right arrowhead ("next" symbol) || e0 19 e0 99 || 163 || (none) || (none) || 171 || XF86AudioNext
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|→|#494949}} || barred right arrowhead ("next" symbol) || e0 19 e0 99 || 163 || (none) || (none) || 171 || XF86AudioNext
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|↓|#494949}} || right arrowhead ("play" symbol) || e0 63 e0 e3 || 164 || (none) || (none) || 172 || XF86AudioPlay
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|↓|#494949}} || right arrowhead, double bar ("play/pause" symbol) || e0 63 e0 e3 || 164 || (none) || (none) || 172 || XF86AudioPlay
 
|-
 
|-
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|←|#494949}} || barred left arrowhead ("prev" symbol) || e0 10 e0 90 || 165 || (none) || (none) || 173 || XF86AudioPrev
 
| {{ibmkey|Fn|#494949}}-{{ibmkey|←|#494949}} || barred left arrowhead ("prev" symbol) || e0 10 e0 90 || 165 || (none) || (none) || 173 || XF86AudioPrev
 
|-
 
|-
| {{ibmkey|Fn|#494949}}-{{ibmkey|↑|#494949}} || square ("stop play" symbol) || e0 24 e0 a4 || 166 || (none) || (none) || 174 || XF86AudioStop
+
| {{ibmkey|Fn|#494949}}-{{ibmkey|↑|#494949}} || ("stop play" symbol) || e0 24 e0 a4 || 166 || (none) || (none) || 174 || XF86AudioStop
 
|-
 
|-
 
| {{ibmkey|◂⎗|#494949}} (left arrowhead, page icon) || || e0 6a e0 ea || 158 || (none) || (none) || 166 || XF86Back
 
| {{ibmkey|◂⎗|#494949}} (left arrowhead, page icon) || || e0 6a e0 ea || 158 || (none) || (none) || 166 || XF86Back
Line 373: Line 391:
  
 
Compare [[Default meanings of special keys]].
 
Compare [[Default meanings of special keys]].
 +
 +
== Suspend and resume ==
 +
I had hoped that with Ubuntu I would be able to suspend and resume the X61, but I was disappointed.
 +
Presumably because of flaws in the <tt>ath5k</tt> driver, discussed below, the machine often hangs after resume.
  
 
== Networking ==
 
== Networking ==
 
=== Atheros AR5212 801.11 abg Wi-Fi card doesn't resume ===
 
=== Atheros AR5212 801.11 abg Wi-Fi card doesn't resume ===
 
This problem in Intrepid is confirmed fixed in Jaunty.
 
  
 
Workaround for Intrepid: Add to /usr/lib/pm-utils/sleep.d/10NetworkManager:
 
Workaround for Intrepid: Add to /usr/lib/pm-utils/sleep.d/10NetworkManager:
Line 386: Line 406:
 
</pre>
 
</pre>
  
Note that this file disappears on upgrade to Jaunty.
+
This file disappears on upgrade to Jaunty.
 +
 
 +
In Jaunty the above problem does not occur.  But there is a new problem.  Sometimes the Atheros is braindead after resume.  Reloading <tt>ath5k</tt> doesn't help.  One has to cold-reboot.
  
Bug reported: https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules/+bug/275692
+
Bugs reported:
 +
* https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules/+bug/269253
 +
* https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules/+bug/341627
  
 
=== Getting the Wi-Fi LED to flicker (with Atheros AR5212 801.11 abg Wi-Fi) ===
 
=== Getting the Wi-Fi LED to flicker (with Atheros AR5212 801.11 abg Wi-Fi) ===
Line 408: Line 432:
  
 
== Sound and video ==
 
== Sound and video ==
 +
 +
=== No beep ===
 +
Solution:
 +
* Open Volume Control (e.g., right click on loudspeaker icon in the panel and select "Open Volume Control").
 +
* In Preferences, select "Beep" in "tracks to be visible" list.  Close.
 +
* On Playback tab, unmute Beep and raise its volume control.
 +
 
=== Sound too quiet ===
 
=== Sound too quiet ===
  
The [http://www.thinkwiki.org/wiki/Installing_Ubuntu_8.10_(Intrepid_Ibex)_on_a_ThinkPad_T61#Sound_.28too_quiet.29 problem of sound being too quiet in Hardy] is not present in Intrepid.
+
The [http://www.thinkwiki.org/wiki/Installing_Ubuntu_8.10_(Intrepid_Ibex)_on_a_ThinkPad_T61#Sound_.28too_quiet.29 problem of sound being too quiet in Hardy] does not appear to be present in Intrepid.
  
 
=== Sound crackles ===
 
=== Sound crackles ===
Line 424: Line 455:
  
 
Bug reported: https://bugs.launchpad.net/ubuntu/+source/screen-resolution-extra/+bug/337427
 
Bug reported: https://bugs.launchpad.net/ubuntu/+source/screen-resolution-extra/+bug/337427
 +
 +
This problem seems (21 April 2009) to have been fixed during the runup to the release of Jaunty.
  
 
=== compiz and dual-head ===
 
=== compiz and dual-head ===
Line 481: Line 514:
 
Ref: http://marc.info/?l=linux-thinkpad&m=123180105228016&w=2
 
Ref: http://marc.info/?l=linux-thinkpad&m=123180105228016&w=2
  
 +
[[Category:Ubuntu]]
 
[[Category:Ubuntu 8.10]]
 
[[Category:Ubuntu 8.10]]
 
[[Category:Ubuntu 9.04]]
 
[[Category:Ubuntu 9.04]]

Latest revision as of 14:58, 21 July 2010

I installed Ubuntu 8.10 on a ThinkPad X61 model 7673-CTO.

Some available accessories for this model

DMI info for this model

# dmidecode -s system-manufacturer
LENOVO
# dmidecode -s system-product-name
7673CTO
# dmidecode -s system-version
ThinkPad X61

glxgears output

$ glxgears
3581 frames in 5.0 seconds = 716.195 FPS
3704 frames in 5.0 seconds = 740.681 FPS
3687 frames in 5.0 seconds = 737.260 FPS
3601 frames in 5.0 seconds = 720.102 FPS

tp_smapi and hdaps

The tp_smapi package includes the tp_smapi driver and the customized hdaps driver.

To have the tp_smapi and hdaps_ec modules loaded on boot, add the lines

tp_smapi
hdaps_ec

to the /etc/modules file.

Version 0.37 of tp_smapi is included in Ubuntu Jaunty (in the linux-image-2.6.28-11-generic package).

Version 0.40 is available upstream.

The 0.40 version makes the following /sys files available:

$ cd /sys/devices/platform/smapi
$ ls -aF *
ac_connected  driver@  modalias  smapi_request  subsystem@  uevent

BAT0:
.                     current_avg      first_use_date   inhibit_charge_minutes  power_avg                remaining_running_time      temperature
..                    current_now      force_discharge  installed               power_now                remaining_running_time_now  voltage
barcoding             cycle_count      group0_voltage   last_full_capacity      remaining_capacity       serial
charging_max_current  design_capacity  group1_voltage   manufacture_date        remaining_charging_time  start_charge_thresh
charging_max_voltage  design_voltage   group2_voltage   manufacturer            remaining_percent        state
chemistry             dump             group3_voltage   model                   remaining_percent_error  stop_charge_thresh

BAT1:
.                     current_avg      first_use_date   inhibit_charge_minutes  power_avg                remaining_running_time      temperature
..                    current_now      force_discharge  installed               power_now                remaining_running_time_now  voltage
barcoding             cycle_count      group0_voltage   last_full_capacity      remaining_capacity       serial
charging_max_current  design_capacity  group1_voltage   manufacture_date        remaining_charging_time  start_charge_thresh
charging_max_voltage  design_voltage   group2_voltage   manufacturer            remaining_percent        state
chemistry             dump             group3_voltage   model                   remaining_percent_error  stop_charge_thresh

driver:
.  ..  bind  module  smapi  uevent  unbind

power:
.  ..  wakeup

subsystem:
.  ..  devices  drivers  drivers_autoprobe  drivers_probe  uevent

tp_smapi

tp_smapi allows ThinkPad battery charging to be controlled.

To set charge thresholds that are kinder to lithium ion batteries:

# cd /etc/init.d
# cat <<EOF >tp-smapi
#!/bin/sh
case "$1" in
  start)
	echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
	echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
	;;
esac
EOF
# chmod ugo+x tp-smapi
# update-rc.d tp-smapi start 90 S .

hdaps

Can't load the standard Ubuntu hdaps module

# modprobe hdaps
FATAL: Error inserting hdaps (/lib/modules/2.6.27-11-generic/kernel/drivers/hwmon/hdaps.ko): No such device or address
# rmmod thinkpad_ec
# modprobe hdaps
#

The hdaps and the thinkpad_ec modules shipped in Intrepid and Jaunty (4 March 2009) conflict with each other. Either one can be loaded in the absence of the other. This is mentioned on the tp_smapi page.

With the hdaps module loaded, hdapsd prints an error message:

Setting up hdapsd (1:0.0.20070803-2) ...
 * Not starting hdapsd: /sys/block/hda/queue/protect does not exist,
 please read /usr/share/doc/hdapsd/README.Debian

The mentioned file says:

hdapsd needs the hdaps kernel module and the hdaps_protect patch
in the kernel so it WON'T work out-of-the-box on a Debian machine yet.
Look at http://thinkwiki.org/wiki/HDAPS for additional information.

Bottom line: The newer version of the hdaps driver furnished by the tp_smapi project is needed but neither Intrepid nor Jaunty (4 March 2009) includes this driver.

Bug reported: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/297213

Workaround

Install the tp_smapi and hdaps drivers built from the upstream sources. First install the Linux headers and necessary kernel build tools and download the tp_smapi tarball. Then:

$ tar xzvf tp_smapi-0.40.tgz
$ cd tp_smapi-0.40
$ sudo make load HDAPS=1
$ lsmod|head -4
Module                  Size  Used by
hdaps                  18648  0 
tp_smapi               29712  0 
thinkpad_ec            15000  2 hdaps,tp_smapi

hdaps at work

The image below shows hdaps-gl correctly portraying the spatial orientation of the laptop.

HDAPS working on ThinkPad X61.jpg

$ cd /sys/devices/platform/hdaps
$ ls -aF
./         invert             oversampling_ratio        sampling_rate
../        keyboard_activity  position                  subsystem@
calibrate  modalias           power/                    temp1
driver@    mouse_activity     running_avg_filter_order  uevent
$ cat invert
6

Docking

I had hoped that with Ubuntu I would be able to dock and undock the X61, but I was disappointed.

Hard freeze on undock from UltraBase

The ThinkPad X61 can be docked in the UltraBase X6 which has an Ultrabay Slim into which an optical drive can be installed such as the Ultrabay Slim Multi-Burner III Drive.

If the X61 is removed from the UltraBase then the X61 freezes, presumably because the kernel can no longer see the optical drive.

A sufficient solution is to "delete" the optical drive before undocking.

echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete

It doesn't seem to be necessary or even helpful to write to other files such as /sys/devices/platform/dock.0 or /proc/acpi/ibm/bay as some suggest.

However, it does seem to be necessary to delete the optical drive before pressing the "undock" button on the UltraBase X6.

After reattaching the UltraBase, this:

echo 0 0 0 > /sys/class/scsi_host/host1/scan

causes the kernel to notice the optical drive again.

Note that it is possible that the device number be something other than 1:0:0:0. Do, e.g.,

ls -l /sys/class/scsi_device/*:0:0:0/device/delete

to check.

Refs:

Bug reported: https://bugs.launchpad.net/ubuntu/+bug/242638

No /proc/acpi/ibm/dock

The file /proc/acpi/ibm/dock does not exist even though the thinkpad-acpi module is loaded and the X61 is booted while docked in the UltraBase X6. So, instructions in the thinkpad-acpi README and elsewhere that make reference to this file cannot be followed.

/sys/devices/platform/dock.0

There is a /sys/devices/platform/dock.0 directory with:

# cd /sys/devices/platform/dock.0
# ls -al
total 0
drwxr-xr-x  3 root root    0 2009-03-01 17:22 .
drwxr-xr-x 13 root root    0 2009-03-01 17:22 ..
-r--r--r--  1 root root 4096 2009-03-01 17:22 docked
-r--r--r--  1 root root 4096 2009-03-01 17:28 flags
-r--r--r--  1 root root 4096 2009-03-01 17:28 modalias
drwxr-xr-x  2 root root    0 2009-03-01 17:28 power
lrwxrwxrwx  1 root root    0 2009-03-01 17:22 subsystem -> ../../../bus/platform
-rw-r--r--  1 root root 4096 2009-03-01 17:22 uevent
-r--r--r--  1 root root 4096 2009-03-01 17:28 uid
--w-------  1 root root 4096 2009-03-01 17:28 undock

When not docked:

# cat /sys/devices/platform/dock.0/docked
0

When docked:

# cat /sys/devices/platform/dock.0/docked
1

In Jaunty at least, doing

echo 1 > /sys/devices/platform/dock.0/undock

does strange things. The first time I tried it it logged me out of GNOME but did not disconnect the external monitor connected to the dock. After I logged back in, the same command did cause the disconnection of the external monitor.

/proc/acpi/ibm/bay

When the thinkpad_acpi module is loaded there is a /proc/acpi/ibm/bay file with the following contents (with the X61 docked in the UltraBase X6 with a Ultrabay Slim Multi-Burner III Drive in the Ultrabay Slim port).

# cat bay
status:         occupied
commands:       eject

Doing

echo eject > /proc/acpi/ibm/bay

after

echo 1 >  /sys/class/scsi_device/1:0:0:0/device/delete

causes the light on the drive in the Ultrabay Slim to go out.

Doing the "eject" without first doing the "delete" mentioned earlier causes a system hang.

dock and bay modules

In Intrepid the lsmod command reveals that the dock and bay modules are loaded.

In Jaunty these modules are no longer present.

  • In Linux 2.6.28 the bay driver code was incorporated into the dock driver.
  • In Jaunty the dock driver is built integrally rather than modularly.
$ cd /boot
$ grep DOCK config*
config-2.6.27-11-generic:CONFIG_ACPI_DOCK=m
config-2.6.28-11-generic:CONFIG_ACPI_DOCK=y

Do something on undock and dock

To arrange for some action to be taken on undock and dock, add an /etc/udev/rules.d/55-thinkpad-local.rules file containing the following

KERNEL=="dock.0", ATTR{docked}=="1", RUN+="/etc/thinkpad/dock.sh 1"
KERNEL=="dock.0", ATTR{docked}=="0", RUN+="/etc/thinkpad/dock.sh 0"

and add an /etc/thinkpad/dock.sh file containing something like the following:

#!/bin/sh
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
echo Docked: $DOCKED | logger -t $0
case "$DOCKED" in
        "0")
                # Do something
                ;;
        "1")
                # Do something else
                ;;
esac

Ref: http://marc.info/?l=linux-thinkpad&m=123416226107039&w=2

Keys

ThinkVantage and Zoom keys not seen by X

The ThinkVantage and Zoom keys are seen and reported by ACPI.

$ acpi_listen
ibm/hotkey HKEY 00000080 00001018
ibm/hotkey HKEY 00000080 00001014

They are seen and reported by input-events as KEY_VENDOR and KEY_ZOOM which according to /usr/include/linux/input.h have the values 0x168 and 0x174, respectively.

They are seen by showkey as having keycodes 0x168 (360 in decimal) and 0x174 (372 in decimal) respectively.

But, in Intrepid, they aren't seen by xev.

In Jaunty (4 March 2009) the ThinkVantage key is seen by xev but the Zoom key still is not.

Steve Langasek wrote on Ubuntu bug report log 217504:
X can only handly 256 distinct keycodes due to a protocol limitation, and due to evdev the keycodes are now standardized to match the Linux input layer - with no keycode below 256 that could reasonably be substituted for KEY_ZOOM. As a workaround, you can add your own fdi file to /etc/hal/fdi/information that maps this key to a different keycode (see /usr/share/hal/fdi/information/10freedesktop/30-keymap-module-thinkpad-acpi.fdi for an example of how this is currently done).

Refs:

Bug reported: https://bugs.launchpad.net/ubuntu/hardy/+source/linux/+bug/217504/

Fn-F5 emits KEY_RADIO instead of KEY_WLAN

Bug reported: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504643

Table of keycodes for special keys and key combinations

While investigating the above problem I researched what key codes the various special keys and key combinations generate on this ThinkPad using various tools. The observations (which haven't been double-checked yet) are summarized in the following table. The ThinkVantage key is only seen by xev in Jaunty, not in Intrepid.

Key combination Extra function symbol Scan code
(showkey -s)
(hex)
Key code
(showkey -k)
Input event
(input-events)
ACPI event
(acpi_listen)
X event
(xev)
Keyboard Shortcuts name
⟦◁̸ (loudspeaker icon with stroke) e0 20 e0 a0 113 (none) (none) 121 XF86AudioMute
⟦◁▾ (loudspeaker icon, down arrow) e0 2e e0 ae 114 (none) (none) 122 XF86AudioLowerVolume
⟦◁▴ (loudspeaker icon, up arrow) e0 30 e0 b0 115 (none) (none) 123 XF86AudioRaiseVolume
ThinkVantage e0 1f e0 9f 360 KEY_VENDOR ibm/hotkey HKEY 00000080 00001018 156 XF86Launch1
Fn e0 63 e0 e3 143 (none) 151 XF86WakeUp
Fn-F1 (none) 466 KEY_FN_F1 ibm/hotkey HKEY 00000080 00001001 (none) (none)
Fn-F2 padlock e0 12 e0 92 152 KEY_SCREENLOCK ibm/hotkey HKEY 00000080 00001002 (none) XF86ScreenSaver
Fn-F3 battery e0 71 e0 f1 236 KEY_BATTERY ibm/hotkey HKEY 00000080 00001003 (none) (none)
Fn-F4 e0 5f e0 df 142; 142 KEY_SLEEP ibm/hotkey HKEY 00000080 00001004 (none) XF86Sleep
Fn-F5 radiating computer (none) 385 KEY_RADIO ibm/hotkey HKEY 00000080 00001005 (none) (none)
Fn-F6 (none) 471 KEY_FN_F6 ibm/hotkey HKEY 00000080 00001006 (none) (none)
Fn-F7 screen, line, computer e0 56 e0 d6 227 KEY_SWITCHVIDEOMODE ibm/hotkey HKEY 00000080 00001007 (none) (none)
Fn-F8 trackpoint, line, trackpad e0 79 e0 f9 192 KEY_F22 ibm/hotkey HKEY 00000080 00001008 (none) (none)
Fn-F9 computer, ⏏ 6f ef 194 KEY_F24 ibm/hotkey HKEY 00000080 00001009 (none) (none)
Fn-F10 e0 63 143 (none) (none) (none) XF86WakeUp
Fn-F11 (none) 476 KEY_FN_F11 ibm/hotkey HKEY 00000080 0000100b (none) (none)
Fn-F12 screen, arrow, diskpack e0 25 e0 a5 205 KEY_SUSPEND ibm/hotkey HKEY 00000080 0000100c (none) (none)
Fn-Home ☀▴ e0 54 e0 d4 e0 54 e0 d4 225; 225 KEY_BRIGHTNESSUP ibm/hotkey HKEY 00000080 00001010, video LCD0 00000086 00000000 (none) XF86MonBrightnessUp
Fn-End ☀▾ e0 4c e0 cc e0 4c e0 cc 224; 224 KEY_BRIGHTNESSDOWN ibm/hotkey HKEY 00000080 00001011, video LCD0 00000087 00000000 (none) XF86MonBrightnessDown
Fn-PgUp illuminated overhead lamp (none) (none) (none) (none) (none)
Fn-Space screen with magnifying glass ("zoom" symbol) (none) 372 KEY_ZOOM ibm/hotkey HKEY 00000080 00001014 (none) (none)
Fn- barred right arrowhead ("next" symbol) e0 19 e0 99 163 (none) (none) 171 XF86AudioNext
Fn- right arrowhead, double bar ("play/pause" symbol) e0 63 e0 e3 164 (none) (none) 172 XF86AudioPlay
Fn- barred left arrowhead ("prev" symbol) e0 10 e0 90 165 (none) (none) 173 XF86AudioPrev
Fn- ∎ ("stop play" symbol) e0 24 e0 a4 166 (none) (none) 174 XF86AudioStop
◂⎗ (left arrowhead, page icon) e0 6a e0 ea 158 (none) (none) 166 XF86Back
⎘▸ (page icon, right arrowhead) e0 69 e0 e9 159 (none) (none) 167 XF86Forward

Hotkey mask when the above table was compiled:

$ cat /sys/devices/platform/thinkpad_acpi/hotkey_mask
0x00fdffff
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_all_mask
0x00ffffff
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_recommended_mask
0x008c7fff
$ cat /sys/devices/platform/thinkpad_acpi/hotkey_report_mode
1

Compare Default meanings of special keys.

Suspend and resume

I had hoped that with Ubuntu I would be able to suspend and resume the X61, but I was disappointed. Presumably because of flaws in the ath5k driver, discussed below, the machine often hangs after resume.

Networking

Atheros AR5212 801.11 abg Wi-Fi card doesn't resume

Workaround for Intrepid: Add to /usr/lib/pm-utils/sleep.d/10NetworkManager:

 	thaw|resume)
+		ifconfig wifi0 up
 		resume_nm

This file disappears on upgrade to Jaunty.

In Jaunty the above problem does not occur. But there is a new problem. Sometimes the Atheros is braindead after resume. Reloading ath5k doesn't help. One has to cold-reboot.

Bugs reported:

Getting the Wi-Fi LED to flicker (with Atheros AR5212 801.11 abg Wi-Fi)

For Intrepid, add the following lines to /etc/sysctl.conf and reboot:

dev.wifi0.ledpin=1
dev.wifi0.softled=1

This does not work for Jaunty. In Jaunty there is no longer a Wi-Fi interface named wifi0; now there are interfaces wlan0 and wmaster0. Solution still being sought....

Network-manager slow to reconnect

Present in Intrepid.

Seemingly fixed in Jaunty.

Bug reported: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/247381

Sound and video

No beep

Solution:

  • Open Volume Control (e.g., right click on loudspeaker icon in the panel and select "Open Volume Control").
  • In Preferences, select "Beep" in "tracks to be visible" list. Close.
  • On Playback tab, unmute Beep and raise its volume control.

Sound too quiet

The problem of sound being too quiet in Hardy does not appear to be present in Intrepid.

Sound crackles

In Jaunty (4 March 2009) the welcome jingle crackles.

This problem did not affect Intrepid.

Forgets screen resolution

In Jaunty (4 March 2009) when one logs back in, dual heads are always mirrored even if they have been configured previously. Resetting or restoring the configuration does not always fully succeed and the display is not always redrawn correctly.

Suspending and resuming sometimes fixes the problem.

Bug reported: https://bugs.launchpad.net/ubuntu/+source/screen-resolution-extra/+bug/337427

This problem seems (21 April 2009) to have been fixed during the runup to the release of Jaunty.

compiz and dual-head

The Intel Graphics Media Accelerator X3100 is limited to a maximum 3D texture size of 2048 × 2048.

$ glxinfo -l 2>/dev/null | grep GL_MAX_TEXTURE_SIZE | sed 's/.*=[^0-9]//g'
2048

This means that compiz visual effects can only be enabled if the virtual screen area is 2048 wide/high or less. This means that if one has an external display with a width greater than 1024 pixels, it can't be located beside the laptop display if you want wobbly windows and such. E.g., a 1680 × 1050 monitor beside the X61's 1024 × 768 LCD panel would require a virtual screen that is at least 2704 pixels wide.

A wide external display can be placed above or below the laptop display, however. E.g., the above monitor placed "above" the laptop panel requires a virtual screen height of 1818 pixels. ("Above" here of course just refers to the relative position set in System | Preferences | Screen Resolution.)

compiz-check

jdthood@triffid:/usr/local/sbin$ wget http://www.blogage.de/files/9124/download -O compiz-check
jdthood@triffid:/usr/local/sbin$  ./compiz-check 

Gathering information about your system...

 Distribution:          Ubuntu 9.04
 Desktop environment:   GNOME
 Graphics chip:         Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
 Driver in use:         intel
 Rendering method:      AIGLX

Checking if it's possible to run Compiz on your system...

 Checking for texture_from_pixmap...               [ OK ]
 Checking for non power of two support...          [ OK ]
 Checking for composite extension...               [ OK ]
 Checking for FBConfig...                          [ OK ]
 Checking for hardware/setup problems...           [WARN]

Something potential problematic has been detected with your setup:
 Warning: PCI ID 8086:2a02 detected. 

Would you like to know more? (Y/n) y

 Your particular graphics chip may be blacklisted on certain distributions.
 However that does not necessarily mean you will not be able to run Compiz.

 You can skip this blacklist -- but keep in mind that you did so.
 Do not complain if you encounter any problems with Compiz afterwards. 

Do you want to skip blacklist checks by Compiz? (y/N) 

Movies jitter

Ref: http://marc.info/?l=linux-thinkpad&m=123180105228016&w=2