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