[Utopia] Hal and suspend2 support detection



Hi,

	I was looking through the code for gnome-power-manager (g-p-m) and
talking to Richard Hughes, he told me that gpm will depend on calls to
HAL to determine suspend/hibernate support.

I looked into the HAL code (hald.c) and saw hooks to enumerate acpi
support via calls to look at /proc/acpi

I just wonder if there's a possibility to also include support for
suspend2 (which I think makes a great alternative to swsusp (suspend1)
and it's author is working to get it integrated into the vanilla kernel)

Suspend2 populates the /proc/software_suspend directory
ls -l /proc/software_suspend/
total 0
-rw-------  1 root root 0 May 13 16:44 all_settings
-r--------  1 root root 0 May 13 16:44 debug_info
-rw-------  1 root root 0 May 13 16:44 debug_sections
-rw-------  1 root root 0 May 13 16:44 default_console_level
-rw-------  1 root root 0 May 13 16:44 disable_lzf_compression
-rw-------  1 root root 0 May 13 16:44 disable_swapwriter
-rw-------  1 root root 0 May 13 16:44 disable_textmode_support
-rw-------  1 root root 0 May 13 16:44 display_metadata_page
--w-------  1 root root 0 May 13 16:44 do_resume
--w-------  1 root root 0 May 13 16:44 do_suspend
-rw-------  1 root root 0 May 13 16:44 enable_escape
-rw-------  1 root root 0 May 13 16:44 expected_lzf_compression
-rw-------  1 root root 0 May 13 16:44 freeze_timers
-rw-------  1 root root 0 May 13 16:44 freezer_test
-r--------  1 root root 0 May 13 16:44 headerlocations
-rw-------  1 root root 0 May 13 16:44 image_size_limit
-r--------  1 root root 0 May 13 16:44 interface_version
-rw-------  1 root root 0 May 13 16:44 keep_metadata
-r--------  1 root root 0 May 13 16:44 last_result
-rw-------  1 root root 0 May 13 16:44 log_everything
-rw-------  1 root root 0 May 13 16:44 pause_between_steps
-rw-------  1 root root 0 May 13 16:44 powerdown_method
-rw-------  1 root root 0 May 13 16:44 reboot
-rw-------  1 root root 0 May 13 16:44 resume2
-rw-------  1 root root 0 May 13 16:44 slow
-rw-------  1 root root 0 May 13 16:44 swapfilename
-rw-------  1 root root 0 May 13 16:44 test_filter_speed
-rw-------  1 root root 0 May 13 16:44 text_mode_progress_bar
-r--------  1 root root 0 May 13 16:44 version
-rw-------  1 root root 0 May 13 16:44 vga_post

I see that the Root "computer" has these

power_management.is_enabled (1)

can we also export

power_management.suspend2.is_enabled (1) in the code??

We can use the call to check if /proc/software_suspend/version exists
just like the code calls to check for /proc/acpi/info. Perhaps there can
also be code to enumerate the diff options for suspend2 like acpi (eg:
BAT0/BAT1 etc but I think it's no point as these are user/Distro
configured settings)

With these in HAL, I hope that gpm can start moving forward with
implementing suspend/hibernate. It's already a great move towards "Just
Works"

Richard Hughes told me that calls can be made to scripts
like /usr/sbin/hal-hibernate.sh to do the suspending etc.

Right now, suspend2 already has their own version of a hibernate script
which supports swsusp and suspend2. So.. if I plug it gpm for calling, I
get instant hibernate support.

Of course, design wise, this may not be a good idea but I'm just talking
out loud.

Comments?

PS: I've also sent some crude patches to GPM for getting suspend2 into
gpm and Hal. (sent to gpm mailing list)

-- 
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 
98% Microsoft(tm) Free!! 
Neuromancer 16:41:00 up 1 day, 18:13, 14 users, load average: 1.09,
0.86, 0.68 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]