Sleep Quirk Debugger

Back to the main suspend page

Trying quirks

Using pm-suspend manually

While debeugging a machine, you may want to try quirks to see if the machine with survive a suspend-resume sequence. The pm-suspend and pm-hibernate scripts accept command line options that allow you to test new options.

[root@localhost ~]# pm-suspend --help
pm-action [options]

Options can change how the supend or hibernate is done.

Possible actions are:

  --quirk-dpms-on
  --quirk-dpms-suspend
  --quirk-radeon-off
  --quirk-s3-bios
  --quirk-s3-mode
  --quirk-vbe-post
  --quirk-vbemode-restore
  --quirk-vbestate-restore
  --quirk-vga-mode3

Multiple quirks are specified on the command line (in no particular order), e.g.:

pm-suspend --quirk-vbestate-restore --quirk-s3-bios --quirk-s3-mode

The options specified here will only be used if added manually.

Trying quirks by editing FDI files

If the quirks are added to a local fdi file, then the quirks get used when invoking a suspend as a user using gnome-power-manager. The quirks have to be added this way to form a database of machine types to quirks.

HAL quirk names correspond to the pm-suspend quirk properties in the following way:

HAL quirk namepm-suspend option
power_management.quirk.s3_bios--quirk-s3-bios
power_management.quirk.s3_mode--quirk-s3-mode
power_management.quirk.dpms_suspend--quirk-dpms-suspend
power_management.quirk.dpms_on--quirk-dpms-on
power_management.quirk.vbestate_restore--quirk-vbestate-restore
power_management.quirk.vbemode_restore--quirk-vbemode-restore
power_management.quirk.vga_mode_3--quirk-vga-mode3
power_management.quirk.vbe_post--quirk-vbe-post
power_management.quirk.radeon_off--quirk-radeon-off

Editing a local fdi file to test

Now we can edit an fdi file for a fictional IBM laptop.

[root@localhost ~]# cd /usr/share/hal/fdi/information/10freedesktop
[root@localhost 10freedesktop]# ls 20-video-quirk-pm-*
20-video-quirk-pm-acer.fdi     20-video-quirk-pm-ibm.fdi
20-video-quirk-pm-apple.fdi    20-video-quirk-pm-lenovo.fdi
20-video-quirk-pm-asus.fdi     20-video-quirk-pm-misc.fdi
20-video-quirk-pm-dell.fdi     20-video-quirk-pm-sony.fdi
20-video-quirk-pm-fujitsu.fdi  20-video-quirk-pm-toshiba.fdi
20-video-quirk-pm-hp.fdi
[root@localhost 10freedesktop]# gedit 20-video-quirk-pm-ibm.fdi

Now the following XML is displayed:

...
      <!-- X40 -->
      <match key="system.hardware.product" prefix="2371">
        <match key="system.hardware.version" string="ThinkPad X40">
          <merge key="power_management.quirk.s3_bios" type="bool">true</merge>
          <merge key="power_management.quirk.s3_mode" type="bool">true</merge>
        </match>
      </match>
...

Now, hypothetically, we want to add a Lenovo ThinkPad X41. We can find the values of system.hardware.* using:

[root@localhost 10freedesktop]# lshal | grep system.hardware
  system.hardware.product = '1807Y8J'  (string)
  system.hardware.serial = 'xxxxxxx'  (string)
  system.hardware.uuid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'  (string)
  system.hardware.vendor = 'LENOVO'  (string)
  system.hardware.version = 'ThinkPad X41'  (string)

We can then add the following fdi segment:

      <!-- X40 -->
      <match key="system.hardware.product" string="1807Y8J">
        <match key="system.hardware.version" string="ThinkPad X41">
          <merge key="power_management.quirk.s3_bios" type="bool">true</merge>
          <merge key="power_management.quirk.s3_mode" type="bool">true</merge>
        </match>
      </match>

Then restart HAL using either:

[root@localhost ~]# /sbin/service haldaemon restart
Stopping HAL daemon:                                       [  OK  ]
Starting HAL daemon:                                       [  OK  ]

or:

sudo /etc/init.d/hal restart

To check the quirk has been detected and is present you can do:

lshal | grep quirk

Hopefully then clicking on GNOME Power Manager 'suspend' buttons (or just pressing the keyboard shortcuts) should initiate a successful suspend. Please take the few extra steps to submit this data so that suspend just works for less technical users.

[NOTE]

If you issue a pm-suspend command without any options then the fdi quirks will not be used. You still have to use the --quirk-dpms-on type arguments. There is discussion to add a new argument --auto to use the hal quirks, but this has not yet been included upstream.

Back to the main suspend page