[aboot] unless cancelled with 'back' key, default to booting from flash
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 42793fc..40c9c4f 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -39,6 +39,7 @@
#include <dev/flash.h>
#include <lib/ptable.h>
+#include <dev/keys.h>
#include "bootimg.h"
#include "fastboot.h"
@@ -289,6 +290,14 @@
void aboot_init(const struct app_descriptor *app)
{
+ if (keys_get_state(KEY_BACK) != 0)
+ goto fastboot;
+
+ boot_linux_from_flash();
+ dprintf(CRITICAL, "ERROR: Could not do normal boot. Reverting "
+ "to fastboot mode.\n");
+
+fastboot:
udc_init(&surf_udc_device);
fastboot_register("boot", cmd_boot);