openwrt icon indicating copy to clipboard operation
openwrt copied to clipboard

base-files: Increase failsafe trigger wait time from 2 to 4 sec

Open hnyman opened this issue 2 years ago • 4 comments

Increase the failsafe waiting timeout period from 2 seconds to 4 seconds.

Since commit 29207748b in 2015 we have had a rapid LED blinking indication for the failsafe triggering period. But the really short timeout of 2 seconds requires snappy reaction time from the user to notice the rapid LED blinking and to push button inside the short window.

Relax the timeout to 4 seconds, which more easily allows to notice the change in LED blinking and push a button.

Note, this will increase the booting time by two seconds, but that should not be noticeable by most users (when compared to the total length of the boot process).

I have carried this in my own build for years, but thought to "upstream" it now.

hnyman avatar Jan 22 '23 09:01 hnyman

what would be far more ideal, that we first listen for the trigger, do some early boot stuffs in parallel, and only then disable the trigger; but not sure if our init system can handle that ...

oliv3r avatar Jan 22 '23 11:01 oliv3r

@hnyman can you give us some feedback also about #10235 Not really aware of these configs but from what i can see the wait time is used for both button and key press so setting it to 0 effectively disable failsafe?

Ansuel avatar Jan 22 '23 12:01 Ansuel

@hnyman can you give us some feedback also about https://github.com/openwrt/openwrt/pull/10235 Not really aware of these configs but from what i can see the wait time is used for both button and key press so setting it to 0 effectively disable failsafe?

I haven't really looked for what happens if the timeout is set to 0.

But here is my quick take on the code:

The complete disabling is (since b4e33a1c in 2016) meant to happen with TARGET_PREINIT_DISABLE_FAILSAFE, not with setting the time to 0.

Looking at the code touched by #10235, I think that @aparcar is partially right. There is likely an unnecessary 1 sec wait even when timeout is set to 0, due to https://github.com/openwrt/openwrt/blob/master/package/base-files/files/lib/preinit/30_failsafe_wait#L28 that sets it to at least 1 sec.

To me it looks like @blogic has designed b4e33a1c so, that even if the failsafe is disabled, key presses are monitored for a possible setting of debug level.

hnyman avatar Jan 22 '23 13:01 hnyman

Any chance of a verdict on this PR?

hnyman avatar Sep 23 '23 09:09 hnyman

Personally, I am fine with increasing the wait time cause honestly 2 seconds is really short.

robimarko avatar Sep 08 '24 17:09 robimarko