Skip to contentSkip to conversation

libcgroup: new package

PATCH Superseded Clayton Shotwell 3 participants 4 messages Oct 1, 2013 – Oct 2, 2013

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 libcgroup: new package

---
 package/Config.in              |    1 +
 package/libcgroup/Config.in    |    7 +++++++
 package/libcgroup/libcgroup.mk |   34 ++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)
 create mode 100644 package/libcgroup/Config.in
 create mode 100644 package/libcgroup/libcgroup.mk
package/Config.in +1 -0
index bb8c6b7..8427abc 100644
@@ -661,6 +661,7 @@ source "package/libatomic_ops/Config.in"
 source "package/libbsd/Config.in"
 source "package/libcap/Config.in"
 source "package/libcap-ng/Config.in"
+source "package/libcgroup/Config.in"
 source "package/libdaemon/Config.in"
 source "package/libelf/Config.in"
 source "package/libevent/Config.in"
package/libcgroup/Config.in new file +7 -0
new file mode 100644
index 0000000..9f8754d
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBCGROUP
+	bool "libcgroup"
+	help
+	  libcgroup is a library that abstracts the control
+	  group file system in Linux.
+	  
+	  http://libcg.sourceforge.net/
package/libcgroup/libcgroup.mk new file +34 -0
new file mode 100644
index 0000000..fd7c4fc
@@ -0,0 +1,34 @@
+################################################################################
+#
+# libcgroup
+#
+################################################################################
+
+LIBCGROUP_VERSION = 0.38
+LIBCGROUP_SOURCE = libcgroup-$(LIBCGROUP_VERSION).tar.bz2
+LIBCGROUP_SITE = http://sourceforge.net/projects/libcg/files/latest/download
+LIBCGROUP_LICENSE = LGPLv2.1
+LIBCGROUP_LICENSE_FILES = COPYING
+
+LIBCGROUP_INSTALL_STAGING = YES
+
+# Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h 
+# large file support. See https://bugzilla.redhat.com/show_bug.cgi?id=574992 
+# for more information.
+LIBCGROUP_CONF_ENV = \
+	CXXFLAGS+="-U_FILE_OFFSET_BITS" \
+	CFLAGS+="-U_FILE_OFFSET_BITS"
+
+LIBCGROUP_CONF_OPT = \
+	--disable-tools \
+	--disable-daemon \
+	--disable-initscript-install
+
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+	LIBCGROUP_DEPENDENCIES += linux-pam
+	LIBCGROUP_CONF_OPT += --enable-pam
+else
+	LIBCGROUP_CONF_OPT += --disable-pam
+endif
+
+$(eval $(autotools-package))
Signature · 1 line
1.7.1
#2 lore raw

PATCH v4 1/1 libcgroup: new package

In reply to Clayton Shotwell
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Clayton" == Clayton Shotwell <[email protected]> writes:

Clayton> Signed-off-by: Clayton Shotwell <[email protected]>

Sorry, we're not quite there yet .. (see below)

Clayton> ---

 Clayton>  package/Config.in              |    1 +
 Clayton>  package/libcgroup/Config.in    |    7 +++++++
 Clayton>  package/libcgroup/libcgroup.mk |   34 ++++++++++++++++++++++++++++++++++
 Clayton>  3 files changed, 42 insertions(+), 0 deletions(-)
 Clayton>  create mode 100644 package/libcgroup/Config.in
 Clayton>  create mode 100644 package/libcgroup/libcgroup.mk

Clayton> diff --git a/package/Config.in b/package/Config.in Clayton> index bb8c6b7..8427abc 100644
Clayton> --- a/package/Config.in
Clayton> +++ b/package/Config.in
Clayton> @@ -661,6 +661,7 @@ source "package/libatomic_ops/Config.in"

 Clayton>  source "package/libbsd/Config.in"
 Clayton>  source "package/libcap/Config.in"
 Clayton>  source "package/libcap-ng/Config.in"
 Clayton> +source "package/libcgroup/Config.in"
 Clayton>  source "package/libdaemon/Config.in"
 Clayton>  source "package/libelf/Config.in"
 Clayton>  source "package/libevent/Config.in"

