aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Pyle <lxc.8eaf7cd8e5128d8191fe@spamgourmet.com>2012-04-30 22:06:52 -0500
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-05-01 10:42:31 -0700
commita33d57839081545d7bc0046d00d103a308d68fce (patch)
tree87f62c964523731c916e0b3829d85aea7e1ed84f
parentWorkaround requirement to use the realname of the block device. (diff)
downloadlxc-0.8.0-rc1-gentoo.tar.gz
lxc-0.8.0-rc1-gentoo.tar.bz2
lxc-0.8.0-rc1-gentoo.zip
Build: get __NR_setns from asm/unistd.h, not kernel sourcelxc-0.8.0-rc1-gentoo-1lxc-0.8.0-rc1-gentoo
Recent kernel headers suitable for building glibc are sufficient to provide setns, so use that in preference to a full kernel source tree. This is a prototype which may not be suitable on all distributions, but which works well on recent Gentoo systems. Conflicts: src/lxc/Makefile.am
-rw-r--r--config/linux.m442
-rw-r--r--src/lxc/Makefile.am11
-rw-r--r--src/lxc/attach.c5
3 files changed, 4 insertions, 54 deletions
diff --git a/config/linux.m4 b/config/linux.m4
index a4e9fa8..6726625 100644
--- a/config/linux.m4
+++ b/config/linux.m4
@@ -4,20 +4,6 @@ AC_DEFUN([AC_LINUX],
AC_LINUX_SRCARCH()
])
-AC_DEFUN([AS_TRY_LINUX_DIR],
- [AC_MSG_CHECKING(for Linux in $1)
-
- if test -f "$1/Makefile" ; then
- result=yes
- $2
- else
- result="not found"
- $3
- fi
-
- AC_MSG_RESULT($result)
-])
-
AC_DEFUN([AC_LINUX_DIR],
[
AC_ARG_WITH([linuxdir],
@@ -26,34 +12,6 @@ AC_DEFUN([AC_LINUX_DIR],
[LINUX_DIR="${withval}"],
[LINUX_DIR=default])
- dnl if specified, use the specified one
- if test "${LINUX_DIR}" != "default" ; then
- AS_TRY_LINUX_DIR([${LINUX_DIR}], , AC_MSG_ERROR([Linux dir not found]) )
- fi
-
- dnl if not specified, first try with previously set LINUX_KERNEL_RELEASE
- if test "${LINUX_DIR}" = "default" ; then
- dir="/lib/modules/$LINUX_KERNEL_RELEASE/build";
- AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], )
- fi
-
- dnl next try using the kernel source dir
- if test "${LINUX_DIR}" = "default" ; then
- dir="/usr/src/linux-$LINUX_KERNEL_RELEASE";
- AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], )
- fi
-
- dnl then try a common default of /usr/src/linux
- if test "${LINUX_DIR}" = "default" ; then
- dir="/usr/src/linux";
- AS_TRY_LINUX_DIR([${dir}], [LINUX_DIR=${dir}], )
- fi
-
- dnl if still nothing found, fail
- if test "${LINUX_DIR}" = "default" ; then
- AC_MSG_WARN([Linux source directory not found])
- fi
-
AC_SUBST(LINUX_DIR)
])
diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index 4c72dc9..4a9d055 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -114,14 +114,3 @@ lxc_unfreeze_SOURCES = lxc_unfreeze.c
lxc_unshare_SOURCES = lxc_unshare.c
lxc_wait_SOURCES = lxc_wait.c
lxc_kill_SOURCES = lxc_kill.c
-
-namespace.c: setns.h
-
-setns.h:
- -$(CC) $(CPPFLAGS) -M -MT$@ $(LINUX_DIR)/arch/$(LINUX_SRCARCH)/include/asm/unistd.h >setns.P
- -$(CPP) $(CPPFLAGS) -dM $(LINUX_DIR)/arch/$(LINUX_SRCARCH)/include/asm/unistd.h |grep setns > $@
-
-clean-local:
- $(RM) setns.h setns.P
-
--include setns.P
diff --git a/src/lxc/attach.c b/src/lxc/attach.c
index 33da411..f3576cc 100644
--- a/src/lxc/attach.c
+++ b/src/lxc/attach.c
@@ -42,7 +42,10 @@
#include "cgroup.h"
#include "config.h"
-#include "setns.h"
+/*
+ * For __NR_setns
+ */
+#include <asm/unistd.h>
lxc_log_define(lxc_attach, lxc);