From 754882c9852a3fec1db9f25a2b0efc126debbe4b Mon Sep 17 00:00:00 2001 From: Andrei Radulescu Date: Sat, 25 Jan 2025 22:29:48 +0200 Subject: [PATCH] reset: auto-format is back (#34479) * Revert "update factory reset" This reverts commit 533206be2f9518959bbc44d9aa0119015c39ba48. * keep reset message * Update selfdrive/ui/qt/setup/reset.h --------- Co-authored-by: Adeeb Shihadeh --- selfdrive/ui/qt/setup/reset.cc | 7 +++++++ selfdrive/ui/qt/setup/reset.h | 1 + 2 files changed, 8 insertions(+) diff --git a/selfdrive/ui/qt/setup/reset.cc b/selfdrive/ui/qt/setup/reset.cc index c9e0525784..82fd5a7820 100644 --- a/selfdrive/ui/qt/setup/reset.cc +++ b/selfdrive/ui/qt/setup/reset.cc @@ -97,6 +97,11 @@ Reset::Reset(ResetMode mode, QWidget *parent) : QWidget(parent) { body->setText(tr("Unable to mount data partition. Partition may be corrupted. Press confirm to erase and reset your device.")); } + // automatically start if we're just finishing up an ABL reset + if (mode == ResetMode::FORMAT) { + startReset(); + } + setStyleSheet(R"( * { font-family: Inter; @@ -124,6 +129,8 @@ int main(int argc, char *argv[]) { if (argc > 1) { if (strcmp(argv[1], "--recover") == 0) { mode = ResetMode::RECOVER; + } else if (strcmp(argv[1], "--format") == 0) { + mode = ResetMode::FORMAT; } } diff --git a/selfdrive/ui/qt/setup/reset.h b/selfdrive/ui/qt/setup/reset.h index 8bf368e3e8..2e0784cdc9 100644 --- a/selfdrive/ui/qt/setup/reset.h +++ b/selfdrive/ui/qt/setup/reset.h @@ -5,6 +5,7 @@ enum ResetMode { USER_RESET, // user initiated a factory reset from openpilot RECOVER, // userdata is corrupt for some reason, give a chance to recover + FORMAT, // finish up a factory reset from a tool that doesn't flash an empty partition to userdata }; class Reset : public QWidget {