[LEDE-DEV] [PATCH] base-files: ensure reset only works if an overlay exists

Chris Blake chrisrblake93 at gmail.com
Wed Oct 19 20:16:21 PDT 2016


Rafal,

I am not sure I see the issue you are mentioning. The patch's goal is
to disable the "reset" feature for devices that do not have an
overlay, and instead just reboot the device. This patch does that, and
was tested on an ar71xx and x86_64 ext4 platform.

Regards,
Chris Blake

On Wed, Oct 19, 2016 at 4:33 PM, Rafał Miłecki <zajec5 at gmail.com> wrote:
> On 19 October 2016 at 16:54, Chris Blake <chrisrblake93 at gmail.com> wrote:
>> 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 <chrisrblake93 at 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
>> +               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
>
> It seems to me you just changed behavior for pressing button for time
> between 1 and 5 seconds. Your commit message doesn't state you wanted
> to do that and I don't think we should.



More information about the Lede-dev mailing list