19.10.2016 16:54, Chris Blake:
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.

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="$(cat /proc/mounts | grep ' /overlay ' 2>/dev/null)"
+       if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
+       then

Since you are not really interested in the matches, you can use the exit code as indicator for found/not found:

if [ "$SEEN" -gt 5 ] && grep -q ' /overlay ' /proc/mounts
then

Not sure if it should be done this way since it might be hard to read.

Mathias

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

Reply via email to