Unlike other AVM devices, the Fritz!Box 3370 has got a 'Power' button
instead of 'WPS', 'DECT' or similar.
However, for a complete implementation of gluon it must be possible to
reboot the device into setup mode via pressing a button.
Notes:
1. The power button is used both for rebooting to setup mode (long press > 3s)
and switching off the device (short press).
This works because wait_setup_mode() is already started by 'power pressed', whereas
poweroff would be called later upon 'power released'.
2. Adding yet another button for setup mode isn't very pretty, esp. for the sake of one device.
However,
- there are only few devices (21/784) with a power button
- 302/784 devices have more than one button (reset + wps|phone) assigned to setup-mode,
so the confusion is already there anyway.
many AVM devices do not have RESET/WPS buttons. So use the otherwise unused DECT/PHONE button to boot the device into setup mode.
This patch allows to enter the setup-mode by pressing the phone button
(often labeled as DECT) in addition to WPS and reset button.
This patch is necessary to allow supporting boards without a WPS and reset
button (e.g. AVM FRITZ!Box 7312).
With this commit, the status-led is set to be the "led-running"
device-tree alias for targets which do not implement the get_status_led
method in /etc/diag.sh.
OpenWrt doesn't set the regdom unless a WLAN device is started. Explicitly set
the regdom in the setup mode to get the correct list of allowed txpower entries
in the planned LuCI module.
Moving the scripts to a common directory not only vastly simplifies the
zzz-gluon-upgrade script, but also allows to define an ordering of such
scripts across packages.
When an early reboot is triggered because an upgrade script has disabled the
config mode, we need to explicitly call /etc/init.d/done, otherwise the overlay
will not be finalized after a firstboot and we get an endless reboot loop.
Since switching to Barrier Breaker/procd, we'd not notice if we were
upgrading from a version before renaming the config file to gluon-setup-mode
as the upgrade scripts run after the preinit.
Fix this by checking later during setup mode init again and rebooting into the
regular run mode if we detect this case.