Policy, defaults and broken hardware
David Zeuthen
david at fubar.dk
Tue Jun 1 14:40:47 PDT 2004
Hi,
So sometimes reality and theory doesn't fit. Like with broken hardware
and/or broken drivers. As you may know, HAL does a bit of policy, namely
assuming that hardware works. This may lead to adverse effects since HAL
uses various techniques that may stretch what the hardware or driver is
capable (look at bug reports for magicdev for example). So I've
introduced the following properties for storage devices, specified in
[1].
What should the defaults be? That's a really good question, it seems to
vary what different distros do - some disable automount per default (but
use whitelists), others use funky stuff like supermount while yet others
use conventional methods but with blacklists instead of whitelists.
So, the defaults is now configurable from (drum roll), the brand new HAL
daemon configuration file in /etc/hal/hald.conf; In [2] you can find the
one shipped with HAL. This one is pretty liberal; it assumes everything
works. Note that the defaults may be overridden from .fdi files; that's
the whole point anyway of .fdi files; to give additional clues about the
hardware. Comments on the format is welcome, I haven't given it much
thought.
I hope this addresses the various policy differences among
distributions. Maybe one day someone will make a single repository of
.fdi for a lot devices and then the default policy becomes rather void.
Thanks,
David
[1] :
storage.media_check_enabled
---------------------------
if this property is TRUE then HAL will indeed poll the drive for media
changes. If FALSE, no polling is done; note you can do the polling from
the commandline using touch(1) on the device file.
storage.automount_enabled
-------------------------
HAL itself doesn't use this, but policy engines, such as
gnome-volume-manager, should respect this and only mount volumes from
this storage device if, and only if, this is set to TRUE.
storage.cdrom.eject_check_enabled
---------------------------------
If set to TRUE, HAL will poll the optical drive to check whether the
eject button is pressed.
[2] :
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<!-- This configuration file controls the Hardware Abstraction Layer
daemon - it is meant that OS vendors customize this file to reflect
their desired policy.
-->
<haldconfig>
<!-- Default value for storage.media_check_enabled for devices of
capability storage - this can be overridden by .fdi files.
Setting this to false results a whitelist policy, e.g. media
check is only enabled for storage devices with a .fdi file
saying so.
Conversely, setting it to true results in a blacklist policy
where media check is enabled by default but may be overridden
by a .fdi for devices causing trouble.
-->
<storage_media_check_enabled>true</storage_media_check_enabled>
<!-- Default value for storage.automount_enabled for devices of
capability storage - this can be overridden by .fdi files.
Setting this to false results a whitelist policy, e.g. policy
agents should only automount storage devices with a .fdi file
saying so.
Conversely, setting it to true results in a blacklist policy
where policy agents should always automount unless this is
explicitly overridden by .fdi for devices causing trouble.
-->
<storage_automount_enabled>true</storage_automount_enabled>
<!-- Default value for storage.cdrom.eject_check_enabled for devices
of capability storage.cdrom - this can be overridden by .fdi
files.
Setting this to false results a whitelist policy, e.g. the
eject button is only checked if this property is overridden in
a .fdi file.
Conversely, setting it to true results in a blacklist policy
where the eject button is always checked unless this is
explicitly overridden by .fdi file for devices causing trouble.
-->
<storage_cdrom_eject_check_enabled>true</storage_cdrom_eject_check_enabled>
</haldconfig>
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list