ABL reset (#111)

* ABL reset

* update app
This commit is contained in:
Adeeb Shihadeh
2023-02-22 14:05:58 -08:00
committed by GitHub
parent 26c7282be7
commit cf4c7f04d9
2 changed files with 9 additions and 18 deletions
+9 -18
View File
@@ -38,27 +38,18 @@ handle_setup_keys () {
fi
}
# trigger factory reset if screen is pressed for 2s
TOUCH_CNT=0
for ((i=0; i < 100; i++)); do
# EV_KEY 330 = BTN_TOUCH, returns 10 when pressed
evtest --query /dev/input/by-path/platform-894000.i2c-event EV_KEY 330
if [ "$?" -eq 10 ]; then
((TOUCH_CNT++))
fi
sleep 0.02
done
if [ -f "$RESET_TRIGGER" ] || (( TOUCH_CNT >= 10 )); then
echo "launching system reset"
# factory reset handling
if [ -f "$RESET_TRIGGER" ]; then
echo "launching system reset, reset trigger present"
rm -f $RESET_TRIGGER
$RESET
fi
# load system reset if userdata is not mounted
if ! mountpoint -q /data; then
elif ! mountpoint -q /data; then
echo "userdata not mounted. loading system reset"
$RESET --recover
if [ "$(head -c 15 /dev/disk/by-partlabel/userdata)" == "COMMA_ABL_RESET" ]; then
$RESET --format
else
$RESET --recover
fi
fi
# symlink vscode to userdata
Binary file not shown.