[Buildroot] [PATCHv2 2/4] kmod: allow to build a host variant

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Aug 27 17:28:32 UTC 2013

Since module-init-tools is deprecated, we now want to use kmod instead
for the installation of modules during the kernel build process. In
order to do this, we need to be able to build a host variant of kmod,
which is want this patch allows to do.

Note that only the depmod tool is installed on the host, since that's
the only one likely to be used on the host in a cross-compilation

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
 package/kmod/kmod.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/kmod/kmod.mk b/package/kmod/kmod.mk
index 71a2632..4445fa8 100644
--- a/package/kmod/kmod.mk
+++ b/package/kmod/kmod.mk
@@ -54,4 +54,14 @@ else
 KMOD_CONF_OPT += --disable-tools
+# We only install depmod, since that's the only tool used for the
+# host.
+	mkdir -p $(HOST_DIR)/sbin/
+	ln -sf ../usr/bin/kmod $(HOST_DIR)/sbin/depmod
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))

More information about the buildroot mailing list