Merge branch 'lxc'

Conflicts:
	packages/lxc/lxc.mk
This commit is contained in:
Neale Pickett 2011-09-26 13:03:43 -06:00
commit 0f5ad7ad46
3 changed files with 93 additions and 0 deletions

28
packages/libcap/libcap.mk Normal file
View File

@ -0,0 +1,28 @@
LIBCAP_PKGDIR = $(TARGET)/libcap
LIBCAP_BUILDDIR = $(BUILD)/libcap
LIBCAP_VERSION = 2.22
LIBCAP_TAR = $(CACHE)/libcap-$(LIBCAP_VERSION).tar.gz
# XXX: kernel.org was down when I wrote this, but is the canonical source
LIBCAP_URL = http://ftp.debian.org/debian/pool/main/libc/libcap2/libcap2_$(LIBCAP_VERSION).orig.tar.gz
LIBCAP_SRCDIR = $(LIBCAP_BUILDDIR)/libcap-$(LIBCAP_VERSION)
LIBCAP_LDFLAGS = -L$(CURDIR)/$(LIBCAP_SRCDIR)/libcap
LIBCAP_CFLAGS = -I$(CURDIR)/$(LIBCAP_SRCDIR)/libcap/include
$(LIBCAP_TAR):
mkdir -p $(@D)
wget -O $@ $(LIBCAP_URL)
libcap-source: $(LIBCAP_BUILDDIR)/source
$(LIBCAP_BUILDDIR)/source: $(LIBCAP_TAR)
mkdir -p $(@D)
zcat $< | ( cd $(@D) && tar xf -)
touch $@
# This library's build sort of blows.
libcap-build: $(LIBCAP_BUILDDIR)/built
$(LIBCAP_BUILDDIR)/built: $(LIBCAP_BUILDDIR)/source
$(MAKE) -C $(LIBCAP_SRCDIR)/libcap _makenames
$(MAKE) -C $(LIBCAP_SRCDIR) CC=$(CC)
touch $@

54
packages/lxc/lxc.mk Normal file
View File

@ -0,0 +1,54 @@
LXC_PKGDIR = $(TARGET)/lxc
LXC_BUILDDIR = $(BUILD)/lxc
LXC_VERSION = 0.7.5
LXC_TAR = $(CACHE)/lxc-$(LXC_VERSION).tar.gz
LXC_URL = http://lxc.sourceforge.net/download/lxc/lxc-$(LXC_VERSION).tar.gz
LXC_SRCDIR = $(LXC_BUILDDIR)/lxc-$(LXC_VERSION)
LXC_COMMANDS = attach cgroup checkpoint console execute freeze
LXC_COMMANDS += info init kill monitor restart start stop
LXC_COMMANDS += unfreeze unshare wait
LXC_PROGRAMS = $(addprefix $(LXC_SRCDIR)/src/lxc/lxc-, $(LXC_COMMANDS))
# Prevents automake from mangling cross-compiled binary names
LXC_CC_HOST := $(shell $(CC) -v 2>&1 | awk '/Target:/{print $$2}')
LXC_CONF_OPT := --host=i386-unknown-linux-uclibc --program-transform-name=
lxc-install: lxc-build
$(LXC_TAR):
@ mkdir -p $(@D)
wget -O $@ $(LXC_URL)
lxc-source: $(LXC_BUILDDIR)/source
$(LXC_BUILDDIR)/source: $(LXC_TAR)
mkdir -p $(LXC_BUILDDIR)
zcat $(LXC_TAR) | (cd $(LXC_BUILDDIR) && tar xf -)
cp packages/lxc/utmp.c $(LXC_SRCDIR)/src/lxc/
touch $@
lxc-build: $(LXC_BUILDDIR)/built
$(LXC_BUILDDIR)/built: $(LXC_BUILDDIR)/source libcap-build
cd $(LXC_SRCDIR) && CFLAGS="$(LIBCAP_CFLAGS)" LDFLAGS="$(LIBCAP_LDFLAGS)" ./configure $(CONFIG_XCOMPILE_FLAGS)
LD_RUN_PATH=/opt/lxc/lib $(MAKE) -C $(LXC_SRCDIR)
touch $@
lxc-install: lxc-build
mkdir -p $(LXC_PKGDIR)/lib
cp $(LXC_SRCDIR)/src/lxc/liblxc.so $(LXC_PKGDIR)/lib
mkdir -p $(LXC_PKGDIR)/bin
cp $(LXC_PROGRAMS) $(LXC_PKGDIR)/bin
# $(call COPYTREE, packages/lxc/service, $(LXC_PKGDIR)/service)
lxc-clean:
rm -rf $(LXC_BUILDDIR)
LIBCAP_PKGDIR = $(TARGET)/libcap
PACKAGES += lxc

11
packages/lxc/utmp.c Normal file
View File

@ -0,0 +1,11 @@
/* Detecting runlevels from utmp is straight up bullshit, you.
1. runit doesn't have run levels
2. dbtl doesn't write utmp
3. even if it did, it doesn't have the glibc functions this code
wants
*/
int lxc_utmp_mainloop_add(struct lxc_epoll_descr *descr,
struct lxc_handler *handler) {
return 0;
}