diff options
author | Huang Qiyu <huangqy.fnst@cn.fujitsu.com> | 2017-06-06 14:46:54 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-06-13 18:26:15 -0400 |
commit | e73608d56e498a7075e7a3e5550aafd76987d7aa (patch) | |
tree | 4a1381c102f0f81513e90b119342f66cb7e13709 /recipes-containers/lxc/lxc_2.0.8.bb | |
parent | 3c427eafce21c615d5da76f261329497f7fcfeac (diff) | |
download | meta-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.bb | 174 |
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 @@ | |||
1 | DESCRIPTION = "lxc aims to use these new functionnalities to provide an userspace container object" | ||
2 | SECTION = "console/utils" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | ||
5 | DEPENDS = "libxml2 libcap" | ||
6 | RDEPENDS_${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 | " | ||
21 | RDEPENDS_${PN}-ptest += "file make gmp nettle gnutls" | ||
22 | |||
23 | SRC_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 | |||
33 | SRC_URI[md5sum] = "7bfd95280522d7936c0979dfea92cdb5" | ||
34 | SRC_URI[sha256sum] = "0d8e34b302cfe4c40c6c9ae5097096aa5cc2c1dfceea3f0f22e3e16c4a4e8494" | ||
35 | |||
36 | S = "${WORKDIR}/${BPN}-${PV}" | ||
37 | |||
38 | # Let's not configure for the host distro. | ||
39 | # | ||
40 | PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" | ||
41 | EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}" | ||
42 | |||
43 | EXTRA_OECONF += "--with-init-script=\ | ||
44 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\ | ||
45 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
46 | |||
47 | EXTRA_OECONF += "--enable-log-src-basename" | ||
48 | |||
49 | CFLAGS_append = " -Wno-error=deprecated-declarations" | ||
50 | |||
51 | PACKAGECONFIG ??= "templates \ | ||
52 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ | ||
53 | " | ||
54 | PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," | ||
55 | PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," | ||
56 | PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" | ||
57 | PACKAGECONFIG[templates] = ",,, ${PN}-templates" | ||
58 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" | ||
59 | PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" | ||
60 | PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core" | ||
61 | PACKAGECONFIG[lua] = "--enable-lua,--disable-lua,lua,lua" | ||
62 | |||
63 | # required by python3 to run setup.py | ||
64 | export BUILD_SYS | ||
65 | export HOST_SYS | ||
66 | export STAGING_INCDIR | ||
67 | export STAGING_LIBDIR | ||
68 | |||
69 | inherit autotools pkgconfig ptest update-rc.d systemd python3native | ||
70 | |||
71 | SYSTEMD_PACKAGES = "${PN}-setup" | ||
72 | SYSTEMD_SERVICE_${PN}-setup = "lxc.service" | ||
73 | SYSTEMD_AUTO_ENABLE_${PN}-setup = "disable" | ||
74 | |||
75 | INITSCRIPT_PACKAGES = "${PN}-setup" | ||
76 | INITSCRIPT_NAME_{PN}-setup = "lxc" | ||
77 | INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
78 | |||
79 | FILES_${PN}-doc = "${mandir} ${infodir}" | ||
80 | # For LXC the docdir only contains example configuration files and should be included in the lxc package | ||
81 | FILES_${PN} += "${docdir}" | ||
82 | FILES_${PN} += "${libdir}/python3*" | ||
83 | FILES_${PN} += "${datadir}/bash-completion" | ||
84 | FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" | ||
85 | FILES_${PN}-dbg += "${libexecdir}/lxc/hooks/.debug" | ||
86 | PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking ${PN}-lua" | ||
87 | FILES_lua-${PN} = "${datadir}/lua ${libdir}/lua" | ||
88 | FILES_lua-${PN}-dbg += "${libdir}/lua/lxc/.debug" | ||
89 | FILES_${PN}-templates += "${datadir}/lxc/templates" | ||
90 | RDEPENDS_${PN}-templates += "bash" | ||
91 | |||
92 | ALLOW_EMPTY_${PN}-networking = "1" | ||
93 | |||
94 | FILES_${PN}-setup += "/etc/tmpfiles.d" | ||
95 | FILES_${PN}-setup += "/lib/systemd/system" | ||
96 | FILES_${PN}-setup += "/usr/lib/systemd/system" | ||
97 | FILES_${PN}-setup += "/etc/init.d" | ||
98 | |||
99 | PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" | ||
100 | |||
101 | CACHED_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 | |||
107 | do_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 | |||
131 | EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" | ||
132 | |||
133 | do_install_ptest() { | ||
134 | oe_runmake -C src/tests install-ptest | ||
135 | } | ||
136 | |||
137 | pkg_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 | |||
143 | pkg_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 | |||
151 | cat >> /etc/network/interfaces << EOF | ||
152 | |||
153 | auto lxcbr0 | ||
154 | iface lxcbr0 inet dhcp | ||
155 | bridge_ports eth0 | ||
156 | bridge_fd 0 | ||
157 | bridge_maxwait 0 | ||
158 | EOF | ||
159 | |||
160 | cat<<EOF>/etc/network/if-pre-up.d/lxcbr0 | ||
161 | #! /bin/sh | ||
162 | |||
163 | if 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 | ||
171 | fi | ||
172 | EOF | ||
173 | chmod 755 /etc/network/if-pre-up.d/lxcbr0 | ||
174 | } | ||