mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-07-09 16:52:05 +08:00
only check for factory reset conditions on first comma service run
This commit is contained in:
@@ -44,19 +44,22 @@ handle_setup_keys () {
|
||||
}
|
||||
|
||||
# factory reset handling
|
||||
if [ -f "$RESET_TRIGGER" ]; then
|
||||
echo "launching system reset, reset trigger present"
|
||||
rm -f $RESET_TRIGGER
|
||||
$RESET
|
||||
elif (( "$(cat /sys/devices/platform/soc/894000.i2c/i2c-2/2-0017/touch_count)" > 4 )); then
|
||||
echo "launching system reset, got taps"
|
||||
$RESET
|
||||
elif ! mountpoint -q /data; then
|
||||
echo "userdata not mounted. loading system reset"
|
||||
if [ "$(head -c 15 /dev/disk/by-partlabel/userdata)" == "COMMA_RESET" ]; then
|
||||
$RESET --format
|
||||
else
|
||||
$RESET --recover
|
||||
if [ ! -f /tmp/booted ]; then
|
||||
touch /tmp/booted
|
||||
if [ -f "$RESET_TRIGGER" ]; then
|
||||
echo "launching system reset, reset trigger present"
|
||||
rm -f $RESET_TRIGGER
|
||||
$RESET
|
||||
elif (( "$(cat /sys/devices/platform/soc/894000.i2c/i2c-2/2-0017/touch_count)" > 4 )); then
|
||||
echo "launching system reset, got taps"
|
||||
$RESET
|
||||
elif ! mountpoint -q /data; then
|
||||
echo "userdata not mounted. loading system reset"
|
||||
if [ "$(head -c 15 /dev/disk/by-partlabel/userdata)" == "COMMA_RESET" ]; then
|
||||
$RESET --format
|
||||
else
|
||||
$RESET --recover
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user