summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/lxc_4.0.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/lxc/lxc_4.0.3.bb')
-rw-r--r--recipes-containers/lxc/lxc_4.0.3.bb200
1 files changed, 200 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_4.0.3.bb b/recipes-containers/lxc/lxc_4.0.3.bb
new file mode 100644
index 00000000..b5c25a9e
--- /dev/null
+++ b/recipes-containers/lxc/lxc_4.0.3.bb
@@ -0,0 +1,200 @@
1DESCRIPTION = "lxc aims to use these new functionnalities to provide an userspace container object"
2SECTION = "console/utils"
3LICENSE = "LGPLv2.1 & GPLv2"
4LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
5 file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
6"
7
8DEPENDS = "libxml2 libcap"
9RDEPENDS_${PN} = " \
10 rsync \
11 curl \
12 gzip \
13 xz \
14 tar \
15 libcap-bin \
16 bridge-utils \
17 dnsmasq \
18 perl-module-strict \
19 perl-module-getopt-long \
20 perl-module-vars \
21 perl-module-exporter \
22 perl-module-constant \
23 perl-module-overload \
24 perl-module-exporter-heavy \
25 gmp \
26 libidn \
27 gnutls \
28 nettle \
29 util-linux-mountpoint \
30 util-linux-getopt \
31"
32
33RDEPENDS_${PN}_append_libc-glibc = " glibc-utils"
34
35RDEPENDS_${PN}-ptest += "file make gmp nettle gnutls bash libgcc"
36
37RDEPENDS_${PN}-networking += "iptables"
38
39SRC_URI = "http://linuxcontainers.org/downloads/${BPN}/${BPN}-${PV}.tar.gz \
40 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
41 file://run-ptest \
42 file://lxc-fix-B-S.patch \
43 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
44 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
45 file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \
46 file://template-make-busybox-template-compatible-with-core-.patch \
47 file://templates-use-curl-instead-of-wget.patch \
48 file://tests-our-init-is-not-busybox.patch \
49 file://tests-add-no-validate-when-using-download-template.patch \
50 file://dnsmasq.conf \
51 file://lxc-net \
52 "
53
54SRC_URI[md5sum] = "7d86ddf9fcb5f78ac5ae0380fbbfb690"
55SRC_URI[sha256sum] = "d56d91d772449c57e9a67b770dab8967e412051d8d6246ce56c63264671672e5"
56
57S = "${WORKDIR}/${BPN}-${PV}"
58
59# Let's not configure for the host distro.
60#
61PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}"
62EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
63
64EXTRA_OECONF += "--with-init-script=\
65${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\
66${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
67
68EXTRA_OECONF += "--enable-log-src-basename"
69
70CFLAGS_append = " -Wno-error=deprecated-declarations -Wno-error=stringop-overflow"
71
72PACKAGECONFIG ??= "templates \
73 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
74 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
75"
76PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,,"
77PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,,"
78PACKAGECONFIG[apparmor] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor"
79PACKAGECONFIG[templates] = ",,, ${PN}-templates"
80PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
81PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp"
82PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
83
84# required by python3 to run setup.py
85export BUILD_SYS
86export HOST_SYS
87export STAGING_INCDIR
88export STAGING_LIBDIR
89
90inherit autotools pkgconfig ptest update-rc.d systemd python3native
91
92SYSTEMD_PACKAGES = "${PN} ${PN}-networking"
93SYSTEMD_SERVICE_${PN} = "lxc.service"
94SYSTEMD_AUTO_ENABLE_${PN} = "disable"
95SYSTEMD_SERVICE_${PN}-networking = "lxc-net.service"
96SYSTEMD_AUTO_ENABLE_${PN}-networking = "enable"
97
98INITSCRIPT_PACKAGES = "${PN} ${PN}-networking"
99INITSCRIPT_NAME_${PN} = "lxc-containers"
100INITSCRIPT_PARAMS_${PN} = "defaults"
101INITSCRIPT_NAME_${PN}-networking = "lxc-net"
102INITSCRIPT_PARAMS_${PN}-networking = "defaults"
103
104FILES_${PN}-doc = "${mandir} ${infodir}"
105# For LXC the docdir only contains example configuration files and should be included in the lxc package
106FILES_${PN} += "${docdir}"
107FILES_${PN} += "${libdir}/python3*"
108FILES_${PN} += "${datadir}/bash-completion"
109FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
110FILES_${PN}-dbg += "${libexecdir}/lxc/hooks/.debug"
111PACKAGES =+ "${PN}-templates ${PN}-networking ${PN}-lua"
112FILES_lua-${PN} = "${datadir}/lua ${libdir}/lua"
113FILES_lua-${PN}-dbg += "${libdir}/lua/lxc/.debug"
114FILES_${PN}-templates += "${datadir}/lxc/templates"
115RDEPENDS_${PN}-templates += "bash"
116
117FILES_${PN}-networking += " \
118 ${sysconfdir}/init.d/lxc-net \
119 ${sysconfdir}/default/lxc-net \
120"
121
122CACHED_CONFIGUREVARS += " \
123 ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \
124 am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
125 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
126"
127
128do_install_append() {
129 # The /var/cache/lxc directory created by the Makefile
130 # is wiped out in volatile, we need to create this at boot.
131 rm -rf ${D}${localstatedir}/cache
132 install -d ${D}${sysconfdir}/default/volatiles
133 echo "d root root 0755 ${localstatedir}/cache/lxc none" \
134 > ${D}${sysconfdir}/default/volatiles/99_lxc
135
136 for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \
137 sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done
138
139 install -d ${D}${sysconfdir}/init.d
140 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d
141
142 # since python3-native is used for install location this will not be
143 # suitable for the target and we will have to correct the package install
144 if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
145 if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi
146 rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib
147 fi
148
149 # /etc/default/lxc sources lxc-net, this allows lxc bridge when lxc-networking
150 # is not installed this results in no lxcbr0, but when lxc-networking is installed
151 # lxcbr0 will be fully configured.
152 install -m 644 ${WORKDIR}/lxc-net ${D}${sysconfdir}/default/
153
154 # Force the main dnsmasq instance to bind only to specified interfaces and
155 # to not bind to virbr0. Libvirt will run its own instance on this interface.
156 install -d ${D}/${sysconfdir}/dnsmasq.d
157 install -m 644 ${WORKDIR}/dnsmasq.conf ${D}/${sysconfdir}/dnsmasq.d/lxc
158}
159
160EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"
161
162do_install_ptest() {
163 # Move tests to the "ptest directory"
164 install -d ${D}/${PTEST_PATH}/tests
165 mv ${D}/usr/bin/lxc-test-* ${D}/${PTEST_PATH}/tests/.
166}
167
168pkg_postinst_${PN}() {
169 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
170 /etc/init.d/populate-volatile.sh update
171 fi
172}
173
174pkg_postinst_${PN}-networking() {
175if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
176cat >> $D/etc/network/interfaces << EOF
177
178auto lxcbr0
179iface lxcbr0 inet dhcp
180 bridge_ports eth0
181 bridge_fd 0
182 bridge_maxwait 0
183EOF
184
185cat<<EOF>$D/etc/network/if-pre-up.d/lxcbr0
186#! /bin/sh
187
188if test "x\$IFACE" = xlxcbr0 ; then
189 brctl show |grep lxcbr0 > /dev/null 2>/dev/null
190 if [ \$? != 0 ] ; then
191 brctl addbr lxcbr0
192 brctl addif lxcbr0 eth0
193 ip addr flush eth0
194 ifconfig eth0 up
195 fi
196fi
197EOF
198chmod 755 $D/etc/network/if-pre-up.d/lxcbr0
199fi
200}