View Single Post
Posts: 167 | Thanked: 204 times | Joined on Jul 2010
#5
I'm pleased to confirm that what I proposed above (automating what BackupMenu does) is possible, without too much reinventing the wheel.

So far, I've made a bastardised copy of the core script of BackupMenu which does exactly the same as if I ran BM in the usual way and pressed B for backup, T for both, S twice to put both on the SD card, wait for it to happen and auto-reboot when finished. That would cause a reboot/backup loop unless the user closes the keyboard, so I've added a check into /sbin/preinit - if there's a file called /nobootmenu, don't run bootmenu.sh and proceed with Maemo boot as normal, even if the keyboard is open.

That's a long way from finished, but it's enough to show me that this is conceptually possible; all I need to do is create /nobootmenu when we run our automated backup, and remove it again when we successfully boot back into Maemo. Add a way of swapping between the original BackupMenu as written and my bastardised version (currently being done via symlinks), and it will be possible to do something that sets up BM to run an automated backup, reboots the system loading the bastardised BM, which sets the don't-do-this-again flag and takes the backup, then reboots. Post-reboot, we use that flag to avoid running bootmenu.sh and so we boot back into Maemo, where we delete that flag. I've yet to perfect this, but, watch this space. Much credit is due to Robbiethe1st for such a nice clear bit of code, too.

I'll post back when I've fully figured out how to automate this, it's definitely nowhere near fit for public consumption just yet, but I'm having fun...