Migrating suspend quirks away from hal

Victor Lowther victor.lowther at gmail.com
Sun Nov 15 20:01:18 PST 2009


On Sun, 2009-11-15 at 21:59 -0600, Victor Lowther wrote:
> On Fri, 2009-11-13 at 20:42 -0600, Victor Lowther wrote:
> > On Fri, 2009-11-13 at 12:30 -0600, Victor Lowther wrote:
> > > On Nov 13, 2009, at 7:30 AM, Martin Pitt <martin.pitt at ubuntu.com> wrote:
> > > 
> > > > Hello Victor, hello Richard, hello devkitters,
> > > >
> > > > in the past half year we have come quite far with the "halsectomy",
> > > > i.e. deprecating hal [1]. The main two remaining items are now X.org
> > > > input devices (where a patch is already being discussed), and the
> > > > suspend quirks in pm-utils.
> > > >
> > > > I would like to push this forward a little. From what I can see, the
> > > > are two sensible options:
> > > >
> > > > (1) Convert the hal-info suspend quirks to a simple text format and
> > > >     put it into/maintain it directly in pm-utils.
> > > >
> > > >     → nice encapsulation, maintained at the place where they are
> > > >     actually needed
> > > 
> > > I did this as an experiment last year, and it worked out well at the  
> > > time. I will see if I still have that branch around somewhere to make  
> > > available for comment.
> > 
> > Attached is the code I posted to the hal mailing list last November to
> > migrate the video quirk database out of HAL and into something a little
> > easier for bash to deal with.  It did not have the full expressive power
> > of the hal-info XML format, but that was mostly not needed anyways --
> > the only place it was used was the 21-nvidia quirk for handling g80
> > chipsets with the nv driver, but that can just as easily be hacked into
> > a few lines of bash.
> 
> And now, a version that actaully works.  With a bit of glue code, this
> can replace auto quirk and smart kernel driver handling in pm-utils.

Now with actual file!

> Yes, I know that I am insane for parsing XML in bash. In my defense, I
> only do it when I have to. The sooner we no longer rely on .fdi files,
> the better.
> 
> Comments, flames (except XML-related ones and ones implying we no longer
> have to worry about quirks), etc. welcome.
> 
> > Hacking this into a pm-utils hook would not be that tricky -- the flow
> > would go something like this:
> > 
> > if has_kms || has_nvidia || has_fglrx || has_smart_intel; then
> > 	skip_all_quirks
> > elif has_nvidia_g80; then
> > 	do_g80_magic
> > else
> > 	use_video_quirks
> > fi 
> > 
> > video_quirks definitly has bugs, but it did OK as a proof of concept for
> > me.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: video-quirks.bash
Type: application/x-shellscript
Size: 16321 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20091115/558ab24e/attachment-0001.bin 


More information about the hal mailing list