Disabling add-ons in the presence of a generic control device

Matthew Garrett mjg59 at srcf.ucam.org
Thu Jul 10 07:23:58 PDT 2008


On Thu, Jul 10, 2008 at 04:10:00PM +0200, Danny Kukawka wrote:

> The addon for Dell get already only loaded and stopped if the dcdbas module 
> get loaded/unloaded. If the module ever will provide a kernel (sysfs) 
> interface to change the brightness (not sure if this will ever happen) you 
> need only to match the kernel version with which it get change to prevent the 
> addon from get started. I see no problem here.

The problem is that we want the other functionality that the dcdbas 
module provides (killswitch support and so on) - but the correct way to 
do backlight control on machines which support it is through the ACPI 
driver, not the dcdbas mess. That's a userspace policy decision rather 
than a kernel one, so it ought to be hal that handles that situation. 
It's also machine and configuration dependent, so keying off kernel 
versions or DMI information isn't going to work.

> > I'm not quite clear on the cleanest way of doing this 
> > with the fdi format, though. It needs to handle two cases:
> >
> > 1) The kernel driver is loaded before hal. The addon needs to never be
> > started in this case.
> 
> You assume can't cover this case for sure. The only way would be currently 
> (because of the nature of the current device handling and FDI workflow with 
> e.g. the Macbook backlight addon/device) to stop the addon if you get a 
> substituting device with the kernel interface.

I'm not sure this would work. What happens if

1) acpi video device exists. hal is started.
2) hal "stops" addon, but addon hasn't been started yet
3) dcdbas driver gets loaded, addon gets started.

? The only thing I've thought of is to add a property to a defined 
location if a generic backlight interface is present, and then check 
that property doesn't exist before the addon is started. Something like:

<match key="info.subsystem" string="backlight">
  <merge key="/org/freedesktop/Hal/devices/computer:backlight.generic" 
type="bool">true</merge>
</match>

And then check that that's not true before starting the addon?
-- 
Matthew Garrett | mjg59 at srcf.ucam.org


More information about the hal mailing list