• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: making modules and inserting them into the file system  (Read 2214 times)
uwgandalf
Newbie
*

Karma: 0
Posts: 10


View Profile
« on: May 27, 2010, 02:03:03 PM »

I can't find a tutorial on the following:
I want to create a dvb module, now I familiarized myself with uboot and stuff, updated my guruplug server plus to latest uboot and latest default kernel and rootfs. How can I compile a module for the default/installed kernel and have it inserted at /lib/modules/[kernel] . I already tried to crosscompile my own kernel, but I get version mismatches because if I boot with my own kernel, the corresponding modules are not in the rootfs (of course). What is best practice to build modules for the guruplug without having to wipe rootfs?

I hope it's clear what I' trying to do.

thanks in advance.
Logged

flipflip
Jr. Member
**

Karma: 4
Posts: 50


Hopplaschorsch!


View Profile
« Reply #1 on: May 27, 2010, 03:38:08 PM »

You can (should) do it the Debian way (since you're running Debian on the plug).
See if your module is not already included in Debian.
The "module assistant" is your friend: http://wiki.debian.org/ModuleAssistant
You should install the "build-essentials" and "linux-headers" packages and possibly others. That should allow you to compile modules on the plug that fit the running kernel.

Happy hacking!
Logged

GPS+ Debian Squeeze AP router firewall dhcpd named NAS Squeezebox OpenVPN All running fine.

uwgandalf
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #2 on: May 27, 2010, 03:57:25 PM »

I prefer to do this icw a cross compiler, due to space restrictions on the plug, but trying your method m-a complains about not finding headers for the default/running kernel.

How could I recreate the exact kernel environment used by globalscale? And cross compile it on the desktop.

I've managed to do this in a ugly way, I took a vanilla kernel, patched it, cross compiled it, including the module I wanted. updated the kernel through uboot, rsynced the modules to a new dir in /lib/modules/2.6.33.5-dirty, rebooted, depmod, reboot.
How cumbersome.

the default kernel is 2.6.33.2-00003-g4b82fc0 , how would I be able to cross compile for this kernel?

Thanks for  the module-assistant tip, as a spoiled ubuntu user I had never heard of it.
« Last Edit: May 27, 2010, 04:00:41 PM by uwgandalf » Logged

flipflip
Jr. Member
**

Karma: 4
Posts: 50


Hopplaschorsch!


View Profile
« Reply #3 on: May 27, 2010, 04:05:34 PM »

Ubuntu uses the m-a, too!

You probably have to create a new kernel.. Not so much a problem I think. I did that, too.

There's another command for this: make-kpkg. It creates the linux-image and linux-headers packages that you then can "dpkg -i" in the system. For this kernel m-a should find the headers. You still need to create a uImage to put into uboot as long as we cannot boot the kernel from the disk. I have some notes on this at http://oinkzwurgl.org/guruplug_kernel

I'm pretty sure that you can use make-kpkg to cross-compile kernels. But I've never done that.
Logged

GPS+ Debian Squeeze AP router firewall dhcpd named NAS Squeezebox OpenVPN All running fine.

uwgandalf
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #4 on: May 29, 2010, 07:42:14 AM »

can't seem to get it done getting make-kpkg to cross compile

I'm getting these errors in multiple:

objcopy: Unable to recognise the format of the input file `/home/gandalf/src/guruplug/linux-2.6.33.y/debian/linux-image-2.6.33.5-dirty/lib/modules/2.6.33.5-dirty/kernel/drivers/leds/ledtrig-gpio.ko'
 
for every .ko file.

Well, would've been nice if it worked, but ok.
Logged

sdaau
Newbie
*

Karma: 1
Posts: 8


View Profile
« Reply #5 on: June 03, 2010, 04:27:00 AM »

Hi,

Found this post by accident - not sure if this is the answer (never tried anything like building modules, but might have to do it some time), but could this help: Re-building the kernel and U-Boot - PlugWiki

Cheers!
Logged

Pages: [1]
Print
Jump to: