During the last two days I learnt smth very known: RTFM. I'm very much grateful iRex guys for opening the sources.
Basically, all the needed code has been available since long time ago. Namely, sysd/system.c : do_poweroff(), prepare_standby() and on_standby() (first half of the latter).
I've customized the sysd project to produce the "poweroff" binary. The compiled executables are located in poweroff.zip. Unpack them to Programs/ folder and enjoy the old-new functionality (even with splash screen!!
). Working fine on my DR800S. Shutdown takes about 20-30 seconds. Please check during the testing if new bookmarks etc. are not lost (they should not). Looking forward to your impressions.
The most important source is poweroff-src/src/main.c . This is an extraction of system.c to perform only one operation, but doing it properly. GregorRichards has started this direction, I've been following it.
To compile the code execute build_all_from_scratch.sh, then rename src/sysd to poweroff and (optionally) strip it with arm-poky-linux-gnueabi-strip.
Sure, the source can be much simplified. The main task to do is to start with main.c and add the needed methods. And I'd be happy to have a build file like GregorRichards's one .. Ok, later. Or maybe someone has an inspiration - most welcome to participate
P.S. The icon is there waiting for lua script