SliTaz SliTaz Forum

You are not logged in.

#1 2011-10-16 18:40:01

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Trying to compile a kernel module

Well, I've installed SliTaz on my Eee 900 after decided to turn it in a NAS because its LCD screen got broken a few weeks ago. Now I need to use a kernel module called eee.ko to adjust the processor's clock because when setted to 900 MHz it goes real hot and it's not proper for a device that will be working 24/7.

When I try to compile with make, I get a message saying that /lib/modules/2.6.30.6-slitaz/build doesn't exist. I tried to install linux-source from tazpkg but it hangs when connecting to www.eu.kernel.org. I think it was taken offline when kernel.org detected a flaw in its servers security.

So, my questions are:

- Am I doing it right?

- The origin of the files in build directory under /lib/modules/.../ is eu.kernel.org?

- If positive, how do I change the source of the files?

Thanks!

Offline

#2 2011-10-16 19:15:21

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

why eee.ko - try this:

http://doc.slitaz.org/en:guides:cpu-frequency

Offline

#3 2011-10-16 21:27:03

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Thank you, kultex!

Well, I thought of it first because when the Eee had Windows installed, I was using eeectl to control the processor speed directly, almost with fine-tuning and this approached looked fine to be used in SliTaz.

I installed those packages but it didn't work:

mendel@servidor:~$ modprobe acpi-cpufreq

insmod: cannot insert '/lib/modules/2.6.30.6-slitaz/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko.gz': Operation not permitted

modprobe: failed to load module acpi-cpufreq: No such file or directory

Offline

#4 2011-10-17 07:02:22

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

its because you cannot load a module as user - you must be root

Offline

#5 2011-10-17 16:28:26

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Oh, sorry, I posted the wrong line.

Even logged as root it gives me that error

Offline

#6 2011-10-17 17:17:15

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

Did you install the tazpkg that owns acpi-cpufreq ?

#tazpkg get-install linux-cpufreq --forced

#modprobe -l | grep -i acpi-cpufreq

Offline

#7 2011-10-17 18:27:24

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Yes, it is installed and the modprobe line returns a valid path...

I'm confused about what module I must choose to control a Celeron M 353 ULV processor

Also, doc.slitaz.org is not loading right now

Thank you guys for trying to help!

Offline

#8 2011-10-17 20:12:02

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

as far as I know, old Celerons dont speedstep...

http://www.computing.net/answers/cpus/pentium-m-vs-celeron-m/10977.html

only newer ones do

Offline

#9 2011-10-17 21:49:49

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

@MendelGusmao

Welcome to SliTaz

Tank replicas for mirrored backup:

http://mirror.slitaz.org/info/

http://mirror.slitaz.org/doc/

http://mirror.slitaz.org/www/

http://mirror.slitaz.org/hg/

http://mirror.slitaz.org/pkgs/

Offline

#10 2011-10-17 22:59:15

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Well, if the packages described in en:guides:cpu-frequency aren't compatible with my processor, I think I will get back to the idea of compiling the eee.ko, which makes me ask how can I tell tazpkg to not to request data from www.eu.kernel.org and use another host that is up, instead.

Once again, thanks!

Offline

#11 2011-10-18 06:24:46

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

root@slitaz:# cat  /usr/src/linux-2.6.30.6-slitaz/slitaz/url

http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.6.tar.bz2

linux-source url was changed so it works.

I just tested on a clean install of slitaz-3.0

Offline

#12 2011-10-18 07:16:46

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

@MendelGusmao

I dont want to keep you away from compiling, but when I reed the project site http://code.google.com/p/eeepc-linux/  it tells olny, that this module allows the eee pc to run on 900 MHz - by default its running on 633 Mhz - and it is not scaling.

And I think, that Asus did this only because of temerature problems....

Offline

#13 2011-10-18 13:09:35

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

@mojo I tested with a clean install in a vbox and it worked fine! Later I'll try in my Eee

@kultex Yeah, it was first designed to allow the older Eees to run at 900 MHz by providing a way to set the FSB directly, so, it's possible to set any FSB value

http://wiki.eeeuser.com/howto:overclockfsb

Thanks, guys!

Offline

#14 2011-10-18 14:49:17

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

You will have to compile i2c_i801 module :

http://wiki.eeeuser.com/howto:overclockfsb

"Before the version 0.2 eee.ko module can be installed, the i2c_i801.ko module must be installed, since eee.ko uses that interface to the hardware.'

root@slitaz:/home/tux# zcat /proc/config.gz | grep -i i2c_i801

# CONFIG_I2C_I801 is not set

Offline

#15 2011-10-18 16:12:13

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

I think it's just put i2c_i801.c in modules/ with eee.c, add "obj-m += i2c_i801.o" to Makefile and run make, am I right?

Offline

#16 2011-10-18 17:23:43

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

Modules are software that can have dependencies.

I would think you have to compile and then load the i2c_i801 module.

Otherwise when you attempt to load eee it may fail with unknown symbol in module error

You should see if the eee.ko compiles before you bother with  i2c_i801

This thread has directions for compiling/installing an in tree kernel module without recompiling the kernel.

Skip step 5) installing firmware:

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

Offline

#17 2011-10-18 19:23:43

claudinei
Administrator
Registered: 2011-03-29
Posts: 102

Re: Trying to compile a kernel module

If i remember, Pankso had a flavor for eeepc (i guess he still have one) that includes the eee.ko module. Can't confirm it right know, because the iso used to be hosted at people.slitaz.org/~pankso, that's currently offline.

Maybe you can try the slitaz-eeepc package on the cooking repos. It brings a script called "tazee" which helps to setup some asus netbooks.

Offline

#18 2011-10-19 02:45:16

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

I proceeded the hard way by recompiling the kernel with i2c_i801 selected in make menuconfig... now I'm having issues compiling eee.c:

root@servidor:/home/mendel/eeepc-linux/module# make

make -C /lib/modules/2.6.30.6-slitaz/build M=/home/mendel/eeepc-linux/module modules

make[1]: Entering directory `/usr/src/linux-2.6.30.6-slitaz'

  CC [M]  /home/mendel/eeepc-linux/module/eee.o

/home/mendel/eeepc-linux/module/eee.c: In function âeee_proc_initâ:

/home/mendel/eeepc-linux/module/eee.c:399: error: âproc_rootâ undeclared (first use in this function)

/home/mendel/eeepc-linux/module/eee.c:399: error: (Each undeclared identifier is reported only once

/home/mendel/eeepc-linux/module/eee.c:399: error: for each function it appears in.)

/home/mendel/eeepc-linux/module/eee.c:404: error: âstruct proc_dir_entryâ has no member named âownerâ

/home/mendel/eeepc-linux/module/eee.c:421: error: âstruct proc_dir_entryâ has no member named âownerâ

/home/mendel/eeepc-linux/module/eee.c: In function âeee_proc_cleanupâ:

/home/mendel/eeepc-linux/module/eee.c:442: error: âproc_rootâ undeclared (first use in this function)

make[2]: *** [/home/mendel/eeepc-linux/module/eee.o] Error 1

make[1]: *** [_module_/home/mendel/eeepc-linux/module] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.30.6-slitaz'

make: *** [all] Error 2

I think it might be some kind of incompatibility between kernel 2.6.30 and the version used by the author of eee.ko. I'm not a C expert but I'll try to figure out what is wrong with the code

Thanks

Offline

#19 2011-10-19 07:03:35

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

I dont want make advertisment for puppy, because running only as root is very stupid, but to try things out, you may have a look, if you dont succeed in SliTaz

http://www.murga-linux.com/puppy/viewtopic.php?search_id=2030086327&t=59556

Offline

#20 2011-10-19 13:05:51

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Nice tip, kultex! What a pity that the site is offline. I'll try to find Puppeee's source in another place to check how it implemented the FSB control. Thanks

Offline

#21 2011-10-19 13:50:33

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: Trying to compile a kernel module

http://puppylinuxstuff.meownplanet.net/aarf/puppeee4.4-RC2celeron.zip

Offline

#22 2011-10-19 18:21:47

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

I finally managed to compile eee.c in 2.6.30.6-slitaz. The avaliable version in https://code.google.com/p/eeepc-linux/ is not compatible with the kernel used by slitaz. Fortunately, there's a version tested with kernel versions up to 2.6.32:

https://code.google.com/p/eeepc-linux/issues/detail?id=23

Just one more question before closing the topic: I see in many pages the instructions to add the modules' names to /etc/modules but this file doesn't exist in my slitaz installation. How do I do to set slitaz to automatically load these modules at boot?

Thanks!

Offline

#23 2011-10-19 18:30:43

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Trying to compile a kernel module

#nano /etc/rcS.conf

LOAD_MODULES=

Offline

#24 2011-10-19 19:17:12

MendelGusmao
Member
Registered: 2011-10-06
Posts: 11

Re: Trying to compile a kernel module

Thank you all, now everything is fine! The question is solved!

Offline

#25 2013-02-24 17:08:57

dariosalvi
Member
Registered: 2013-02-24
Posts: 1

Re: Trying to compile a kernel module

Hi Mendel,

I am trying to install this kernel module like a crazy, can you upload the compiled version somewhere?

maybe you can publish a little tutorial somewhere?

it would be really usefule.

thank you

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, 7 queries executed - Memory usage: 1.58 MiB (Peak: 1.77 MiB) ]