Request for help with adding a driver to build os852

Bernie Innocenti bernie at laptop.org
Wed Sep 29 14:58:54 EDT 2010


On 09/29/10 17:46, Mikus Grinbergs wrote:
> I need to add two drivers for external USB devices to os852.
> 
> I believe that creating a complete build from scratch for the XO-1,
> which includes the drivers I want, ought to work -- but I'm intimidated
> at jumping into git and kernel-building, just for a couple of drivers.
> [Besides, I don't want to be in the business of build maintenance.]

Building an OS image isn't actually so hard if you're an experienced
Linux user, which you seem to be. I bet you can learn in less than two
hours. Come on IRC for a guided tour.

Building a custom kernel is a little harder. I build kernels like so:

 git clone --reference ~/src/kernel/linux-2.6  dev.laptop.org:/git/olpc-2.6
 make ARCH=i386 xo_1_defconfig
 setarch i386 make ARCH=i386 xo_1-kernel-rpm

Installing it on an XO with the versioned fs requires some magic:

 rpm -ivh kernel-*.rpm
 cp -a /boot/* /versions/boot/current/boot/


> So far, I'm trying to see if I can compile those drivers from source --
> but I'm having a HUGE struggle with the deficiencies of XO-1 package
> kernel-devel-2.6.31_xo1-20100823.1641.1.olpc.12d64069981699a.i586
> (it's missing header directories:  'arch/x86/include', 'include/trace',
> and 'include/asm-x86').

Hmmm building modules off-tree should work even with the olpc kernel,
but nobody ever tests this so I'm not surprised it's broken.

Try building the kernel rpm from scratch as explained above.


> But even when I've managed to compile the most recently available driver
> source and gotten an output module, 'modprobe' gives me "unknown symbol"
> errors, like the following (as logged in dmesg):
>  [139115.158397] uvcvideo: disagrees about version of symbol
> v4l_compat_translate_ioctl
>  [139115.158424] uvcvideo: Unknown symbol v4l_compat_translate_ioctl
> [...]

Looks like you compiled your module against a config.h which
was not the same of the OLPC kernel. Or maybe your driver requires
a config option that is missing on the OLPC kernel.

Either way, building in-tree should fix this problem.


> I'm asking that someone please tell me which Fedora kernel package comes
> closest to the XO-1 os852 kernel package - so I can go exploring for
> differences.  I also suspect that the driver source code I used is not
> the same as the driver source code Fedora used -- do I have to look in
> Fedoraproject git for the driver source code to try to compile ?

None of the Fedora kernel packages comes close to the OLPC kernel.
It's a completely independent codebase, forked off from Fedora
some 3 years ago.

When 100% of the olpc patches will be in Linus' tree, the stock
Fedora kernel will probably be able to boot on the XO out of the
box. I'm not sure how far away into the future this is.

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/



More information about the Devel mailing list