[Buildroot] [PATCH] package/openvmtools: enable openvmtools kernel modules

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Feb 20 08:22:07 UTC 2015


Dear Romain Naour,

On Fri, 20 Feb 2015 00:20:46 +0100, Romain Naour wrote:

> diff --git a/package/openvmtools/0008-configure-don-t-append-build-directory-to-LINUXINCLU.patch b/package/openvmtools/0008-configure-don-t-append-build-directory-to-LINUXINCLU.patch
> new file mode 100644
> index 0000000..5d18d9f
> --- /dev/null
> +++ b/package/openvmtools/0008-configure-don-t-append-build-directory-to-LINUXINCLU.patch
> @@ -0,0 +1,31 @@
> +From 796296f35c6992b4c685b7926a2aff9cd3bcac81 Mon Sep 17 00:00:00 2001
> +From: Romain Naour <romain.naour at openwide.fr>
> +Date: Mon, 16 Feb 2015 11:30:23 +0100
> +Subject: [PATCH 8/8] configure: don't append build directory to LINUXINCLUDE.
> +
> +This break the build when LINUXDIR point to the kernel linux sources
> +(ie not from /lib/module/uname -r/build/include)
> +
> +Use directly --with-linuxdir=$(LINUX_DIR)/build if necessary.
> +
> +Signed-off-by: Romain Naour <romain.naour at openwide.fr>
> +---
> + configure.ac |    2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 549736f..6c97785 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -148,7 +148,7 @@ if test "$with_kernel_modules" = "yes"; then
> +          if test ! -d "$LINUXDIR/kernel/"; then
> +              AC_MSG_ERROR([$LINUXDIR/kernel does not exist])
> +          fi
> +-         LINUXINCLUDE="$LINUXDIR/build/include"
> ++         LINUXINCLUDE="$LINUXDIR/include"

I believe this patch may not be needed. The idea of the original code
is that $LINUXDIR should be set to /lib/modules/<kernelversion>/. In a
normal system, this directory contains a "build" symbolic link, which
points back to the kernel source directory, or the kernel headers
directory.

thomas at skate:/lib/modules/3.16.0-31-generic$ ls -l
total 4052
lrwxrwxrwx  1 root root     40 févr. 10 17:36 build -> /usr/src/linux-headers-3.16.0-31-generic
[...]


> + if test "$os" = "linux"; then
> +-   MODULES_DIR="$LINUXDIR/kernel/"
> ++   # MODULES_DIR is used to install vmware modules to the target
> ++   # Use DESTDIR to define the target rootfs when installing
> ++   MODULES_DIR="/lib/modules/$KERNEL_RELEASE/kernel/"

Same here: LINUXDIR is expected to point
at /lib/modules/<kernelversion>/, and the "kernel" subdirectory in here
is where kernel modules are installed. So if you point LINUXDIR
to /lib/modules/<kernelversion>/, this patch should not be needed.

Now, there is one trick: in the current Buildroot, the kernel modules
are only installed to $(TARGET_DIR), and when installed, the 'build'
symbolic link is removed, because it points to a non-nonsensical
location since the kernel sources (or kernel headers) are not installed
in $(TARGET_DIR).

So either we need to keep your patches (but they have no chance of
being upstreamed), or we install kernel modules to $(STAGING_DIR). I'm
not sure if we want to do that just for the sake of openvmtools, though.

So in the end, maybe what you did is the best approach.

> +config BR2_PACKAGE_OPENVMTOOLS_KERNEL_MODULES
> +	bool "Openvmtools Linux Kernel Modules"
> +	depends on BR2_LINUX_KERNEL
> +	help
> +	  Build openvmtools's Linux kernel modules.
> +
> +comment "Openvmtools's Linux kernel modules needs a Linux kernel to be built"

needs -> need

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list