LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-24-2018, 02:12 PM   #1
denijane
LQ Newbie
 
Registered: Aug 2007
Posts: 21

Rep: Reputation: 1
How to add module to a kernel? (First time messing with the kernel, following Arch instructions on Sabayon)


I need to load a new touchpad driver to my kernel (because obviously nobody plans to include elantech 1200 support to linux kernel).

I tried following the Arc instructions .

I downloaded a 4.15.17 linux kernel and unzipped it.
I did:
$ make mrproper
$ cp /lib/modules/$(uname -r)/build/.config ./
$ cp /lib/modules/$(uname -r)/build/Module.symvers ./
$ make oldconfig
$ make EXTRAVERSION=-sabayon modules_prepare
$ make M=/home/user/linux_elan1200_touchpad-master/
$ xz /home/user/linux_elan1200_touchpad-master//hid-elan.ko
All fine, no errors and I have a "hid-elan.ko.xz"

What do I do afterwards?
Instructions says you need to "gzip and copy it over for your current kernel."

But they also say:
# cp -f fs/btrfs/btrfs.ko.xz /usr/lib/modules/`uname -r`/kernel/fs/btrfs/

Do I first gzip and copy the current kernel and then do the copy, or the copy should be done before gzip?

Also do I gzip with:
"gzip -r myfolder"
or with
"tar -zcvf archive.tar.gz directory/ "
Finally, where should I place the gzip?
I see initramfs-genkernel-x86_64-4.15.0-sabayon (which the info says it's gzip file)
But I also see a "kernel-genkernel-x86_64-4.15.0-sabayon" which I don't know how to generate.

I'm sorry if this is a repeating question I googled it, but the way Gentoo rebuilds the kernel is different from the Arch instructions, and honestly, I have no clue how Sabayon deals with that.
 
Old 04-25-2018, 08:23 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,146

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
What is the setting in your .config for CONFIG_MOUSE_ELAN_I2C? Why not use the built-in driver?
 
1 members found this post helpful.
Old 04-26-2018, 05:18 PM   #3
denijane
LQ Newbie
 
Registered: Aug 2007
Posts: 21

Original Poster
Rep: Reputation: 1
Hi,
Do you mean this:
Code:
$ cat /usr/src/linux/.config | grep CONFIG_MOUSE 
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_BYD=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_MOUSE_PS2_SENTELIC=y
CONFIG_MOUSE_PS2_TOUCHKIT=y
CONFIG_MOUSE_PS2_FOCALTECH=y
# CONFIG_MOUSE_PS2_VMMOUSE is not set
CONFIG_MOUSE_PS2_SMBUS=y
CONFIG_MOUSE_SERIAL=m
CONFIG_MOUSE_APPLETOUCH=m
CONFIG_MOUSE_BCM5974=m
CONFIG_MOUSE_CYAPA=m
CONFIG_MOUSE_ELAN_I2C=m
CONFIG_MOUSE_ELAN_I2C_I2C=y
CONFIG_MOUSE_ELAN_I2C_SMBUS=y
CONFIG_MOUSE_VSXXXAA=m
CONFIG_MOUSE_GPIO=m
CONFIG_MOUSE_SYNAPTICS_I2C=m
CONFIG_MOUSE_SYNAPTICS_USB=m
I'm not sure what the "m" stands for. But I have no touchpad whatsoever. Neither libinput-list-devices, nor xinput detects it exists.

And if this is the latest info on the elantech drivers, it says it's supported up to elan 1000. Mine is 1200. This is why I thought I may try to rebuild the kernel with drivers that might support it. Otherwise, I'm simply clueless how to make the touchpad works.
 
Old 04-27-2018, 10:09 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,146

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
y=built-in, m=module. Try: modprobe elan_i2c
 
Old 04-27-2018, 03:49 PM   #5
denijane
LQ Newbie
 
Registered: Aug 2007
Posts: 21

Original Poster
Rep: Reputation: 1
Ah, ok. So I did it, nothing happened.
The driver is loaded because:
Code:
$ lsmod|grep elan
elan_i2c               40960  0
But still no touchpad.
P.S. List of all the i2c things I have loaded:

Code:
$lsmod |grep i2c
elan_i2c               40960  0
i2c_hid                24576  0
i2c_i801               32768  0
i2c_algo_bit           16384  2 igb,i915

Last edited by denijane; 04-27-2018 at 04:03 PM.
 
Old 04-30-2018, 06:54 AM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,146

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Loading the module should give an error in the system log which should help track down the reason.

https://elixir.bootlin.com/linux/v4....use/elantech.c
 
Old 05-03-2018, 11:43 AM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Sabayon is gentoo-based. Arch is debian-based. So if your building from official sources from kernel.org, you'll probably make soup of your system. Your touchpad has support in the kernel as of 4.5.

To check if the touchpad is detected, run
Code:
$ egrep -i 'synap|alps|etps|elan' /proc/bus/input/devices
Check if there are kernel sources in your distro repos that you can use.
 
Old 05-04-2018, 05:41 AM   #8
denijane
LQ Newbie
 
Registered: Aug 2007
Posts: 21

Original Poster
Rep: Reputation: 1
Hi, nope, it's not detected at all:
$egrep -i 'synap|alps|etps|elan' /proc/bus/input/devices
returns nothing.

After another 2 hours of pain, I think the problem is acpi:

When I boot with acpi=force, the detection of Elan1200 appears in:
Code:
$journalctl | grep ELAN1200
may 04 03:34:44 sabayon.local kernel: i2c_hid i2c-ELAN1200:00: i2c-ELAN1200:00 supply vdd not found, using dummy regulator
may 04 03:34:44 sabayon.local kernel: input: ELAN1200:00 04F3:303E Touchpad as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN1200:00/0018:04F3:303E.0003/input/input16
май 04 03:34:44 sabayon.local kernel: hid-multitouch 0018:04F3:303E.0003: input,hidraw2: I2C HID v1.00 Mouse [ELAN1200:00 04F3:303E] on i2c-ELAN1200:00
The problem is that I get a non-responsive black screen so I can't really use it. (by non-responsive I mean alt+ctrl+f1 doesn't work)

Whatever other boot options I use, the system doesn't load Elan1200 and for it, it's non-existing as a device (i.e. it doesn't appear in:
$dmesg or
$sudo libinput-debug-events --enable-tap or
$cat /proc/interrupts) .

And it doesn't have id in /sys/bus/hid:
Code:
$ls /sys/bus/hid/drivers/hid-generic
0003:0458:0007.0001  0003:0B05:1869.0002  bind  module  new_id  uevent  unbind
$ls /sys/bus/hid/drivers/hid-elan
bind  module  new_id  uevent  unbind
And the two ids in hid-generic correspond to my keyboard and my usb mouse.

I'm not sure if the problem is bios or the kernel, because on kUbunto, the touchpad got detected (though it worked badly).

I'd be very grateful if anyone has a suggestion with regards to the acpi option, how to turn on the screen on "acpi=force" or if a new kernel would help.

The xorg.log.old from the "acpi=force" boot displays the following errors:
Code:
[     8.313] (EE) [drm] Failed to open DRM device for (null): -22
[     8.313] (EE) [drm] Failed to open DRM device for (null): -22
[    10.347] intel: waited 2020 ms for i915.ko driver to load
[    10.350] (WW) Falling back to old probe method for modesetting
[    10.352] (WW) Falling back to old probe method for vesa
[    10.353] (EE) Screen 0 deleted because of no matching config section.
[    10.353] (II) UnloadModule: "modesetting"
[    10.363] (II) AIGLX: Screen 0 is not DRI2 capable
[    10.363] (EE) AIGLX: reverting to software rendering

Last edited by denijane; 05-04-2018 at 05:54 AM.
 
  


Reply

Tags
arch, kernel, module, sabayon



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unload kernel module at boot time (Debian Wheezy 7.2, 3.2.0-4-686-pae kernel) gacanepa Linux - Newbie 7 01-01-2014 12:18 PM
Multithreaded kernel module and time function in kernel space taufique71 Linux - Kernel 1 10-19-2012 12:57 PM
can i add a breakpoint in the kernel or kernel module? Richard.Yang Linux - Kernel 13 09-20-2011 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration