From 6cf4a986f55dbfd1e6ecdb7d75271c8419738809 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 21 Feb 2023 20:17:18 +0100 Subject: [PATCH] setup: add support for performing factory reset Now that we have dialog on target we can add a user-friendly factory reset dialog. The new `yorn` script handles any form of yes-or-no question, with or without dialog, to call a command. Signed-off-by: Joachim Wiberg --- board/common/rootfs/bin/setup | 1 + board/common/rootfs/bin/yorn | 55 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 board/common/rootfs/bin/yorn diff --git a/board/common/rootfs/bin/setup b/board/common/rootfs/bin/setup index a0267c26..46d0db1b 100755 --- a/board/common/rootfs/bin/setup +++ b/board/common/rootfs/bin/setup @@ -61,6 +61,7 @@ menu:system:System:System Settings exec:_Disable service:edit:initctl disable ~Enter name of service (filename) to disable:~ nop exec:_Change Operating Mode::chom + exec:_Factory Reset::yorn "Reboot and factory reset device, are you sure?" factory -y nop exit:_Main menu.. diff --git a/board/common/rootfs/bin/yorn b/board/common/rootfs/bin/yorn new file mode 100755 index 00000000..e9f17280 --- /dev/null +++ b/board/common/rootfs/bin/yorn @@ -0,0 +1,55 @@ +#!/bin/sh +#set -x + +usage() +{ + cat <