[SOLVED] Alps touchpad kernel patch

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Alps touchpad kernel patch

Postby bertaerts » Dec 9th, '12, 22:56

I have a 2 month old Dell Inspiron 17R SE 7720 with an Alps touchpad running Mageia 2 x86_64.
Problem is touchpad is not recognised by kernel 3.3.8 and not by updates-testing kernel 3.4.20.
Alps touchpad is detected as ps/2 generic mouse and synaptiks and KDE System Settings do not see a touchpad.
Code: Select all
[bert@Dell7720Mageia2 ~]$ cat /proc/bus/input/devices
I: Bus=0011 Vendor=0002 Product=0001 Version=0000
N: Name="PS/2 Generic Mouse"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input1
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3


This issue is described in
https://bbs.archlinux.org/viewtopic.php?id=144118&p=1

Solution and patch is available at
http://www.dahetral.com/public-download/psmouse-alps-dst-1.0.tbz/view

But it is the first time I compile a module and these are the steps I should follow:
to add module to dkms tree: sudo dkms add psmouse/alps-dst-0.4
to compile it: sudo dkms autoinstall
to reload module: sudo rmmod psmouse && sudo modprobe psmouse

First of all: lsmod shows psmouse is not loaded on my notebook...

And these are the steps I followed:
Code: Select all
  cd /home/bert/tmp
  tar xvf psmouse-alps-dst-1.0.tbz
  su
  cp -R /home/bert/tmp/usr/src/psmouse-alps-dst-1.0/ /usr/src/.
  dkms add -m psmouse -v alps-dst-1.0
  dkms build -m psmouse -v alps-dst-1.0

Preparing kernel 3.4.20-desktop-1.mga2 for module build:
(This is not compiling a kernel, just preparing kernel symbols)
Storing current .config to be restored when complete
Running Generic preparation routine
make mrproper....
using /proc/config.gz
make oldconfig....
make prepare....

Building module:
cleaning build area....
make KERNELRELEASE=3.4.20-desktop-1.mga2 -C /lib/modules/3.4.20-desktop-1.mga2/build M=/var/lib/dkms/psmouse/alps-dst-1.0/build/src psmouse.ko....

