SliTaz SliTaz Forum

You are not logged in.

#1 2012-10-01 23:17:22

Mr.Blues
Member
Registered: 2012-10-01
Posts: 3

how do i compile a kernel module ?

Hello

I installed Slitaz on my EeePc 701SD.

i try to make lm-sensors working but i need i2c-dev and i2c-i801 kernel modules.

I download the source of linux with get-linux-source.

1) But i don't know how to compile the modules !

2) When i got the source, it's seems that the source wasn't completed or corrupted.

when i execute the get-linux-source again, i don't think is redownload it and  i always got the 'error' message.

i probably got 75% of the file.

To compile, i find this on the web but i just don't understand anything.

http://alanyih.blogspot.be/2010/02/slitaz-modulesinstall.html

I really need help to compile the modules.

if you know some other package to install on the eeepc to get everything works, it can help too

Thanks.

Offline

#2 2012-10-02 03:57:01

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: how do i compile a kernel module ?

Hi Mr. Blues,

My search on pkgs.org shows that they have one package:

http://pkgs.org/slackware-13.37/slackware-i486/kernel-modules-2.6.37.6-i486-2.txz.html

It is 2.6.37 kernel, like we use. I don't know, will it work? But you can try. I think you can extract files from package via command

[c]7za x kernel-modules-2.6.37.6-i486-2.txz[/c]

After unpacking copy ko to right place in your system, reboot and see if kernel use this module.

If it fails, so... return to your kernel recompiling.

Offline

#3 2012-10-02 07:34:53

totoetsasoeur
Moderator
Registered: 2011-03-29
Posts: 247

Re: how do i compile a kernel module ?

Hi,

Please check if this helps. I did it a long time ago but may worth a try:

http://vanilla.slitaz.org/index.php?p=/discussion/comment/5404#Comment_5404

Good luck and do not forget to share your solution.

:-)

----------------------------------------------------------------------------

APRIL 2010

----------------------------------------------------------------------------

Dear all,

Here are the required steps in order to add module ti_usb_3410_5052 to linux kernel. This solution does not use the wok.

Let's do it:

0) Make sure we have linux-source files (as root):

[c]root@slitaz:/home/stephane# tazpkg get-install linux-source[/c]

1) Go to linux-source directory (as root):

[c]root@slitaz:/home/stephane# cd /usr/src/linux-2.6.33.2-slitaz/
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
2) Enable the required module by editing configuration file (.config) with any text editor.

Look for line # CONFIG_USB_SERIAL_TI is not set and replace it with CONFIG_USB_SERIAL_TI=m:

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# vi .config
# CONFIG_USB_SERIAL_TI is not set   <== replace this line
CONFIG_USB_SERIAL_TI=m                 <== with this one[/c]
3) Build needed files and link final module images: [thanks Ernia ;-) ]

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# make CONFIG_USB_SERIAL_TI=m M=drivers/usb/serial
  LD      drivers/usb/serial/built-in.o
  CC [M]  drivers/usb/serial/usb-serial.o
  CC [M]  drivers/usb/serial/generic.o
  CC [M]  drivers/usb/serial/bus.o
  LD [M]  drivers/usb/serial/usbserial.o
  CC [M]  drivers/usb/serial/ch341.o
  CC [M]  drivers/usb/serial/option.o
  CC [M]  drivers/usb/serial/pl2303.o
  CC [M]  drivers/usb/serial/ti_usb_3410_5052.o
  Building modules, stage 2.
  MODPOST 5 modules
  CC      drivers/usb/serial/ch341.mod.o
  LD [M]  drivers/usb/serial/ch341.ko
  CC      drivers/usb/serial/option.mod.o
  LD [M]  drivers/usb/serial/option.ko
  CC      drivers/usb/serial/pl2303.mod.o
  LD [M]  drivers/usb/serial/pl2303.ko
  CC      drivers/usb/serial/ti_usb_3410_5052.mod.o
  LD [M]  drivers/usb/serial/ti_usb_3410_5052.ko
  CC      drivers/usb/serial/usbserial.mod.o
  LD [M]  drivers/usb/serial/usbserial.ko
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
4) Copy the module:

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# mkdir -p /lib/modules/2.6.33.2-slitaz/kernel/drivers/usb/serial
root@slitaz:/usr/src/linux-2.6.33.2-slitaz# cp drivers/usb/serial/*.ko /lib/modules/2.6.33.2-slitaz/kerne
l/drivers/usb/serial/
root@slitaz:/usr/src/linux-2.6.33.2-slitaz# ls /lib/modules/2.6.33.2-slitaz/kernel/drivers/usb/serial/
ch341.ko             option.ko            pl2303.ko            ti_usb_3410_5052.ko  usbserial.ko
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
5) Install the firmware:

