Currently the reset script will try to run jffs2reset on boards that are
running a rw ext4 or other rootfs, which will then cause jffs2reset to
fail and the board to never reboot. This change ensures that jffs2reset
is only ran if an overlay is mounted, and disables the "reset" feature if
no /overlay is mounted on the device.

Signed-off-by: Chris Blake <chrisrblak...@gmail.com>
---
 package/base-files/files/etc/rc.button/reset | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/package/base-files/files/etc/rc.button/reset 
b/package/base-files/files/etc/rc.button/reset
index c6dc7cf..fab9a6c 100755
--- a/package/base-files/files/etc/rc.button/reset
+++ b/package/base-files/files/etc/rc.button/reset
@@ -11,15 +11,16 @@ timeout)
        set_state failsafe
 ;;
 released)
-       if [ "$SEEN" -lt 1 ]
+       OVERLAY="$( grep ' /overlay ' /proc/mounts )"
+       if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
+       then
+               echo "FACTORY RESET" > /dev/console
+               jffs2reset -y && reboot &
+       elif [ "$SEEN" ]
        then
                echo "REBOOT" > /dev/console
                sync
                reboot
-       elif [ "$SEEN" -gt 5 ]
-       then
-               echo "FACTORY RESET" > /dev/console
-               jffs2reset -y && reboot &
        fi
 ;;
 esac
--
2.7.4

_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to