mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
b745bfa6dc
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>
32 lines
419 B
Bash
Executable File
32 lines
419 B
Bash
Executable File
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
OVERLAY="$( grep ' /overlay ' /proc/mounts )"
|
|
|
|
case "$ACTION" in
|
|
pressed)
|
|
[ -z "$OVERLAY" ] && return 0
|
|
|
|
return 5
|
|
;;
|
|
timeout)
|
|
. /etc/diag.sh
|
|
set_state failsafe
|
|
;;
|
|
released)
|
|
if [ "$SEEN" -lt 1 ]
|
|
then
|
|
echo "REBOOT" > /dev/console
|
|
sync
|
|
reboot
|
|
elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
|
|
then
|
|
echo "FACTORY RESET" > /dev/console
|
|
jffs2reset -y && reboot &
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
return 0
|