View Single Post
Old 04-29-2010, 01:17 PM   #7
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
Quote:
Originally Posted by Gertjan View Post
A cleaner approach would be to follow the path of SYSD's API call "sysShutdown". For DR1000 this triggers the shutdown, on DR800 it goes to standby mode. With a bit of juggling, a call could be added to do the complete shutdown for DR800.
I know you probably don't have time to really look into this too far, but does it sound like I'm on the right track? I can figure out more of the details if this sounds like the right approach. BTW, I only looked at this for about 30 minutes, so if I'm completely clueless and need to spend more time looking at it just let me know, no need to try to explain it further.

I see there's a sysclient that can be called with sysShutdown. This in turn leads to sys_standby(). That's where we have the branch between the DR800 and DR1000. The DR800 goes to prepare_standby() and the DR1000 goes to do_poweroff().

If we add a new argument to sysclient like userShutdown, and make a clone of sys_standby(), something like user_standby() that doesn't do the branch based on the device, but just goes to do_poweroff()... I think that's what we're looking for.

The only thing I've seen in do_poweroff() that is a little bit of a concern is where it unlocks/enables the DR1000 sensors. I haven't look into it deep enough to know if calling that will cause any issues on the DR800, or if we should modify on_poweroff_continue() to check for DR800 vs DR1000.

Assuming all that works, we can then create a .desktop file that calls "sysclient userShutdown".
Shaggy is offline   Reply With Quote