Browse Source

- pkg-kernel-module: add $(PKG)_INSTALL_CMDS; rework

master
vanhofen 3 years ago
parent
commit
c53daf41b5
  1. 23
      package/pkg-kernel-module.mk
  2. 11
      package/pkg-utils.mk
  3. 5
      package/rtl8192eu/rtl8192eu.mk
  4. 5
      package/rtl8812au/rtl8812au.mk
  5. 5
      package/rtl8822bu/rtl8822bu.mk

23
package/pkg-kernel-module.mk

@ -20,24 +20,39 @@ KERNEL_MAKE_VARS += \
define KERNEL_MODULE_BUILD_CMDS_DEFAULT define KERNEL_MODULE_BUILD_CMDS_DEFAULT
$(CHDIR)/$($(PKG)_DIR); \ $(CHDIR)/$($(PKG)_DIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \ $(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$($(PKG)_MAKE) \ $($(PKG)_MAKE) $($(PKG)_MAKE_ARGS) \
$($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS) $($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS)
endef endef
define KERNEL_MODULE_BUILD define KERNEL_MODULE_BUILD
@$(call MESSAGE,"Building $(pkgname) kernel module") @$(call MESSAGE,"Building $(pkgname) kernel module(s)")
$(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_BUILD_CMDS) $(Q)$(call $(PKG)_BUILD_CMDS)
$(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
endef endef
define KERNEL_MODULE_INSTALL_CMDS_DEFAULT
$(CHDIR)/$($(PKG)_DIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \
$($(PKG)_MAKE_INSTALL) $($(PKG)_MAKE_INSTALL_ARGS) \
$($(PKG)_MAKE_INSTALL_OPTS) $(KERNEL_MAKE_VARS)
endef
define KERNEL_MODULE_INSTALL
@$(call MESSAGE,"Installing $(pkgname) kernel module(s)")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
define kernel-module define kernel-module
$(eval PKG_MODE = $(pkg-mode)) $(eval PKG_MODE = $(pkg-mode))
$(call PREPARE,$(1)) $(call PREPARE,$(1))
$(call KERNEL_MODULE_BUILD) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call KERNEL_MODULE_BUILD))
$(call LINUX_RUN_DEPMOD) $(if $(filter $(1),$(PKG_NO_INSTALL)),,$(call KERNEL_MODULE_INSTALL))
$(Q)$(call LINUX_RUN_DEPMOD)
$(call TARGET_FOLLOWUP) $(call TARGET_FOLLOWUP)
endef endef

11
package/pkg-utils.mk

@ -148,14 +148,18 @@ ifndef $(PKG)_MAKE_INSTALL_ENV
$(PKG)_MAKE_INSTALL_ENV = $$($(PKG)_MAKE_ENV) $(PKG)_MAKE_INSTALL_ENV = $$($(PKG)_MAKE_ENV)
endif endif
ifndef $(PKG)_MAKE_INSTALL_ARGS ifndef $(PKG)_MAKE_INSTALL_ARGS
ifeq ($(PKG_MODE),KERNEL)
$(PKG)_MAKE_INSTALL_ARGS = modules_install
else
$(PKG)_MAKE_INSTALL_ARGS = install $(PKG)_MAKE_INSTALL_ARGS = install
endif endif
endif
ifndef $(PKG)_MAKE_INSTALL_OPTS ifndef $(PKG)_MAKE_INSTALL_OPTS
$(PKG)_MAKE_INSTALL_OPTS = $$($(PKG)_MAKE_OPTS) $(PKG)_MAKE_INSTALL_OPTS = $$($(PKG)_MAKE_OPTS)
endif endif
# install commands # install commands
# TODO: python, kernel # TODO: python
ifndef $(PKG)_INSTALL_CMDS ifndef $(PKG)_INSTALL_CMDS
ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC KCONFIG)) ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC KCONFIG))
ifeq ($(PKG_PACKAGE),HOST) ifeq ($(PKG_PACKAGE),HOST)
@ -169,6 +173,8 @@ ifndef $(PKG)_INSTALL_CMDS
else else
$(PKG)_INSTALL_CMDS = $$(TARGET_NINJA_INSTALL_CMDS_DEFAULT) $(PKG)_INSTALL_CMDS = $$(TARGET_NINJA_INSTALL_CMDS_DEFAULT)
endif endif
else ifeq ($(PKG_MODE),KERNEL)
$(PKG)_INSTALL_CMDS = $$(KERNEL_MODULE_INSTALL_CMDS_DEFAULT)
else else
$(PKG)_INSTALL_CMDS = echo "$(PKG_NO_INSTALL)" $(PKG)_INSTALL_CMDS = echo "$(PKG_NO_INSTALL)"
endif endif
@ -197,6 +203,9 @@ endif
ifeq ($(PKG_MODE),MESON) ifeq ($(PKG_MODE),MESON)
$(PKG)_DEPENDENCIES += host-meson $(PKG)_DEPENDENCIES += host-meson
endif endif
ifeq ($(PKG_MODE),KERNEL)
$(PKG)_DEPENDENCIES = kernel-$(BOXTYPE)
endif
ifeq ($(PKG_MODE),PYTHON3) ifeq ($(PKG_MODE),PYTHON3)
$(PKG)_DEPENDENCIES += host-python3 $(PKG)_DEPENDENCIES += host-python3
$(PKG)_DEPENDENCIES += $$(if $$(filter $$(pkg),host-python-setuptools),,host-python-setuptools) $(PKG)_DEPENDENCIES += $$(if $$(filter $$(pkg),host-python-setuptools),,host-python-setuptools)

5
package/rtl8192eu/rtl8192eu.mk

@ -11,12 +11,9 @@ RTL8192EU_SITE = https://github.com/mange/$(RTL8192EU_SOURCE)
RTL8192EU_CHECKOUT = 60aa279428024ea78dcffe2c181ffee3cc1495f5 RTL8192EU_CHECKOUT = 60aa279428024ea78dcffe2c181ffee3cc1495f5
RTL8192EU_DEPENDENCIES = kernel-$(BOXTYPE) define RTL8192EU_INSTALL_CMDS
define RTL8192EU_INSTALL_BINARY
$(INSTALL_DATA) -D $(PKG_BUILD_DIR)/8192eu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/8192eu.ko $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/8192eu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/8192eu.ko
endef endef
RTL8192EU_POST_BUILD_HOOKS += RTL8192EU_INSTALL_BINARY
rtl8192eu: | $(TARGET_DIR) rtl8192eu: | $(TARGET_DIR)
$(call kernel-module) $(call kernel-module)

5
package/rtl8812au/rtl8812au.mk

@ -9,12 +9,9 @@ RTL8812AU_DIR = rtl8812AU-driver-$(RTL8812AU_VERSION)
RTL8812AU_SOURCE = rtl8812AU-driver-$(RTL8812AU_VERSION).zip RTL8812AU_SOURCE = rtl8812AU-driver-$(RTL8812AU_VERSION).zip
RTL8812AU_SITE = http://source.mynonpublic.com RTL8812AU_SITE = http://source.mynonpublic.com
RTL8812AU_DEPENDENCIES = kernel-$(BOXTYPE) define RTL8812AU_INSTALL_CMDS
define RTL8812AU_INSTALL_BINARY
$(INSTALL_DATA) -D $(PKG_BUILD_DIR)/8812au.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/8812au.ko $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/8812au.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/8812au.ko
endef endef
RTL8812AU_POST_BUILD_HOOKS += RTL8812AU_INSTALL_BINARY
rtl8812au: | $(TARGET_DIR) rtl8812au: | $(TARGET_DIR)
$(call kernel-module) $(call kernel-module)

5
package/rtl8822bu/rtl8822bu.mk

@ -9,12 +9,9 @@ RTL8822BU_DIR = rtl8822bu
RTL8822BU_SOURCE = rtl8822bu-driver-$(RTL8822BU_VERSION).zip RTL8822BU_SOURCE = rtl8822bu-driver-$(RTL8822BU_VERSION).zip
RTL8822BU_SITE = http://source.mynonpublic.com RTL8822BU_SITE = http://source.mynonpublic.com
RTL8822BU_DEPENDENCIES = kernel-$(BOXTYPE) define RTL8822BU_INSTALL_CMDS
define RTL8822BU_INSTALL_BINARY
$(INSTALL_DATA) -D $(PKG_BUILD_DIR)/88x2bu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/88x2bu.ko $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/88x2bu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/88x2bu.ko
endef endef
RTL8822BU_POST_BUILD_HOOKS += RTL8822BU_INSTALL_BINARY
rtl8822bu: | $(TARGET_DIR) rtl8822bu: | $(TARGET_DIR)
$(call kernel-module) $(call kernel-module)

Loading…
Cancel
Save