Installing Debian squeeze on Lenovo B560 (fixing touchpad and internal microphone issues)

Having installed Debian squeeze on my Lenovo B560 I ran into a couple of problems:

  • the touchpad refused to work (cursor jumped all over the screen and spurious clicks happened)
  • the internal microphone didn't work

Actually both of this problems (as I now know) are already fixed in recent versions of linux kernel (for the touchpad problem) and alsa drivers (for the microphone problem). So what I needed was to update the specified components but I didn't want to switch to testing (testing actually don't have the fixes ) or unstable and I decided to update only the broken components manually.

My solution is not perfect because later upgrades of kernel will overwrite the changes I made, so if you choose to follow me, please remember about this potential problem and make a note for yourself about this. (This is partly what pushed me to write this post). You'll have to repeat these procedure in case you upgrade kernel or alsa packages (after alsa updates you will not have to rebuild everything, just watch carefully what was updated, but kernel updates will require you to repeat all the steps)

Trying to fix touchpad issue (obviously this was the most irritating one) I came across this thread: Elantech Touchpad problem in Lenovo G460. The symptoms described int this thread were exactly what I had and though the models of laptops were different, the model of touchpad itself was the same. So I decided to give these changes a try but I couldn't apply the them directly, since they required some other changes which didn't get into the kernel used by squeeze. Than I just went to the web interface to linux kernel source code repository, found the first changeset which my kernel was missing and grabbed the complete patch to upgrade needed files to the recent version. You can download the patch here or from the list of attachments bellow. This patch is against 2.6.32 (package version 2.6.32-30) and if you have a different version it might fail to apply cleanly - you're on your own here.

Assuming you have the patch you're now ready to fix the touchpad. Do the following (you have to be root to do this, use either sodu or su):

  • Install gcc, make, kernel headers (linux-headers) and sources (linux-sources). You might need some other packages, but I don't remember the exact list
  • Go to /usr/src/linux-source-2.6.32 and apply patch:
    patch -p1 < ~/Downloads/linux-kernel-touchpad.diff
  • Go to the directory with kernel sources, rebuild the module psmouse.ko and install it (watch for every command to complete without errors, don't just run the next one if previous failed):
    cd /usr/src/linux-source-2.6.32
    make mrproper
    cp /boot/config-$(uname -r) .config
    cp /usr/src/linux-headers-2.6.32-5-686/Module.symvers .
    make oldconfig
    make prepare
    make scripts
    make modules SUBDIRS=drivers/input/mouse
    make modules_install SUBDIRS=drivers/input/mouse
  • Either reload psmouse module:
    modprobe -r psmouse
    modprobe psmouse
    or reboot your system and your touchpad should work flawlessly

Now to the microphone problem:

  • Download alsa-driver, alsa-lib and alsa-utils from www.alsa-project.org (look for Download link on the left).
  • Install xmlto package (it pulls in a huge amount of dependencies, fill free to purge it when finished and all the dependecies with apt-get purge xmlto && apt-get autoremove --purge
  • Go to /usr/src and create a symlink to you kernel sources:
    ln -s linux-source-2.6.32 linux
  • Unpack, configure, build and install alsa-driver, alsa-lib and alsa-utils in the order given here. Use following sequence of commands for each of them:
    ./configure
    make
    make install
    You might get problems with alsa-utils complaining
    configure: error: panelw library not found
    If this is the case you should be able to solve it by creating symlinks (solution shamelessly stolen from HdaIntelSoundHowto):
    ln -s libpanelw.so.5 /usr/lib/libpanelw.so
    ln -s libformw.so.5 /usr/lib/libformw.so
    ln -s libmenuw.so.5 /usr/lib/libmenuw.so
    ln -s libncursesw.so.5 /lib/libncursesw.so
  • Reboot your laptop or try alsa force-reload
  • Check you mixer setting with alsamixer and you now should have a working microphone
UPDATE 2011-03-31: with recent update there is no need to rebuild touchpad driver. Problem with microphone still exists.
AttachmentSize
linux-kernel-touchpad.diff14.7 KB