Message ID | 1439251044-15693-1-git-send-email-zajec5@gmail.com |
---|---|
State | Accepted |
Headers | show |
* Rafał Miłecki <zajec5@gmail.com> [11.08.2015 21:01]: is there a special reason, that you are using exec /sbin/poweroff instead of just /sbin/poweroff bye, bastian
On 12 August 2015 at 09:32, Bastian Bittorf <bittorf@bluebottle.com> wrote: > * Rafał Miłecki <zajec5@gmail.com> [11.08.2015 21:01]: > > is there a special reason, that you are using > > exec /sbin/poweroff > > instead of just > > /sbin/poweroff I think you're commenting on a wrong patch.
* Rafał Miłecki <zajec5@gmail.com> [12.08.2015 15:10]:
> I think you're commenting on a wrong patch.
sorry, yes - the comment applies to:
a643de25/r40909 and i just stumpled upon this
while reading the affected sources of your patch.
@stefan: why is this 'exec' needed?
bye, bastian
hi, it's not needed, you can remove it. Stefan 2015-08-12 15:19 GMT+02:00 Bastian Bittorf <bittorf@bluebottle.com>: > * Rafał Miłecki <zajec5@gmail.com> [12.08.2015 15:10]: > > I think you're commenting on a wrong patch. > > sorry, yes - the comment applies to: > a643de25/r40909 and i just stumpled upon this > while reading the affected sources of your patch. > > @stefan: why is this 'exec' needed? > > bye, bastian >
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset index 3e24146..c6dc7cf 100755 --- a/package/base-files/files/etc/rc.button/reset +++ b/package/base-files/files/etc/rc.button/reset @@ -1,20 +1,27 @@ #!/bin/sh -[ "${ACTION}" = "released" ] || exit 0 - . /lib/functions.sh -logger "$BUTTON pressed for $SEEN seconds" - -if [ "$SEEN" -lt 1 ] -then - echo "REBOOT" > /dev/console - sync - reboot -elif [ "$SEEN" -gt 5 ] -then - echo "FACTORY RESET" > /dev/console - jffs2reset -y && reboot & -fi +case "$ACTION" in +pressed) + 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 ] + then + echo "FACTORY RESET" > /dev/console + jffs2reset -y && reboot & + fi +;; +esac return 0
With this change we let user know 5 seconds have passed and reset button can be released (to trigger factory reset) Signed-off-by: Rafał Miłecki <zajec5@gmail.com> --- package/base-files/files/etc/rc.button/reset | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-)