From: Grant Likely <grant.likely@secretlab.ca>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/9] Ask the kernel source where it will install modules
Date: Thu, 16 Oct 2008 14:32:46 -0600 [thread overview]
Message-ID: <20081016203246.15826.56394.stgit@localhost.localdomain> (raw)
In-Reply-To: <20081016203220.15826.26173.stgit@localhost.localdomain>
From: Grant Likely <grant.likely@secretlab.ca>
Originally, $(LINUX26_VERSION) was used to figure out which directory
modules would get installed in under /lib/modules. This causes problems
when $(LINUX26_VERSION) differs from what version the kernel source
thinks it is using because it will try to use depmod in the wrong directory.
This patch adds a new variable $(LINUX26_VERSION_MOD) which resolves to the
exact version string that the kernel uses. Module install then uses this
value instead of $(LINUX26_VERSION) when running depmod
This patch also eliminates the modules.dep target and makes
.modules_installed depend on $(LINUX26_DIR)/.configured directly. This is
necessary because the value of $(LINUX26_VERSION_MOD) is unavailable before
the kernel is unpacked. Trying to use it in a target or dependency name
confuses make.
---
target/linux/Makefile.in.advanced | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/linux/Makefile.in.advanced b/target/linux/Makefile.in.advanced
index 90f8e01..3018ab3 100644
--- a/target/linux/Makefile.in.advanced
+++ b/target/linux/Makefile.in.advanced
@@ -42,6 +42,9 @@ LINUX26_VERSION:=$(LINUX_HEADERS_VERSION)
endif
endif
+# Ask the kernel what version number it will use when installing modules
+LINUX26_VERSION_MOD = `$(LINUX26_MAKE) -s kernelrelease`
+
ifeq ($(BOARD_PATH),)
BOARD_PATH:=$(strip $(subst ",,$(BR2_BOARD_PATH)))
#"))
@@ -390,16 +393,16 @@ $(LINUX26_KERNEL): $(LINUX26_DIR)/$(LINUX26_BINLOC)
# -----------------------------------------------------------------------------
-$(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)/modules.dep: $(LINUX26_DIR)/.configured
- rm -rf $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)
+$(LINUX26_DIR)/.modules_installed: $(LINUX26_DIR)/.configured
+ rm -rf $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION_MOD)
rm -f $(TARGET_DIR)/sbin/cardmgr
$(LINUX26_MAKE) modules
$(LINUX26_MAKE) \
DEPMOD=$(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod26 \
INSTALL_MOD_PATH=$(TARGET_DIR) modules_install
- rm -f $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)/build
- rm -f $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)/source
- $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod26 -b $(TARGET_DIR) $(LINUX26_VERSION) #$(LINUX_HEADERS_VERSION)
+ rm -f $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION_MOD)/build
+ rm -f $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION_MOD)/source
+ $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-depmod26 -b $(TARGET_DIR) $(LINUX26_VERSION_MOD) #$(LINUX_HEADERS_VERSION)
touch -c $@
linux26-menuconfig: $(LINUX26_DIR)/.patched host-sed
@@ -442,9 +445,6 @@ $(LINUX_COPYTO)/$(LINUX26_KERNEL_NAME): $(LINUX26_KERNEL)
linux26: $(LINUX26_TARGETS)
-$(LINUX26_DIR)/.modules_installed: $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)/modules.dep
- touch $@
-
linux26-modules: cross-depmod26 $(LINUX26_DIR)/.modules_installed
linux26-source: $(DL_DIR)/$(LINUX26_SOURCE)
next prev parent reply other threads:[~2008-10-16 20:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 20:32 [Buildroot] [PATCH 1/9] Typo fix in toolchain/external-toolchain/ext-tool.mk Grant Likely
2008-10-16 20:32 ` [Buildroot] [PATCH 2/9] Fix link flags of mtdutils Grant Likely
2008-10-16 20:51 ` Thomas Petazzoni
2008-10-16 21:15 ` hartleys
2008-10-16 21:22 ` Bernhard Reutner-Fischer
2008-10-16 21:38 ` Thomas Petazzoni
2008-10-16 21:47 ` Thomas Petazzoni
2008-10-16 20:32 ` [Buildroot] [PATCH 3/9] Add support for multilib external toolchains Grant Likely
2008-10-17 16:40 ` Shinya Kuribayashi
2010-01-12 11:06 ` Thomas Petazzoni
2010-01-12 19:15 ` Grant Likely
2008-10-16 20:32 ` [Buildroot] [PATCH 4/9] Add Xilinx UARTLITE and MPC5200 PSC device files (serial ports) Grant Likely
2008-10-17 10:24 ` Peter Korsgaard
2008-10-16 20:32 ` [Buildroot] [PATCH 5/9] Refactor invocation of make for kernel compiles Grant Likely
2008-10-16 21:55 ` Markus Heidelberg
2008-10-16 23:03 ` Grant Likely
2008-10-16 20:32 ` Grant Likely [this message]
2008-10-30 9:52 ` [Buildroot] [PATCH 6/9] Ask the kernel source where it will installmodules Hans-Christian Egtvedt
2008-10-30 11:57 ` Hans-Christian Egtvedt
2008-10-30 13:20 ` [Buildroot] [PATCH 6/9] Ask the kernel source where it will install modules Thomas Petazzoni
2008-10-30 13:23 ` Grant Likely
2008-10-30 13:44 ` Thomas Petazzoni
2008-10-30 13:27 ` Hans-Christian Egtvedt
2008-10-30 14:04 ` Hans-Christian Egtvedt
2008-10-16 20:32 ` [Buildroot] [PATCH 7/9] Add last resort setting of $(LINUX26_BINLOC) for kernel image filename Grant Likely
2008-10-16 20:32 ` [Buildroot] [PATCH 8/9] RFC: Remove HOSTCFLAGS from kernel compile Grant Likely
2008-10-16 21:09 ` Bernhard Reutner-Fischer
2008-10-16 23:11 ` Grant Likely
2008-10-16 20:33 ` [Buildroot] [PATCH 9/9] Add support for cloning Linux git trees Grant Likely
2008-10-16 21:14 ` Bernhard Reutner-Fischer
2008-10-16 23:09 ` Grant Likely
2008-10-17 7:38 ` Bernhard Reutner-Fischer
2008-10-17 10:20 ` [Buildroot] [PATCH 1/9] Typo fix in toolchain/external-toolchain/ext-tool.mk Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081016203246.15826.56394.stgit@localhost.localdomain \
--to=grant.likely@secretlab.ca \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox