summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/lxc_1.1.4.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/lxc_1.1.4.bb')
-rw-r--r--recipes-containers/lxc/lxc_1.1.4.bb152
1 files changed, 152 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_1.1.4.bb b/recipes-containers/lxc/lxc_1.1.4.bb
new file mode 100644
index 00000000..4006debd
--- /dev/null
+++ b/recipes-containers/lxc/lxc_1.1.4.bb
@@ -0,0 +1,152 @@
1DESCRIPTION = "lxc aims to use these new functionnalities to provide an userspace container object"
2SECTION = "console/utils"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
5PRIORITY = "optional"
6DEPENDS = "libxml2 libcap"
7RDEPENDS_${PN} = " \
8 rsync \
9 gzip \
10 libcap-bin \
11 bridge-utils \
12 dnsmasq \
13 perl-module-strict \
14 perl-module-getopt-long \
15 perl-module-vars \
16 perl-module-warnings-register \
17 perl-module-exporter \
18 perl-module-constant \
19 perl-module-overload \
20 perl-module-exporter-heavy \
21"
22RDEPENDS_${PN}-ptest += "file make"
23
24SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
25 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
26 file://runtest.patch \
27 file://run-ptest \
28 file://automake-ensure-VPATH-builds-correctly.patch \
29 file://add-lxc.rebootsignal.patch \
30 file://document-lxc.rebootsignal.patch \
31 file://lxc-busybox-use-lxc.rebootsignal-SIGTERM.patch \
32 file://lxc-fix-B-S.patch \
33 file://lxc-busybox-add-OpenSSH-support.patch \
34 file://make-some-OpenSSH-tools-optional.patch \
35 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
36 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
37 "
38
39SRC_URI[md5sum] = "d33c4bd9c57755c0e2b0e2acbc3f171d"
40SRC_URI[sha256sum] = "8f072ea2001bc94389003d82a91902855edf16b609e06f0486a74e4b8973e5dc"
41
42S = "${WORKDIR}/${BPN}-${PV}"
43
44# Let's not configure for the host distro.
45#
46PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}"
47EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
48
49EXTRA_OECONF += "--with-init-script=\
50${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\
51${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
52
53EXTRA_OECONF += "--enable-log-src-basename"
54
55PACKAGECONFIG ??= "templates \
56 ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
57"
58PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,,"
59PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,,"
60PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor"
61PACKAGECONFIG[templates] = ",,, ${PN}-templates"
62PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
63PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp"
64
65inherit autotools pkgconfig ptest update-rc.d systemd
66
67SYSTEMD_PACKAGES = "${PN}-setup"
68SYSTEMD_SERVICE_${PN}-setup = "lxc.service"
69SYSTEMD_AUTO_ENABLE_${PN}-setup = "disable"
70
71INITSCRIPT_PACKAGES = "${PN}-setup"
72INITSCRIPT_NAME_{PN}-setup = "lxc"
73INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
74
75FILES_${PN}-doc = "${mandir} ${infodir}"
76# For LXC the docdir only contains example configuration files and should be included in the lxc package
77FILES_${PN} += "${docdir}"
78FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
79PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking"
80FILES_${PN}-templates += "${datadir}/lxc/templates"
81RDEPENDS_${PN}-templates += "bash"
82
83ALLOW_EMPTY_${PN}-networking = "1"
84
85FILES_${PN}-setup += "/etc/tmpfiles.d"
86FILES_${PN}-setup += "/lib/systemd/system"
87FILES_${PN}-setup += "/usr/lib/systemd/system"
88FILES_${PN}-setup += "/etc/init.d"
89
90PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
91
92do_install_append() {
93 # The /var/cache/lxc directory created by the Makefile
94 # is wiped out in volatile, we need to create this at boot.
95 rm -rf ${D}${localstatedir}/cache
96 install -d ${D}${sysconfdir}/default/volatiles
97 echo "d root root 0755 ${localstatedir}/cache/lxc none" \
98 > ${D}${sysconfdir}/default/volatiles/99_lxc
99
100 for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \
101 sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done
102
103 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
104 install -d ${D}${sysconfdir}/init.d
105 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d
106 fi
107}
108
109EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"
110
111do_install_ptest() {
112 oe_runmake -C src/tests install-ptest
113}
114
115pkg_postinst_${PN}() {
116 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
117 /etc/init.d/populate-volatile.sh update
118 fi
119}
120
121pkg_postinst_${PN}-networking() {
122 if [ "x$D" != "x" ]; then
123 exit 1
124 fi
125
126 # setup for our bridge
127 echo "lxc.network.link=lxcbr0" >> ${sysconfdir}/lxc/default.conf
128
129cat >> /etc/network/interfaces << EOF
130
131auto lxcbr0
132iface lxcbr0 inet dhcp
133 bridge_ports eth0
134 bridge_fd 0
135 bridge_maxwait 0
136EOF
137
138cat<<EOF>/etc/network/if-pre-up.d/lxcbr0
139#! /bin/sh
140
141if test "x\$IFACE" = xlxcbr0 ; then
142 brctl show |grep lxcbr0 > /dev/null 2>/dev/null
143 if [ \$? != 0 ] ; then
144 brctl addbr lxcbr0
145 brctl addif lxcbr0 eth0
146 ip addr flush eth0
147 ifconfig eth0 up
148 fi
149fi
150EOF
151chmod 755 /etc/network/if-pre-up.d/lxcbr0
152}