mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 13:32:05 +08:00
add sdcard support (#22703)
* generalize * factory reset old-commit-hash: f4c2398db4c2dacc690d4115c04c7afb98a52a08
This commit is contained in:
@@ -203,7 +203,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"Offroad_InvalidTime", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_IsTakingSnapshot", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_NeosUpdate", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_NvmeMissing", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_StorageMissing", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_PandaFirmwareMismatch", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
|
||||
{"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START},
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
"text": "Device failed to register. It will not connect to or upload to comma.ai servers, and receives no support from comma.ai. If this is an official device, contact support@comma.ai.",
|
||||
"severity": 1
|
||||
},
|
||||
"Offroad_NvmeMissing": {
|
||||
"text": "NVME drive not mounted.",
|
||||
"Offroad_StorageMissing": {
|
||||
"text": "Storage drive not mounted.",
|
||||
"severity": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ def thermald_thread():
|
||||
set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not startup_conditions["device_temp_good"]))
|
||||
|
||||
if TICI:
|
||||
set_offroad_alert_if_changed("Offroad_NvmeMissing", (not Path("/data/media").is_mount()))
|
||||
set_offroad_alert_if_changed("Offroad_StorageMissing", (not Path("/data/media").is_mount()))
|
||||
|
||||
# Handle offroad/onroad transition
|
||||
should_start = all(startup_conditions.values())
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
#include "selfdrive/ui/qt/setup/reset.h"
|
||||
|
||||
#define NVME "/dev/nvme0n1"
|
||||
#define SDCARD "/dev/mmcblk0"
|
||||
#define USERDATA "/dev/disk/by-partlabel/userdata"
|
||||
|
||||
void Reset::doReset() {
|
||||
// best effort to wipe nvme
|
||||
// best effort to wipe nvme and sd card
|
||||
std::system("sudo umount " NVME);
|
||||
std::system("yes | sudo mkfs.ext4 " NVME);
|
||||
std::system("sudo umount " SDCARD);
|
||||
std::system("yes | sudo mkfs.ext4 " SDCARD);
|
||||
|
||||
// we handle two cases here
|
||||
// * user-prompted factory reset
|
||||
|
||||
Reference in New Issue
Block a user