[Pm-utils] [PATCH 1/3] Automagically grab quirks from HAL

Michael Biebl mbiebl at gmail.com
Wed Sep 10 05:24:06 PDT 2008


2008/9/10 Victor Lowther <victor.lowther at gmail.com>:
> Add functionality to grab quirks from HAL if we were not invoked by HAL.
>
> To use this functionality, run pm(suspend|hibernate|suspend-hybrid) with
> --auto-quirks.
>
> ---
>  pm/sleep.d/00auto-quirk |   26 ++++++++++++++++++++++++++
>  pm/sleep.d/Makefile.am  |    1 +
>  2 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/pm/sleep.d/00auto-quirk b/pm/sleep.d/00auto-quirk
> new file mode 100755
> index 0000000..3514869
> --- /dev/null
> +++ b/pm/sleep.d/00auto-quirk
> @@ -0,0 +1,26 @@
> +#!/bin/sh
> +
> +. "${PM_FUNCTIONS}"
> +
> +do_add_quirks()
> +{
> +       add_parameters $(lshal | \
> +       awk -F '[. ]' \
> +               '/  power_management.quirk.[a-z_]+ = true/ \
> +                       {gsub(/_/, "-", $5); printf("--quirk-%s", $5)}')
> +}
> +
> +mabye_add_quirks()
    ^^^^^^^^^^^^^^^^^^^^^^^
typo: s/mabye/maybe/
maybe_add_quirks sounds a bit strange though, why not call it
auto_add_quirks or try_add_quirks.

> +{
> +       for p in ${PM_CMDLINE}; do
> +               [ "$p" = "--auto-quirks" ] || continue
> +               do_add_quirks
> +               remove_parameters --auto-quirks
> +       done
> +}
> +
> +case $1 in
> +       suspend|hibernate) mabye_add_quirks ;;

Same here

> +       *) exit $NA
> +esac
> +
> diff --git a/pm/sleep.d/Makefile.am b/pm/sleep.d/Makefile.am
> index a2f31cc..2972d20 100644
> --- a/pm/sleep.d/Makefile.am
> +++ b/pm/sleep.d/Makefile.am
> @@ -1,6 +1,7 @@
>  sleepdir = $(libdir)/pm-utils/sleep.d
>
>  sleep_SCRIPTS =                        \
> +       00auto-quirk            \
>        00logging               \
>        00powersave             \
>        01grub                  \
> --
> 1.5.6.5
>
> _______________________________________________
> Pm-utils mailing list
> Pm-utils at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pm-utils
>



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the Pm-utils mailing list