Error!  Build of psmouse.ko failed for: 3.4.20-desktop-1.mga2 (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/psmouse/alps-dst-1.0/build/ for more information.

[root@Dell7720Mageia2 build]# cat make.log
DKMS make.log for psmouse-alps-dst-1.0 for kernel 3.4.20-desktop-1.mga2 (x86_64)
Sun Dec  9 21:29:08 CET 2012
make: Entering directory `/usr/src/linux-3.4.20-desktop-1.mga2'
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/psmouse-base.o
/var/lib/dkms/psmouse/alps-dst-1.0/build/src/psmouse-base.c: In function ‘__check_smartscroll’:
/var/lib/dkms/psmouse/alps-dst-1.0/build/src/psmouse-base.c:64:1: warning: return from incompatible pointer type [enabled by default]
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/synaptics.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/alps.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/elantech.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/logips2pp.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/lifebook.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/sentelic.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/trackpoint.o
  CC      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/touchkit_ps2.o
  LD      /var/lib/dkms/psmouse/alps-dst-1.0/build/src/psmouse.o
  MODPOST 0 modules
make: Leaving directory `/usr/src/linux-3.4.20-desktop-1.mga2'

[root@Dell7720Mageia2 src]# pwd
/usr/src
[root@Dell7720Mageia2 src]# ls -al
total 28
drwxr-xr-x  7 root root 4096 Dec  9 21:22 ./
drwxr-xr-x 15 root root 4096 Oct  3 21:03 ../
lrwxrwxrwx  1 root root   19 Dec  8 22:23 linux -> linux-3.4.20-1.mga2/
drwxr-xr-x 24 root root 4096 Nov 22 18:33 linux-3.3.8-desktop-2.mga2/
drwxr-xr-x 24 root root 4096 Dec  8 22:23 linux-3.4.20-1.mga2/
drwxr-xr-x 24 root root 4096 Dec  9 21:29 linux-3.4.20-desktop-1.mga2/
drwxr-xr-x  2 root root 4096 Nov 22 18:33 nvidia-current-310.19-1custom.nvidia.mga2/
drwxr-xr-x  3 root root 4096 Dec  9 21:28 psmouse-alps-dst-1.0/


Who can give some hints on how to get this updated Alps driver in Mageia 2 x86_64?
Last edited by bertaerts on Dec 16th, '12, 22:54, edited 1 time in total.
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby bertaerts » Dec 11th, '12, 22:20

Of all the modules listed below, not one is loaded?
Code: Select all
[bert@Dell7720Mageia2 mouse]$ pwd
/lib/modules/3.4.20-desktop-1.mga2/kernel/drivers/input/mouse
[bert@Dell7720Mageia2 mouse]$ ls -al
total 40
drwxr-xr-x  2 root root 4096 Dec 11 20:49 ./
drwxr-xr-x 10 root root 4096 Dec  8 22:13 ../
-rw-r--r--  1 root root 5992 Nov 27 15:47 appletouch.ko.xz
-rw-r--r--  1 root root 5248 Nov 27 15:47 bcm5974.ko.xz
-rw-r--r--  1 root root 2952 Dec 11 20:49 sermouse.ko.xz
-rw-r--r--  1 root root 4160 Nov 27 15:47 synaptics_usb.ko.xz
-rw-r--r--  1 root root 3228 Nov 27 15:47 vsxxxaa.ko.xz


Which module is then used as driver for
Code: Select all
I: Bus=0011 Vendor=0002 Product=0001 Version=0000
N: Name="PS/2 Generic Mouse"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input1
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=0
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3


As the build of psmouse failed, I renamed everything to sermouse as Mageia has a sermouse.ko.xz
dkms build succeeded this time, I got an updated sermouse.ko.xz
I followed these steps:
Code: Select all
  dkms add -m sermouse -v alps-dst-1.0
  dkms build -m sermouse -v alps-dst-1.0
  cd /lib/modules/3.4.20-desktop-1.mga2/kernel/drivers/input/mouse/
  cp sermouse.ko.xz sermouse.ko.xz.org
  cd /var/lib/dkms/sermouse/alps-dst-1.0/3.4.20-desktop-1.mga2/x86_64/module
  cp sermouse.ko.xz /lib/modules/3.4.20-desktop-1.mga2/kernel/drivers/input/mouse/.


And adapted /etc/modprobe.preload to load sermouse

But the Alps touchpad was still recognised as PS/2 generic mouse...

What I would like to try is to update the kernel source code alps.c and alps.h in:
Code: Select all
[bert@Dell7720Mageia2 mouse]$ pwd
/usr/src/linux-3.4.20-1.mga2/drivers/input/mouse
[bert@Dell7720Mageia2 mouse]$ ls
alps.c       amimouse.c    elantech.c    hgpk.h      lifebook.h   Makefile        psmouse.h         sentelic.h   synaptics_i2c.c  trackpoint.c
alps.c.orig  appletouch.c  elantech.h    inport.c    logibm.c     maplemouse.c    pxa930_trkball.c  sermouse.c   synaptics_usb.c  trackpoint.h
alps.h       atarimouse.c  gpio_mouse.c  Kconfig     logips2pp.c  pc110pad.c      rpcmouse.c        synaptics.c  touchkit_ps2.c   vsxxxaa.c
alps.h.orig  bcm5974.c     hgpk.c        lifebook.c  logips2pp.h  psmouse-base.c  sentelic.c        synaptics.h  touchkit_ps2.h

and then recompile, which leads to 3 questions:
+ how to compile the kernel modules for drivers/input/mouse?
+ which module contains the alps.* files?
+ how to get the newly build module loaded and used?
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby bertaerts » Dec 13th, '12, 22:51

I could compile the mouse modules and compress them:
Code: Select all
  su
  cd /usr/src/linux-3.4.20-1.mga2
  cp ../linux-3.4.20-desktop-1.mga2/.config .
  make prepare
  make modules_prepare
  make M=drivers/input/mouse
  cd drivers/input/mouse
  xz --check=crc32 --lzma2=dict=512KiB *.ko


But module is much bigger than original and can not be loaded
Code: Select all
modprobe sermouse

dmesg
[  977.269695] sermouse: no symbol version for module_layout


And I still don't know how the updated driver can be used.

Code: Select all
dmesg

[    1.429842] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    1.432161] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.432165] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.432243] mousedev: PS/2 mouse device common for all mice

[    5.036050] logitech-djreceiver 0003:046D:C52B.0003: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-4/input2
[    5.038499] input: Logitech Unifying Device. Wireless PID:101b as /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.2/0003:046D:C52B.0003/input/input10
[    5.038560] logitech-djdevice 0003:046D:C52B.0004: input,hidraw1: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:101b] on usb-0000:00:14.0-4:1



My Logitech M705 mouse works perfectly.

But my touchpad is sometimes touched without that intention and then the cursor is suddenly on a totally different place. Very irritating while typing. That's the reason I want to disable the touchpad while typing. But it al starts with detecting the Alps touchpad...
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby martinw » Dec 15th, '12, 17:11

The reason you can't find and/or replace the psmouse module is that the Mageia kernel is configured to have PS/2 mouse support built in. So you need to do a full kernel rebuild, not just rebuild the modules.

Don't rename psmouse to sermouse - that will just confuse the system.
martinw
 
Posts: 608
Joined: May 14th, '11, 10:59

Re: Alps touchpad kernel patch

Postby bertaerts » Dec 15th, '12, 18:16

Thanks for the answer about psmouse being built-in Mageia kernel.

So now I (for the very first time) compiled my custom kernel with the help of
https://wiki.mageia.org/en/How_to_compile_and_build_a_custom_kernel
I followed these steps:
Code: Select all
  su
  cd /usr/src/linux-3.4.20-1.mga2
  cp ../linux-3.4.20-desktop-1.mga2/.config .
  cp ../linux-3.4.20-desktop-1.mga2/Module.symvers .
  make prepare
  make -j8
  make modules_install -j8
  make install


