aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorChris Blake <chrisrblake93@gmail.com>2016-10-24 13:13:15 -0500
committerJohn Crispin <john@phrozen.org>2016-10-27 12:45:05 +0200
commitb745bfa6dcba4fb6d67e6893bc8e706ec2e687c3 (patch)
treeca70c305051b3d3a5058dd879673614ac00b0ec1 /package/base-files/files
parent83ece71d63df949da566a79787e4162d7ed451ea (diff)
downloadupstream-b745bfa6dcba4fb6d67e6893bc8e706ec2e687c3.tar.gz
upstream-b745bfa6dcba4fb6d67e6893bc8e706ec2e687c3.tar.bz2
upstream-b745bfa6dcba4fb6d67e6893bc8e706ec2e687c3.zip
base-files: Ensure reset only works if an overlay exists
Currently the reset script will try to run jffs2reset on boards that are running a rw rootfs, such as ext4. This will cause jffs2reset to fail and the board to never reboot while the LED blinks until a manual reboot. This commit does two different things: 1. Disables reset on boards that do not have an overlay mount 2. Disables the Blinking LED after 5 seconds if the board does not support reset Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/rc.button/reset6
1 files changed, 5 insertions, 1 deletions
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset
index c6dc7cfbc0..4265767437 100755
--- a/package/base-files/files/etc/rc.button/reset
+++ b/package/base-files/files/etc/rc.button/reset
@@ -2,8 +2,12 @@
. /lib/functions.sh
+OVERLAY="$( grep ' /overlay ' /proc/mounts )"
+
case "$ACTION" in
pressed)
+ [ -z "$OVERLAY" ] && return 0
+
return 5
;;
timeout)
@@ -16,7 +20,7 @@ released)
echo "REBOOT" > /dev/console
sync
reboot
- elif [ "$SEEN" -gt 5 ]
+ elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &