Installing Ubuntu 8.04 (Hardy Heron) on a ThinkPad T60

From ThinkWiki
Revision as of 22:55, 16 September 2008 by AlienMind (Talk | contribs) (Active Protection System (Reduced Power Version))
Jump to: navigation, search

Features

Open Source Intel Wifi Driver

Intel has created a new Linux Wifi driver project for Intel Wireless cards, "Iwlwifi". This driver is Open Source and no longer requires the Intel daemon to run in addition. This project will support the T60's Wifi 3945ABG network adapter.

Automatic migration should occur when upgrading from Ubuntu 7.10 to Ubuntu 8.04. After the upgrade you can check to see if the iwlwifi driver is running by:

 $ modprobe -l | grep iwlwifi
 /lib/modules/2.6.24-16-generic/ubuntu/wireless/iwlwifi/iwlwifi/compatible/iwl4965.ko
 /lib/modules/2.6.24-16-generic/ubuntu/wireless/iwlwifi/iwlwifi/compatible/iwl3945.ko
 /lib/modules/2.6.24-16-generic/ubuntu/wireless/iwlwifi/mac80211/compatible/net/mac80211/iwlwifi_mac80211.ko
 /lib/modules/2.6.24-16-generic/ubuntu/wireless/iwlwifi/mac80211/compatible/net/mac80211/iwlwifi_rc80211_simple.ko

If it does not and a migration is desired, Ubuntu Help Community has written some documentation that will make this very easy to do.

You may have trouble connecting to some access points as described in this bug report. I was connecting with WPA2 just fine at home and then went away on a trip and couldn't connect to an unencrypted network! The fix as described there is to install the linux-backports-modules-hardy package, which contains an updated driver.

Increased power savings

This release includes Linux-2.6.24, which has dynticks support. The power savings that have been available to 32-bit systems are now brought to 64-bit systems. This will have an effect on those T60 laptops with an Intel Core 2 Duo (Merom). To get the most of dynticks it is a good idea to install powertop with $ sudo aptitude install powertop and take the advice it gives when you invoke it. Powertop may recommend that you use SATA Link Power Management, in which case you'll want this script to avoid long delays when resuming from suspend.

More information on power saving is available at http://www.lesswatts.org.

Installation

my thinkpad: T60 with Intel Graphics Media Accelerator 950 (WXSGA 1680x1050 display), atheros wireless card, 2GHz Intel Core 2 Duo (Merom).

 poliahu $ lspci
 00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory   Controller Hub (rev 03)
 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
 00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
 00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
 00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
 00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)
 00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02)
 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
 02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
 03:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
 15:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
 poliahu $ 


I booted on the Hardy Heron alpha 4 liveCD and installed from there on a 5GB primary ext3 partition. No problem whatsoever during liveCD session and install. Everything went smooth. I have my home on a separate partition of course, and I created a "hardy" user just to play around.

Known Issues

EXA issues with intel graphic card driver (945, 965)

Hardy comes with the newest Xorg:

 root@poliahu:/# Xorg -version
 This is a pre-release version of the X server from The X.Org Foundation.
 It is not supported in any way.
 Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
 Select the "xorg" product for bugs you find in this release.
 Before reporting bugs in pre-release versions please check the
 latest version in the X.Org Foundation git repository.
 See http://wiki.x.org/wiki/GitPage for git access instructions.
 X.Org X Server 1.4.0.90
 Release Date: 5 September 2007
 X Protocol Version 11, Revision 0
 Build Operating System: Linux Ubuntu (xorg-server 2:1.4.1~git20080131-1ubuntu3)
 Current Operating System: Linux poliahu 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686
 Build Date: 19 February 2008  04:52:29PM
       Before reporting problems, check http://wiki.x.org
       to make sure that you have the latest version.
 Module Loader present
 root@poliahu:/# 

and with X autoconfiguration (as far as I understand). So hardy installs a xorg.conf, but it is barebones. Most of the config is handled internally by the new server, and is handled fairly well. My screen and card were recognized, it configured it with the correct driver and resolution. I had 3D accel out of the box too, so that compiz was working without any tinkering. All good up to there.

The only problems I encountered in X (once more, this is only applicable to intel graphic hardware) were

