Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efa1bab9 authored by Doug Zongker's avatar Doug Zongker
Browse files

change log recovery to generic device_recovery_start function

Remove (or at least stop calling) the HTC-specific mechanism for
preserving the recovery log from before a radio or hboot update.
Replace it with a generic device_recovery_start() function which each
device's code can implement to do whatever it wants on recovery
startup.

Change-Id: If3cca4b498c0b1cf0565236404ecf56a1fc46123
parent aa062531
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ char* MENU_ITEMS[] = { "reboot system now",
                       "wipe cache partition",
                       NULL };

int device_recovery_start() {
    return 0;
}

int device_toggle_display(volatile char* key_pressed, int key_code) {
    return key_code == KEY_HOME;
}
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ int maybe_install_firmware_update(const char *send_intent,
     * wipe the cache and reboot into the system.)
     */
    snprintf(boot.command, sizeof(boot.command), "update-%s", update_type);
    strlcat(boot.recovery, "--recover_log\n", sizeof(boot.recovery));
    if (set_bootloader_message(&boot)) {
        format_root_device("CACHE:");
        return -1;
+3 −3
Original line number Diff line number Diff line
@@ -44,9 +44,8 @@ static const struct option OPTIONS[] = {
  { "update_package", required_argument, NULL, 'u' },
  { "wipe_data", no_argument, NULL, 'w' },
  { "wipe_cache", no_argument, NULL, 'c' },
  // TODO{oam}: implement improved command line passing key, egnot to review.
  // TODO{oam}: implement improved command line passing key, egnor to review.
  { "set_encrypted_filesystem", required_argument, NULL, 'e' },
  { "recover_log", no_argument, NULL, 'g' },
  { NULL, 0, NULL, 0 },
};

@@ -492,13 +491,14 @@ main(int argc, char **argv) {
        case 'w': wipe_data = wipe_cache = 1; break;
        case 'c': wipe_cache = 1; break;
        case 'e': efs_mode = optarg; toggle_efs = 1; break;
        case 'g': recover_firmware_update_log(); break;
        case '?':
            LOGE("Invalid command argument\n");
            continue;
        }
    }

    device_recovery_start();

    fprintf(stderr, "Command:");
    for (arg = 0; arg < argc; arg++) {
        fprintf(stderr, " \"%s\"", argv[arg]);
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
#ifndef _RECOVERY_UI_H
#define _RECOVERY_UI_H

// Called when recovery starts up.  Returns 0.
extern int device_recovery_start();

// Called in the input thread when a new key (key_code) is pressed.
// *key_pressed is an array of KEY_MAX+1 bytes indicating which other
// keys are already pressed.  Return true if the text display should