[lxc-devel] [PATCH] auto-detect linux kernel release

Francois-Xavier Bourlet francois-xavier.bourlet at dotcloud.com
Thu May 12 17:04:46 UTC 2011


Hi,

To be able to have setns (the syscall) support in lxc, you need to
have the linux kernel headers (or source).

Then the lxc build configuration system try to auto-detect the syscall
number using the linux kernel headers/sources. For that you need to
set an environ variable to help the build system to discover the linux
release you want use.

ex:
LINUX_KERNEL_RELEASE = `uname -r`
export LINUX_KERNEL_RELEASE

I mostly build lxc for the kernel I am running on, and so it could be
nice to have the ./configure setting up this variable for us. But let
the choice to customize it if needed.

Here's the patch I am using for it, I don't know as much autotools so
it could make you cry.

---
 config/linux.m4 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/config/linux.m4 b/config/linux.m4
index 338f393..5c5918c 100644
--- a/config/linux.m4
+++ b/config/linux.m4
@@ -1,5 +1,9 @@
 AC_DEFUN([AC_LINUX],
 [
+	if test -z "$LINUX_KERNEL_RELEASE" ; then
+		LINUX_KERNEL_RELEASE=`uname -r`
+	fi
+	
 	AC_LINUX_DIR()
 	AC_LINUX_SRCARCH()
 ])
-- 
1.7.4.1


Regards,
-- 
François-Xavier Bourlet




More information about the lxc-devel mailing list