Clayton> diff --git a/package/libcgroup/Config.in b/package/libcgroup/Config.in Clayton> new file mode 100644
Clayton> index 0000000..9f8754d
Clayton> --- /dev/null
Clayton> +++ b/package/libcgroup/Config.in
Clayton> @@ -0,0 +1,7 @@
Clayton> +config BR2_PACKAGE_LIBCGROUP
Clayton> + bool "libcgroup"
Clayton> + help
Clayton> + libcgroup is a library that abstracts the control
Clayton> + group file system in Linux.
Clayton> +

Nit: the empty <tab> shouldn't be here.

Clayton> + http://libcg.sourceforge.net/
Clayton> diff --git a/package/libcgroup/libcgroup.mk b/package/libcgroup/libcgroup.mk Clayton> new file mode 100644
Clayton> index 0000000..fd7c4fc
Clayton> --- /dev/null
Clayton> +++ b/package/libcgroup/libcgroup.mk
Clayton> @@ -0,0 +1,34 @@
Clayton> +################################################################################ Clayton> +#
Clayton> +# libcgroup
Clayton> +#
Clayton> +################################################################################ Clayton> +
Clayton> +LIBCGROUP_VERSION = 0.38
Clayton> +LIBCGROUP_SOURCE = libcgroup-$(LIBCGROUP_VERSION).tar.bz2 Clayton> +LIBCGROUP_SITE = http://sourceforge.net/projects/libcg/files/latest/download

This ends up downloading a .tar.gz of 0.40.rc1. I believe you need to use:

http://downloads.sourceforge.net/project/libcg/libcgroup/v.038

The version number syntax is unfortunately different than above so we cannot use $(LIBCGROUP_VERSION) :/

Clayton> +LIBCGROUP_LICENSE = LGPLv2.1
Clayton> +LIBCGROUP_LICENSE_FILES = COPYING
Clayton> +
Clayton> +LIBCGROUP_INSTALL_STAGING = YES
Clayton> +
Clayton> +# Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h Clayton> +# large file support. See https://bugzilla.redhat.com/show_bug.cgi?id=574992

The trailing white space should go.

Clayton> +# for more information.
Clayton> +LIBCGROUP_CONF_ENV = \
Clayton> + CXXFLAGS+="-U_FILE_OFFSET_BITS" \
Clayton> + CFLAGS+="-U_FILE_OFFSET_BITS"

The fact that you're setting CXXFLAGS is a hint that it needs C++ support.

configure.in has AC_PROG_CXX. The only thing really using C++ is ./tests/libcg_ba.cpp, but there doesn't seem to be any easy way of not building it, so you should make the package depend on BR2_INSTALL_LIBSTDCPP (and show a comment if not available).

I gave it a test with the internal uClibc toolchain, but it doesn't work:

make[4]: Entering directory `/home/peko/source/buildroot/output/build/libcgroup-0.38/src'

  CC     parse.lo
  CC     api.lo
  CC     lex.lo
  CC     config.lo
  CC     wrapper.lo

In file included from api.c:35:0:
./libcgroup-internal.h:22:17: fatal error: fts.h: No such file or directory compilation terminated.

fts.h is not provided by default (and not in our default config) by uClibc:

config UCLIBC_HAS_FTS
bool "Support the fts() interface (bsd-compat)"
help
The fts functions are provided for traversing UNIX file hierarchies.

This interface is currently used by the elfutils and adds around 7.5k.
You should port your application to use the POSIX nftw() interface.

Unless you need to build/use elfutils, you should prolly answer N.

So either we should see how much work it would be to change libcgroup to use nftw() instead (perhaps it is already done in 0.40.rc1?) or you should make it depend on BR2_TOOLCHAIN_USES_GLIBC (see cppcms for an example).

Care to take a look at these issues and resubmit?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v4 1/1 libcgroup: new package

Dear Peter Korsgaard,

Quoted 2 lines · Peter Korsgaard

So either we should see how much work it would be to change libcgroup to use nftw() instead (perhaps it is already done in 0.40.rc1?) or you

I think I had a quick look at the Git repository yesterday, and the latest version was still using the old fts() interface, unfortunately.

Thomas

Signature · 3 lines
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com