(1) the trackpad was working but the scroll function was not (in previous version of ubuntu, moving your finger up and down in the right part of the trackpad would provide this functionality, here not). This is apparently a known regression (can't find the reference, but read it in some launchpad or ubuntu forum post). As it is a known regression, I assume it will be fixed for the final hardy release (?).

(2) The intel driver config adopted by default by the new xorg uses EXA acceleration, which is newer and performs overall better than the XAA. The problem is that on some intel hardware, it performs quite poorly for text processing. I noticed that immediately: when I had no window, or only a terminal around, compiz would be its usual smooth (e.g. when rotating cube or moving windows). With a few windows open, with text (e.g. firefox), compiz would be very jumpy / choppy. Copying over the xorg.conf form my gutsy installation and adding:

   Option "AccelMethod" "XAA"

in the "Device" section (where the video intel driver is specified) solved the problem, and now I'm back to the old smooth compiz animations.

Using this -otherwise unmodified xorg.conf- had the side effect of killing my trackpad entirely. Now It's not responsive at all. Again, I expect these things will be ironed out for the final release. Another possibility would be to only add the XAA AccelMethod in the existing xorg.conf (hardy default), but I did not know nor researched how to do that.

[update 2008feb23: https://bugs.launchpad.net/xserver-xorg-video-intel/+bug/177492 describe the above problem. It turns out that there is another solution, keeping EXA. Keep the stock xorg.conf (the barebone one installed by default with hardy -clean install-. Just add:

 Option "AccelMethod" "EXA"
 Option "ExaNoComposite" "false"
 Option "MigrationHeuristic" "greedy"

in the Section "Device" (so don't put XAA). With these settings, acceleration is smooth across the board (including wiht fonts) and compiz works like a charm. Cherry on the pie: you'll have XV (hardware video), so this means nice and smooth DVD and movie playing, much lighter cpu load, etc... compared to the x11 (software) video driver. As an extra, you can also use the INTEL_BATCH flag, which was reported by the vast majority of intel users to speed up graphical performance significantly (30%+). Put

 INTEL_BATCH="1"

in your /etc/environment (I read you can also put it in your .bashrc, but I didn't try that). end update 2008feb23]

Multimedia keys don't work with Exaile

Another problem I noticed was that the multimedia keys were not operating in exaile. I haven't tested them in rhythmbox or other apps.

Apart from that, everything I tested was fine: display, network (wired and wireless), sound (pulseaudio sounds noticeably better, but may be it's self induced), suspend (which worked for a couple of tests, and then I installed uswsusp -s2ram- 0.8, which has always been more reliable for me), haven't tried hibernate, nor bluetooth.

Intermittent hard hangs

I've had a problem with the entire system locking up when logged in, where only a cold boot would bring it back. It would happen regularly overnight, and occasionally during the day (while using it). The daytime hangs seem to be related to heavy wired network use. The night hangs may be when /etc/cron.daily/apt runs, but that's just a guess.

It looks like this is a problem with the L1 ASPM power savings of the Intel ethernet chip, after disabling ASPM I have not had another hang. To fix follow the suggestions at Ubuntu Bug#230847 and Network Fix For Various Notebooks With Intel 82573l

Post-Installation Setup

Active Protection System (Reduced Power Version)

Hardy has tp_smapi enabled by the default, enabling information of the accelerometers in /sys filesystem. The module is actually called hdaps_ec and should be enabled by manually appending to /etc/modules:

 # echo "hdaps_ec" >> /etc/modules

However, in order to fully take advantage of it you should build a custom kernel patched with hdaps_protect, that enables /sys/block/sda/queue/protect

The following commands will generate these files (2008-09-16):

 linux-headers-2.6.24-19-generic_2.6.24-19.41_amd64.deb
 linux-image-2.6.24-19-generic_2.6.24-19.41_amd64.deb
 linux-image-debug-2.6.24-19-generic_2.6.24-19.41_amd64.deb
 linux-restricted-modules-2.6.24-19-generic_2.6.24.13-19.45_amd64.deb
 linux-ubuntu-modules-2.6.24-19-generic_2.6.24-19.28_amd64.deb

Note: This procedure has been tested in x86_64 (amd64), Ubuntu 8.04.1 64 bits. Packages for 32 bits could be made by issuing commands with "i386" instead "amd64".

First you need to get the hdapsd disk-protect patch: [1] and [2]

Updated versions are supposed to be posted in [3].

Then get the kernel source:

$ sudo apt-get build-dep linux-source-2.6.24
$ apt-get source linux-source-2.6.24
$ cd linux-2.6.24

Patch the kernel (some "hunk succeeded" warnings should be OK)

$ patch -p1 < ../disk-protect-2.6.24-rc3.patch

The second patch is intended for stability, but IMHO a nasty deadlock could be still there:

$ patch -p1 < ../adjust-blocked-counters.patch

Rebuild kernel config:

$ chmod 755 debian/scripts/misc/splitconfig.pl
$ chmod 755 debian/scripts/misc/oldconfig
$ debian/scripts/misc/oldconfig amd64 # Use i386 for 32bits

Now build the kernel:

$ sudo apt-get install fakeroot
$ AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic
$ cd ..

And install the kernel headers:

$ sudo dpkg -i linux-headers-2.6.24-19-generic_2.6.24-19.41_amd64.deb

Get ubuntu modules source:

$ sudo apt-get build-dep linux-ubuntu-modules-2.6.24
$ apt-get source linux-ubuntu-modules-2.6.24
$ cd linux-ubuntu-modules-2.6.24-2.6.24

Create a dummy control file entry:

$ debian/rules debian/control

Build the ubuntu modules:

$ fakeroot debian/rules binary-debs flavours=generic
$ cd ..

Get restricted modules source:

$ sudo apt-get build-dep linux-restricted-modules-common
$ apt-get source linux-restricted-modules-common
$ cd linux-restricted-modules-2.6.24-2.6.24.13/

Create a dummy control file entry:

$ debian/rules debian/control

Build the restricted modules:

$ fakeroot debian/rules binary-debs flavours=2.6.24-19-generic ati_flavours=2.6.24-19-generic nv_flavours=2.6.24-19-generic
$ cd ..

Install the kernel and the modules:

$ sudo dpkg -i \
   linux-restricted-modules-2.6.24-19-generic_2.6.24.13-19.45_amd64.deb \
   linux-ubuntu-modules-2.6.24-19-generic_2.6.24-19.28_amd64.deb \
   linux-image-2.6.24-19-generic_2.6.24-19.41_amd64.deb 

Add the modules to /etc/modules:

 echo "hdaps_ec" >> /etc/modules

Update ramdisk:

 update-initramfs -u

Install hdaps utils:

 sudo apt-get install hdapsd hdaps-utils

Edit /etc/default/hdapsd. Change:

 DISK="hda"

To:

 DISK="sda"
 

Add udev rules for /dev/input/hdaps/accelerometer-event (needed for hdapsd):

 echo 'KERNEL=="event[0-9]*", ATTRS{phys}=="hdaps/input1", \
 ATTRS{modalias}=="input:b0019v1014p5054e4801-*", \
 SYMLINK+="input/hdaps/accelerometer-event"' > /etc/udev/rules.d/51-hdaps.rules

Optional: Sometimes hdapsd loads CPU at 100%. This dirty trick worked for me: In /etc/rc.local add the following lines:

 rmmod hdaps || true
 rmmod hdaps_ec || true
 /etc/init.d/hdapsd stop || true
 modprobe hdaps_ec
 /etc/init.d/hdapsd start || true
 echo "1" > /sys/block/sda/queue/protect 

Reboot!!! ;-)


GNOME HDAPS Panel

A very useful applet to monitor the state of HDAPS:

Get the code:

 wget http://www.zen24593.zen.co.uk/hdaps/gnome-hdaps-applet-20080913.tar.gz

Get the needed libraries:

 sudo aptitude install libpanelappletmm-2.6-dev libpanelappletmm-2.6-1c2

Uncompress:

 mkdir gnome-hdaps-applet ; cd gnome-hdaps-applet ; tar -xzvf ../gnome-hdaps-applet-20080913.tar.gz

Build:

 gcc $(pkg-config --cflags --libs libpanelapplet-2.0) -o gnome-hdaps-applet gnome-hdaps-applet.c

Install:

 sudo cp -p gnome-hdaps-applet /usr/bin/
 sudo cp -p *.png /usr/share/pixmaps/gnome-hdaps-applet/
 sudo cp GNOME_HDAPS_StatusApplet.server /usr/lib/bonobo/servers/

Restart GNOME and you should find the "HDAPS Status" applet in the "Add to Panel" dialog

Notes

See also

References

External links