[maemo-developers] Dealing with fcam-drivers and different kernels

From: Eino-Ville Talvala talvala at stanford.edu
Date: Mon Aug 2 21:38:11 EEST 2010
Hi,

I'm one of the developers on the FCam project [1], and was hoping to get
some advice on properly dealing with kernel-level dependencies in extras.

All FCam applications depend on fcam-drivers, a set of camera subsystem
kernel modules which are slightly modified from the stock kernel.
(primarily to allow us to disable the built-in camera daemon,
secondarily to fix a few issues in the imaging pipe statistics module
drivers and to add a bit more control to the sensor driver)  Since these
are kernel modules, they have to be compiled against the kernel headers
for the kernel running on the user's device.

Currently, we target just the stock N900 kernel, but given its
widespread use, we'd also like to support kernel-power [2], which is an
alternate N900 kernel with more customizability.  But since it's a
different set of kernel sources, we can't insmod our fcam-drivers kernel
modules into the kernel-power kernel (mismatched version strings, etc). 
Of course, it's trivial to compile fcam-drivers with the kernel-power
headers instead, to get binary modules that work with kernel-power.
(Well, it would be, although currently the kernel-power-headers package
appears broken - Titan, the kernel-power maintainer, says this will be
fixed soon).

So we can create the kernel modules for both kernels, but the problem is
in packaging them.  I don't know enough about the application
manager/apt-get to know if the following set of packaging directives is
safe:

fcam-stock-drivers:
  Provides: fcam-drivers
  Conflicts: kernel-power-flasher, fcam-drivers

fcam-power-drivers:
  Provides: fcam-drivers
  Depends: kernel-power-flasher
  Conflicts: fcam-drivers

Then FCam applications would use:
   Depends: fcam-stock-drivers | fcam-drivers

The hope is that for stock kernel users, this would pull in
fcam-stock-drivers, and for kernel-power users, it'll pull in
fcam-power-drivers since fcam-stock-drivers will conflict.  But I was
hoping to get confirmation on this before we try it out in the wild, and
possibly accidentally have application manager swap user's kernels out
from under them!

Also, if there's a way to simplify the FCam application Depends:  to
just Depends: fcam-drivers and have it work right, I'd love to know
about it.  Since that's the part that's out of our control when others
write applications using FCam, I'd like to keep it very simple, so
nobody accidentally creates the installs-new-kernel scenario with their
new camera app!  For example, would the following possibly work:

fcam-drivers:
  Conflicts: kernel-power-flasher

fcam-power-drivers:
  Provides: fcam-drivers
  Depends: kernel-power-flasher
  Conflicts: fcam-drivers

fcam applications:
   Depends: fcam-drivers

With the idea that fcam-drivers is preferred since it's a real package,
and fcam-power-drivers only used in case fcam-drivers conflicts?


The other alternative we have is to just package up both sets of modules
in fcam-drivers, and detect at runtime what kernel is in use.  But this
doubles the space we need on the rootfs (can't optify kernel modules, as
far as we can tell), and we'd have to update fcam-drivers for everyone
every time kernel-power updates, instead of just for kernel-power users.

Finally, we could just ask Titan to fold fcam-drivers into his kernel,
but I'm not sure it resolves the dependency issue above - would app
manager again correctly pull in fcam-drivers for the stock kernel when
needed, instead of pulling down kernel-power?

Any advice would be appreciated!

Thanks,

Eddy Talvala
Computer Graphics Lab
Stanford University

------

[1] http://fcam.garage.maemo.org
[2] http://wiki.maemo.org/Kernel_Power
More information about the maemo-developers mailing list