[c]root@slitaz:~# cd /usr/src/linux-2.6.30.6-slitaz/
root@slitaz:/usr/src/linux-2.6.30.6-slitaz# make firmware_install
root@slitaz:/usr/src/linux-2.6.30.6-slitaz# ls /lib/firmware/ti_*
/lib/firmware/ti_3410.fw  /lib/firmware/ti_5052.fw
root@slitaz:~#[/c]
6) Load the module and check it is loaded : [thanks Ernia ;-) ]

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# depmod -a
root@slitaz:/usr/src/linux-2.6.33.2-slitaz# modprobe ti_usb_3410_5052
root@slitaz:/usr/src/linux-2.6.33.2-slitaz# lsmod | grep ti_usb
ti_usb_3410_5052       16567  0
usbserial              22032  1 ti_usb_3410_5052
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
7) Load automatically the module at boot time:

Edit /etc/rcS.conf and add ti_usb_3410_5052 to LOAD_MODULES line. Here is the resulting line in /etc/rcS.conf file:

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# cat /etc/rcS.conf | grep LOAD_MODULES
LOAD_MODULES="lp parport parport_pc ti_usb_3410_5052"
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
8) Connect the MSP-FET430UIF device from Texas Instrument and make sure the driver mapped the module to the device. The output should be something like:

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# dmesg | tail
usb 1-2.2: device firmware changed
ti_usb_3410_5052: probe of 1-2.2:1.0 failed with error -5
usb 1-2.2: USB disconnect, address 5
usbcore: registered new interface driver ti_usb_3410_5052
ti_usb_3410_5052: v0.9:TI USB 3410/5052 Serial Driver
usb 1-2.2: new full speed USB device using uhci_hcd and address 6
ti_usb_3410_5052 1-2.2:1.0: TI USB 3410 1 port adapter converter detected
ti_usb_3410_5052: probe of 1-2.2:1.0 failed with error -5
ti_usb_3410_5052 1-2.2:2.0: TI USB 3410 1 port adapter converter detected
usb 1-2.2: TI USB 3410 1 port adapter converter now attached to ttyUSB0
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
9) Let's finally check that the device really exists:

[c]root@slitaz:/usr/src/linux-2.6.33.2-slitaz# ls /dev/ttyUSB0
/dev/ttyUSB0
root@slitaz:/usr/src/linux-2.6.33.2-slitaz#[/c]
Here you are!

Now be ready to play with Texas Instrument's MSP430 familly.

Cheers.

Stephane

Offline

#4 2012-10-02 12:35:11

Mr.Blues
Member
Registered: 2012-10-01
Posts: 3

Re: how do i compile a kernel module ?

Hello thx for your answers

when tried to compile i got this error :

make CONFIG_I2C_I801=m M=drivers/i2c/busses/

Makefile:314: /usr/src/linux-2.6.37/scripts/Kbuild.include: No such file or directory

/bin/bash: /usr/src/linux-2.6.37/scripts/gcc-goto.sh: No such file or directory

  ERROR: Kernel configuration is invalid.

         include/generated/autoconf.h or include/config/auto.conf are missing.

         Run 'make oldconfig && make prepare' on kernel src to fix it.

  WARNING: Symbol version dump /usr/src/linux-2.6.37/Module.symvers

           is missing; modules will have no dependencies and modversions.

make: *** empty variable name.  Stop.

make: *** [_module_drivers/i2c/busses/] Error 2

----------------------------------------------------

I tried to install the slackware package (kernel-modules) but i didn't work to

# modprobe i2c-i801

modprobe: can't load module i2c-i801 (/lib/modules/2.6.37-slitaz/kernel/drivers/i2c/i2c-i801.ko): unknown symbol in module, or unknown parameter

-----------------------------------------------------

Offline

#5 2012-10-02 13:12:43

Mr.Blues
Member
Registered: 2012-10-01
Posts: 3

Re: how do i compile a kernel module ?

when i use the command :

# get-linux-source

Connecting to www.kernel.org (149.20.4.69:80)

bzip2: Compressed file ends unexpectedly;

    perhaps it is corrupted?  *Possible* reason follows.

bzip2: Inappropriate ioctl for device

    Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.

You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover

data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive

tar: Unexpected EOF in archive

tar: Error is not recoverable: exiting now

Apply linux-diff-2.6.37.u

patching file arch/x86/vdso/Makefile

--- and more txt ----

The first time it downloaded it but not now

maybe it's why some files are missing.

Offline

#6 2012-10-02 13:35:20

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: how do i compile a kernel module ?

Hi Mr.Blues

The correct procedure to recompile kernel follows this guide

http://doc.slitaz.org/en:guides:kernel

at the step make menuconfig you have the graphics selection to ability preferred modules

on this pages view the content of kconfig of ic2 busses

http://lxr.linux.no/#linux+v2.6.37/drivers/i2c/busses/Kconfig

try to make menu on this guide your kernel modules after that finish the procedure described on first link and reboot in to new kernel

good luck

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 8 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]