[LEDE-DEV] [PATCH v2] base-files: ensure reset only works if an overlay exists
Rafał Miłecki
zajec5 at gmail.com
Wed Oct 19 22:29:02 PDT 2016
On 20 October 2016 at 05:23, Chris Blake <chrisrblake93 at gmail.com> wrote:
> 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
Before:
if $SEEN < 1 => reboot
if $SEEN > 5 => factory
After
if $SEEN > 5 => factory
else => reboot
Can you see that changed behavior now?
More information about the Lede-dev
mailing list