From c6a72670b54e13d3ab3a6056d7c4f4c503cf0d78 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 3 Aug 2015 13:45:08 +0200 Subject: rework kernel module infrastructure Instead of maintaining mk/modules.mk which defines compilations of related kernel modules to pack together into a single package, follow an automatic approach: For every kernel module found in the modules installation directory, create a single package. There are a few caveats to cover: === Module Loading Order === Upon bootup, module loading is ordered based on the number-prefixed files in /etc/modules.d/. The correct number was previously managed in mk/modules.mk on a per-collection basis. The new approach is to have levels which modules are to be assigned to. Level 0 contains modules with no dependencies at all. Level 1 contains modules which have only level 0 dependencies, and so on. This information is determined at compile-time by make-module-ipkgs.sh. === Module Installation to Target RootFS === Since module packages are created automatically from the modules the script finds, ADK build system has no knowledge about the connection between what the user has selected in menuconfig and the actual module packages. Therefore the earlier approach to install selected packages into rootfs does not hold anymore. Instead, use wildcards to find all packages in firmware directory prefixed by 'kmod-' and install them all (hopefully doing the right thing). === Kernel Version === KERNEL_VERSION now contains KERNEL_RELEASE already By creating a localversion file, make KERNEL_RELEASE part of the kernel's version number (so KERNEL_VERSION is correct in most situations) Signed-off-by: Phil Sutter --- toolchain/kernel-headers/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'toolchain/kernel-headers/Makefile') diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 6ae226a45..d86e483f9 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -13,7 +13,7 @@ LINUX_DIR=${WRKBUILD} include $(ADK_TOPDIR)/mk/kernel-vars.mk -$(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched: +$(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched: ifeq ($(ADK_TARGET_SYSTEM_PCENGINES_APU),y) ifeq ($(ADK_KERNEL_ROOT_NFS),y) cd $(DL_DIR) && wget http://distfiles.openadk.org/realtek-firmware-1.1.tar.xz @@ -27,19 +27,19 @@ ifeq ($(ADK_TARGET_ARCH_XTENSA),y) endif ifneq ($(ADK_DISABLE_KERNEL_PATCHES),y) $(TRACE) kernel-patch - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \ - $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) + $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \ + $(ADK_TOPDIR)/target/linux/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE) endif ifneq ($(ADK_DISABLE_TARGET_KERNEL_PATCHES),y) $(TRACE) kernel-target-patch - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \ - $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_BOARD)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) - $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION) \ - $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) + $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \ + $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_BOARD)/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE) + $(PATCH) $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER) \ + $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/$(ADK_TARGET_SYSTEM)/patches/$(KERNEL_FILE_VER) *.patch $(MAKE_TRACE) endif touch $@ -$(WRKBUILD)/.headers: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched +$(WRKBUILD)/.headers: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_FILE_VER)/.patched $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) headers_check $(KERNEL_MAKE_ENV) $(MAKE) -C "${LINUX_DIR}" $(KERNEL_MAKE_OPTS) \ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \ -- cgit v1.2.3