Sounds cool and easy to implement hardware-wise.
Can you share the code for that?

Something like this:

// use plain old open to avoid any buffering etc
int enablefd = open("/proc/sys/kernel/sysrq", O_SYNC | O_RDWR);
int trgfd = open("/proc/sysrq-trigger", O_SYNC | O_RDWR);

// enable sysrq
write(enablefd, "1\n", 2);
close(enablefd);

// sync disks
write(trgfd, "s\n", 2);

// remount ro
write(trgfd, "u\n", 2);
close(trgfd);

// poweroff
system ("/usr/bin/systemctl poweroff -f");

exit(0);


As I mentioned, I use full data+metadata journaling on the filesystem, not just metadata.

The only issue is that the system doesn't restart if power is reapplied before the supercap is fully discharged. You have to wait 10 seconds or so before a restart is possible. I'm not sure how to fix that.

- Mike

--
For more options, visit http://beagleboard.org/discuss
--- You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to