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

Commit b08cf09c authored by Michael Gernoth's avatar Michael Gernoth Committed by Gerrit Code Review
Browse files

android_reboot: execute recovery pre command while rw mounted

The TARGET_RECOVERY_PRE_COMMAND might need to write to mounted
partitions, so execute it before re-mounting everything as read-
only.

Change-Id: I66b2e81b8c05b9aa6eeddbfb589619ce53e36e2b
parent 74b61ddd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -110,9 +110,6 @@ int android_reboot(int cmd, int flags UNUSED, char *arg)
    int ret = 0;
    int reason = -1;

    sync();
    remount_ro();

#ifdef RECOVERY_PRE_COMMAND
    if (cmd == (int) ANDROID_RB_RESTART2) {
        if (arg && strlen(arg) > 0) {
@@ -123,6 +120,9 @@ int android_reboot(int cmd, int flags UNUSED, char *arg)
    }
#endif

    sync();
    remount_ro();

    switch (cmd) {
        case ANDROID_RB_RESTART:
            reason = RB_AUTOBOOT;