summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc/lxc_2.0.8.bb
diff options
context:
space:
mode:
authorHuang Qiyu <huangqy.fnst@cn.fujitsu.com>2017-06-06 14:46:54 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-06-13 18:26:15 -0400
commite73608d56e498a7075e7a3e5550aafd76987d7aa (patch)
tree4a1381c102f0f81513e90b119342f66cb7e13709 /recipes-containers/lxc/lxc_2.0.8.bb
parent3c427eafce21c615d5da76f261329497f7fcfeac (diff)
downloadmeta-virtualization-e73608d56e498a7075e7a3e5550aafd76987d7aa.tar.gz
lxc: 2.0.0 -> 2.0.8
1)Upgrade lxc from 2.0.0 to 2.0.8. 2)Delete two patches, since it is integrated upstream. Delete Generate-lxc-restore-net-properly.patch,this script has already been rearchitected out of existence by cba98d127bf490b018a016b792ae05fd2d29c5ee Delete Use-AC_HEADER_MAJOR-to-detect-major-minor-makedev.patch,this script has already been rearchitected out of existence by af6824fce9c9536fbcabef8d5547f6c486f55fdf from git://github.com/lxc/lxc.git 3)Modify two patches, since the data has been changed. automake-ensure-VPATH-builds-correctly.patch runtest.patch Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc/lxc_2.0.8.bb')
-rw-r--r--recipes-containers/lxc/lxc_2.0.8.bb174
1 files changed, 174 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_2.0.8.bb b/recipes-containers/lxc/lxc_2.0.8.bb
new file mode 100644
index 00000000..80c8da73
--- /dev/null
+++ b/recipes-containers/lxc/lxc_2.0.8.bb
@@ -0,0 +1,174 @@
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"
5DEPENDS = "libxml2 libcap"
6RDEPENDS_${PN} = " \
7 rsync \
8 gzip \
9 libcap-bin \
10 bridge-utils \
11 dnsmasq \
12 perl-module-strict \
13 perl-module-getopt-long \
14 perl-module-vars \
15 perl-module-warnings-register \
16 perl-module-exporter \
17 perl-module-constant \
18 perl-module-overload \
19 perl-module-exporter-heavy \
20"
21RDEPENDS_${PN}-ptest += "file make gmp nettle gnutls"
22
23SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
24 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
25 file://runtest.patch \
26 file://run-ptest \
27 file://automake-ensure-VPATH-builds-correctly.patch \
28 file://lxc-fix-B-S.patch \
29 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
30 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
31 "
32
33SRC_URI[md5sum] = "7bfd95280522d7936c0979dfea92cdb5"
34SRC_URI[sha256sum] = "0d8e34b302cfe4c40c6c9ae5097096aa5cc2c1dfceea3f0f22e3e16c4a4e8494"
35
36S = "${WORKDIR}/${BPN}-${PV}"
37
38# Let's not configure for the host distro.
39#
40PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}"
41EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
42
43EXTRA_OECONF += "--with-init-script=\
44${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\
45${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
46
47EXTRA_OECONF += "--enable-log-src-basename"
48
49CFLAGS_append = " -Wno-error=deprecated-declarations"
50
51PACKAGECONFIG ??= "templates \
52 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
53"
54PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,,"
55PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,,"
56PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor"
57PACKAGECONFIG[templates] = ",,, ${PN}-templates"
58PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
59PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp"
60PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core"
61PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua,lua"
62
63# required by python3 to run setup.py
64export BUILD_SYS
65export HOST_SYS
66export STAGING_INCDIR
67export STAGING_LIBDIR
68
69inherit autotools pkgconfig ptest update-rc.d systemd python3native
70
71SYSTEMD_PACKAGES = "${PN}-setup"
72SYSTEMD_SERVICE_${PN}-setup = "lxc.service"
73SYSTEMD_AUTO_ENABLE_${PN}-setup = "disable"
74
75INITSCRIPT_PACKAGES = "${PN}-setup"
76INITSCRIPT_NAME_{PN}-setup = "lxc"
77INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
78
79FILES_${PN}-doc = "${mandir} ${infodir}"
80# For LXC the docdir only contains example configuration files and should be included in the lxc package
81FILES_${PN} += "${docdir}"
82FILES_${PN} += "${libdir}/python3*"
83FILES_${PN} += "${datadir}/bash-completion"
84FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
85FILES_${PN}-dbg += "${libexecdir}/lxc/hooks/.debug"
86PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking ${PN}-lua"
87FILES_lua-${PN} = "${datadir}/lua ${libdir}/lua"
88FILES_lua-${PN}-dbg += "${libdir}/lua/lxc/.debug"
89FILES_${PN}-templates += "${datadir}/lxc/templates"
90RDEPENDS_${PN}-templates += "bash"
91
92ALLOW_EMPTY_${PN}-networking = "1"
93
94FILES_${PN}-setup += "/etc/tmpfiles.d"
95FILES_${PN}-setup += "/lib/systemd/system"
96FILES_${PN}-setup += "/usr/lib/systemd/system"
97FILES_${PN}-setup += "/etc/init.d"
98
99PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
100
101CACHED_CONFIGUREVARS += " \
102 ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \
103 am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \
104 am_cv_python_pythondir='${prefix}/${libdir}/python3.5/site-packages' \
105"
106
107do_install_append() {
108 # The /var/cache/lxc directory created by the Makefile
109 # is wiped out in volatile, we need to create this at boot.
110 rm -rf ${D}${localstatedir}/cache
111 install -d ${D}${sysconfdir}/default/volatiles
112 echo "d root root 0755 ${localstatedir}/cache/lxc none" \
113 > ${D}${sysconfdir}/default/volatiles/99_lxc
114
115 for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \
116 sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done
117
118 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
119 install -d ${D}${sysconfdir}/init.d
120 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d
121 fi
122
123 # since python3-native is used for install location this will not be
124 # suitable for the target and we will have to correct the package install
125 if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
126 if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi
127 rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib
128 fi
129}
130
131EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"
132
133do_install_ptest() {
134 oe_runmake -C src/tests install-ptest
135}
136
137pkg_postinst_${PN}() {
138 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
139 /etc/init.d/populate-volatile.sh update
140 fi
141}
142
143pkg_postinst_${PN}-networking() {
144 if [ "x$D" != "x" ]; then
145 exit 1
146 fi
147
148 # setup for our bridge
149 echo "lxc.network.link=lxcbr0" >> ${sysconfdir}/lxc/default.conf
150
151cat >> /etc/network/interfaces << EOF
152
153auto lxcbr0
154iface lxcbr0 inet dhcp
155 bridge_ports eth0
156 bridge_fd 0
157 bridge_maxwait 0
158EOF
159
160cat<<EOF>/etc/network/if-pre-up.d/lxcbr0
161#! /bin/sh
162
163if test "x\$IFACE" = xlxcbr0 ; then
164 brctl show |grep lxcbr0 > /dev/null 2>/dev/null
165 if [ \$? != 0 ] ; then
166 brctl addbr lxcbr0
167 brctl addif lxcbr0 eth0
168 ip addr flush eth0
169 ifconfig eth0 up
170 fi
171fi
172EOF
173chmod 755 /etc/network/if-pre-up.d/lxcbr0
174}