1
1

base-files: add options to disable default button handling

In case OpenWrt is used to build a custom distribution, the default
button handling logic may be undesired.

Add config options to disable default standard button handling code
at build-time.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer 2026-02-26 20:53:16 +01:00
parent b991aaf174
commit 4bdc2ab93a
2 changed files with 54 additions and 0 deletions

View File

@ -264,6 +264,16 @@ else
$(if $(CONFIG_IPK_FILES_CHECKSUMS),, \ $(if $(CONFIG_IPK_FILES_CHECKSUMS),, \
rm -f $(1)/sbin/pkg_check) rm -f $(1)/sbin/pkg_check)
endif endif
$(if $(CONFIG_TARGET_BUTTON_CUSTOMIZATION_FAILSAFE_DISABLED), \
rm -f $(1)/etc/rc.button/failsafe)
$(if $(CONFIG_TARGET_BUTTON_CUSTOMIZATION_POWER_DISABLED), \
rm -f $(1)/etc/rc.button/power)
$(if $(CONFIG_TARGET_BUTTON_CUSTOMIZATION_REBOOT_DISABLED), \
rm -f $(1)/etc/rc.button/reboot)
$(if $(CONFIG_TARGET_BUTTON_CUSTOMIZATION_RESET_DISABLED), \
rm -f $(1)/etc/rc.button/reset)
$(if $(CONFIG_TARGET_BUTTON_CUSTOMIZATION_RF_KILL_DISABLED), \
rm -f $(1)/etc/rc.button/rfkill)
endef endef
ifneq ($(DUMP),1) ifneq ($(DUMP),1)

View File

@ -287,6 +287,50 @@ if VERSIONOPT
file names file names
endif endif
menuconfig TARGET_BUTTON_CUSTOMIZATION
bool "Target button customization" if IMAGEOPT
default n
help
These options allow to customize the behaviour of the buttons defined in
the target's /etc/rc.button/* scripts. This is useful for release builds
or custom OpenWrt redistributions where certain default button handling logic
may be undesired.
config TARGET_BUTTON_CUSTOMIZATION_FAILSAFE_DISABLED
bool
prompt "Disable failsafe button handling" if TARGET_BUTTON_CUSTOMIZATION
default n
help
If set, the failsafe button handling logic in /etc/rc.button/failsafe is disabled.
config TARGET_BUTTON_CUSTOMIZATION_POWER_DISABLED
bool
prompt "Disable power button handling" if TARGET_BUTTON_CUSTOMIZATION
default n
help
If set, the power button handling logic in /etc/rc.button/power is disabled.
config TARGET_BUTTON_CUSTOMIZATION_REBOOT_DISABLED
bool
prompt "Disable reboot button handling" if TARGET_BUTTON_CUSTOMIZATION
default n
help
If set, the reboot button handling logic in /etc/rc.button/reboot is disabled.
config TARGET_BUTTON_CUSTOMIZATION_RESET_DISABLED
bool
prompt "Disable reset button handling" if TARGET_BUTTON_CUSTOMIZATION
default n
help
If set, the reset button handling logic in /etc/rc.button/reset is disabled.
config TARGET_BUTTON_CUSTOMIZATION_RF_KILL_DISABLED
bool
prompt "Disable rfkill button handling" if TARGET_BUTTON_CUSTOMIZATION
default n
help
If set, the rfkill button handling logic in /etc/rc.button/rfkill is disabled.
menuconfig PER_FEED_REPO menuconfig PER_FEED_REPO
bool "Separate feed repositories" if IMAGEOPT bool "Separate feed repositories" if IMAGEOPT