Browse Source

- add kernel-module infrastructure

master
vanhofen 3 years ago
parent
commit
c3920718cd
  1. 21
      make/environment-linux.mk
  2. 1
      package/Makefile.in
  3. 42
      package/pkg-kernel-module.mk
  4. 10
      package/rtl8192eu/rtl8192eu.mk
  5. 10
      package/rtl8812au/rtl8812au.mk
  6. 10
      package/rtl8822bu/rtl8822bu.mk

21
make/environment-linux.mk

@ -228,19 +228,6 @@ KERNEL_VMLINUX = $(KERNEL_OBJ_DIR)/vmlinux
# -----------------------------------------------------------------------------
KERNEL_MAKE_VARS = \
ARCH=$(TARGET_ARCH) \
CROSS_COMPILE=$(TARGET_CROSS) \
INSTALL_MOD_PATH=$(KERNEL_MODULES_DIR) \
INSTALL_HDR_PATH=$(KERNEL_HEADERS_DIR) \
LOCALVERSION= \
O=$(KERNEL_OBJ_DIR)
# Compatibility variables
KERNEL_MAKE_VARS += \
KVER=$(KERNEL_VERSION) \
KSRC=$(BUILD_DIR)/$(KERNEL_DIR)
ifeq ($(BOXMODEL),$(filter $(BOXMODEL),vuduo))
KERNEL_IMAGE = vmlinux
else ifeq ($(BOXMODEL),$(filter $(BOXMODEL),hd60 hd61 multiboxse))
@ -258,12 +245,4 @@ endif
# -----------------------------------------------------------------------------
define LINUX_RUN_DEPMOD
if test -d $(TARGET_modulesdir) && grep -q "CONFIG_MODULES=y" $(KERNEL_OBJ_DIR)/.config; then \
PATH=$(PATH):/sbin:/usr/sbin depmod -a -b $(TARGET_DIR) $(KERNEL_VERSION); \
fi
endef
# -----------------------------------------------------------------------------
KERNEL_TARBALL = $(BUILD_DIR)/linux-$(KERNEL_VERSION).tar

1
package/Makefile.in

@ -28,4 +28,5 @@ MAKEFLAGS += --no-print-directory
include package/pkg-autotools.mk
include package/pkg-cmake.mk
include package/pkg-individual.mk
include package/pkg-kernel-module.mk
include package/pkg-python.mk

42
package/pkg-kernel-module.mk

@ -0,0 +1,42 @@
################################################################################
#
# Kernel modules
#
################################################################################
KERNEL_MAKE_VARS = \
ARCH=$(TARGET_ARCH) \
CROSS_COMPILE=$(TARGET_CROSS) \
INSTALL_MOD_PATH=$(KERNEL_MODULES_DIR) \
INSTALL_HDR_PATH=$(KERNEL_HEADERS_DIR) \
LOCALVERSION= \
O=$(KERNEL_OBJ_DIR)
# Compatibility variables
KERNEL_MAKE_VARS += \
KVER=$(KERNEL_VERSION) \
KSRC=$(BUILD_DIR)/$(KERNEL_DIR)
define KERNEL_MODULE_BUILD
@$(call MESSAGE,"Building kernel module")
$(CHDIR)/$($(PKG)_DIR); \
$($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS)
endef
# -----------------------------------------------------------------------------
define kernel-module
$(call PREPARE)
$(call KERNEL_MODULE_BUILD)
$(call LINUX_RUN_DEPMOD)
$(call TARGET_FOLLOWUP)
endef
# -----------------------------------------------------------------------------
define LINUX_RUN_DEPMOD
@$(call MESSAGE,"Running depmod")
if test -d $(TARGET_modulesdir) && grep -q "CONFIG_MODULES=y" $(KERNEL_OBJ_DIR)/.config; then \
PATH=$(PATH):/sbin:/usr/sbin depmod -a -b $(TARGET_DIR) $(KERNEL_VERSION); \
fi
endef

10
package/rtl8192eu/rtl8192eu.mk

@ -18,13 +18,5 @@ define RTL8192EU_INSTALL_BINARY
endef
RTL8192EU_PRE_FOLLOWUP_HOOKS += RTL8192EU_INSTALL_BINARY
define RTL8192EU_RUN_DEPMOD
$(LINUX_RUN_DEPMOD)
endef
RTL8192EU_TARGET_FINALIZE_HOOKS += RTL8192EU_RUN_DEPMOD
rtl8192eu: | $(TARGET_DIR)
$(call PREPARE)
$(CHDIR)/$($(PKG)_DIR); \
$(MAKE) $(KERNEL_MAKE_VARS)
$(call TARGET_FOLLOWUP)
$(call kernel-module)

10
package/rtl8812au/rtl8812au.mk

@ -16,13 +16,5 @@ define RTL8812AU_INSTALL_BINARY
endef
RTL8812AU_PRE_FOLLOWUP_HOOKS += RTL8812AU_INSTALL_BINARY
define RTL8812AU_RUN_DEPMOD
$(LINUX_RUN_DEPMOD)
endef
RTL8812AU_TARGET_FINALIZE_HOOKS += RTL8812AU_RUN_DEPMOD
rtl8812au: | $(TARGET_DIR)
$(call PREPARE)
$(CHDIR)/$($(PKG)_DIR); \
$(MAKE) $(KERNEL_MAKE_VARS)
$(call TARGET_FOLLOWUP)
$(call kernel-module)

10
package/rtl8822bu/rtl8822bu.mk

@ -16,13 +16,5 @@ define RTL8822BU_INSTALL_BINARY
endef
RTL8822BU_PRE_FOLLOWUP_HOOKS += RTL8822BU_INSTALL_BINARY
define RTL8822BU_RUN_DEPMOD
$(LINUX_RUN_DEPMOD)
endef
RTL8822BU_TARGET_FINALIZE_HOOKS += RTL8822BU_RUN_DEPMOD
rtl8822bu: | $(TARGET_DIR)
$(call PREPARE)
$(CHDIR)/$($(PKG)_DIR); \
$(MAKE) $(KERNEL_MAKE_VARS)
$(call TARGET_FOLLOWUP)
$(call kernel-module)

Loading…
Cancel
Save