This even added my custom kernel to grub.
But the modules that were compiled are huge in size, still contain debug info and are not compressed to .ko.xz
I could boot the kernel, but...

vmware and nvidia could not get compiled.

I thought nvidia dkms would compile automatically.

But although I could not get X running, I had CTRL-ALT-F2 terminal and could verify that Alps touchpad was detected:
Code: Select all
cat /proc/bus/input/devices | more


How do I solve the nVIDIA issue?
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby bertaerts » Dec 15th, '12, 22:00

Apparantly nvidia is compiled:
Code: Select all
[root@Dell7720Mageia2 drm]# pwd
/lib/modules/3.4.20-1.mga2custom/dkms/drivers/char/drm
[root@Dell7720Mageia2 drm]# ls -al
total 12432
drwxr-xr-x 2 root root     4096 Dec 15 16:48 ./
drwxr-xr-x 3 root root     4096 Dec 15 16:48 ../
-rw-r--r-- 1 root root 12720616 Dec 15 16:48 nvidia-current.ko

Again not compressed...
But manual 'startx' in CTRL-ALT-F2 terminal says
Code: Select all
could not insert 'nvidia_current': Exec format error

So the module is not correctly compiled.
I had this previously when compiling modules without Module.symvers in the root of src dir.
And now?
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby martinw » Dec 15th, '12, 23:02

I've just tried this myself, and found the same problem with the fglrx (Radeon) driver. Module.symvers seems to get deleted somewhere along the way.

The steps I used to build a custom kernel were:
Code: Select all
su
urpmi kernel-source-latest
cd /usr/src/linux
make mrproper
cp /boot/config .
make menuconfig
make all -j8
make modules_install
make install

When running 'make menuconfig', you can go into the "Enable loadable module support" sub-menu and enable module compression. However, this only supports gzip compression - I don't know how Mageia do the xz compression.

P.S. If you enable module compression, it's well worth adding '-j8' to the 'make modules_install' step (assuming that you have a multiple CPU cores).
martinw
 
Posts: 608
Joined: May 14th, '11, 10:59

Re: Alps touchpad kernel patch

Postby martinw » Dec 16th, '12, 01:17

OK, this seems to be a bug in dkms. It runs 'make mrproper' in the kernel source directory before and after building modules. Normally, installing dkms causes the kernel headers package to be installed. This includes a hacked Makefile that stops 'make mrproper' deleting Modules.symvers (and other vital files). However, if you are using the full kernel sources, you have an unmodified Makefile, and 'make mrproper' deletes the files that are needed to properly build the kernel modules.

The workaround is as follows. First, build and install your custom kernel. Then, execute the following commands:
Code: Select all
dkms build --no-prepare-kernel --no-clean-kernel -m <module> -v <version> -k <kernel>
dkms install -m <module> -v <version> -k <kernel>

replacing <module>, <version>, <kernel>, with the appropriate values, e.g. I actually ran
Code: Select all
dkms build --no-prepare-kernel --no-clean-kernel -m fglrx -v 8.961-1.mga2.nonfree -k 3.3.8-2.mga2custom
dkms install -m fglrx -v 8.961-1.mga2.nonfree -k 3.3.8-2.mga2custom

If dkms has already installed a broken module for your kernel, you will need to execute
Code: Select all
dkms remove -m <module> -v <version> -k <kernel>
dkms add -m <module> -v <version> -k <kernel>

before doing the above steps.
martinw
 
Posts: 608
Joined: May 14th, '11, 10:59

Re: Alps touchpad kernel patch

Postby bertaerts » Dec 16th, '12, 21:03

Thanks for the tips.

I now did:
Code: Select all
dkms build -m nvidia-current -v 310.19-1custom.nvidia.mga2 -k 3.4.20-1.mga2custom --kernelsourcedir /usr/src/linux-3.4.20-1.mga2
dkms install -m nvidia-current -v 310.19-1custom.nvidia.mga2 -k 3.4.20-1.mga2custom --force

[root@Dell7720Mageia2 nvidia-current]# dkms status
nvidia-current, 310.19-1custom.nvidia.mga2, 3.4.20-1.mga2custom, x86_64: installed
nvidia-current, 310.19-1custom.nvidia.mga2, 3.4.20-desktop-1.mga2, x86_64: installed


The --force may have been needed as I did not do the "dkms remove"?

And now my custom kernel boots graphically with nVIDIA driver 310.19 just fine.

One issue remains: VMware Workstation 9.0.1 does not start yet... I made a new thread for it :-)
bertaerts
 
Posts: 181
Joined: Apr 6th, '11, 12:19

Re: Alps touchpad kernel patch

Postby martinw » Dec 16th, '12, 22:51

Glad we are getting there! Could you please edit your first post in this thread and add "[SOLVED]" at the beginning of the "Subject" line.
martinw
 
Posts: 608
Joined: May 14th, '11, 10:59


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest