• R/O
  • HTTP
  • SSH
  • HTTPS

luci: Commit

LuCI - OpenWrt Configuration Interface


Commit MetaInfo

Revisãobba7739e9f208d94370a741737770f8d82236b4b (tree)
Hora2022-01-24 15:25:50
AutorSven Roederer <devel-sven@gero...>
CommiterTianling Shen

Mensagem de Log

luci.mk: make SUBMENU package define customizable and optional

When including luci.mk in external repos it's sometimes usefull to not use
the default LuCI-submenu hierarchy.
This change defines the LUCI_SUBMENU_FORCED variable which completely overrides
the default submenu of the LuCI config-section. When LUCI_SUBMENU_FORCED is not
defined, the default submenu derrived from LUCI_TYPE or "Application" fallback
is used.
Defining LUCI_SUBMENU_FORCED in the package Makefile will just use this value.
Setting it to "none" will not define a submenu at all.
Together with LUCI_SECTION and LUCI_CATEGORY menu items can now created at any
place in the menu structure.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 2b11ec6fd02be060443cf4afc9d89058aadcfab3)

Mudança Sumário

Diff

--- a/luci.mk
+++ b/luci.mk
@@ -92,10 +92,22 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
9292
9393 include $(INCLUDE_DIR)/package.mk
9494
95+# LUCI_SUBMENU: the submenu-item below the LuCI top-level menu inside OpoenWrt menuconfig
96+# usually one of the LUCI_MENU.* definitions
97+# LUCI_SUBMENU_DEFAULT: the regular SUBMENU defined by LUCI_TYPE or derrived from the packagename
98+# LUCI_SUBMENU_FORCED: manually forced value SUBMENU to set to by explicit definiton
99+# can be any string, "none" disables the creation of a submenu
100+# most usefull in combination with LUCI_CATEGORY, to make the package appear
101+# anywhere in the menu structure
102+LUCI_SUBMENU_DEFAULT=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app))
103+LUCI_SUBMENU=$(if $(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_FORCED),$(LUCI_SUBMENU_DEFAULT))
104+
95105 define Package/$(PKG_NAME)
96106 SECTION:=$(LUCI_SECTION)
97107 CATEGORY:=$(LUCI_CATEGORY)
98- SUBMENU:=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app))
108+ifneq ($(LUCI_SUBMENU),none)
109+ SUBMENU:=$(LUCI_SUBMENU)
110+endif
99111 TITLE:=$(if $(LUCI_TITLE),$(LUCI_TITLE),LuCI $(LUCI_NAME) $(LUCI_TYPE))
100112 DEPENDS:=$(LUCI_DEPENDS)
101113 $(if $(LUCI_PKGARCH),PKGARCH:=$(LUCI_PKGARCH))
Show on old repository browser