[PATCH] read dmi info from sysfs instead of call dmidecode

Sjoerd Simons sjoerd at luon.net
Mon Nov 26 12:22:15 PST 2007


On Tue, Nov 20, 2007 at 03:55:39PM +0100, Danny Kukawka wrote:
> On Dienstag, 20. November 2007, Doug Klima wrote:
> > Danny Kukawka wrote:
> > > On Dienstag, 13. November 2007, Danny Kukawka wrote:
> > >> On Dienstag, 13. November 2007, Kay Sievers wrote:
> > >>> On Nov 13, 2007 8:08 PM, Danny Kukawka <danny.kukawka at web.de> wrote:
> > >>>> this patch makes HAL to read dmi/smbios information on Linux from
> > >>>> sysfs (/sys/devices/virtual/dmi/id) instead of use a prober to call
> > >>>> and parse dmidecode.
> > >>>
> > >>> You can't jump into sysfs with a /sys/devices/* path, that is not
> > >>> expected to be stable across kernel releases, and the location of this
> > >>> information can even change at runtime for some devices. You need to
> > >>> use the path starting with /sys/class/dmi/*.
> > >>
> > >> Okay, I change it before the commit to /sys/class/dmi/id.
> > >
> > > Any other comments or okay to commit?
> >
> > I like it. I haven't really given the patch much testing since I just
> > built up a kernel yesterday with the support in it. As long as we have
> > the fallback to dmidecode, I'm ok with this. Unless we want to bump our
> > kernel requirement to 2.6.22.
> 
> Yes, it fallback to hald-probe-smbios if /sys/class/dmi/id is not available.
> The only ugly thing is osspec_privileged_init_preparse_set_dmi() which we
> need because some of the sysfs attributes are only readable by root. So we
> need to parse them before drop privileges.

Why not do the parsing in a callout with root priviledges instead of in hal
itself ?

  Sjoerd
-- 
If your aim in life is nothing, you can't miss.


More information about the hal mailing list