diff options
Diffstat (limited to 'recipes-containers/lxc/lxc_1.1.5.bb')
| -rw-r--r-- | recipes-containers/lxc/lxc_1.1.5.bb | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_1.1.5.bb b/recipes-containers/lxc/lxc_1.1.5.bb new file mode 100644 index 00000000..0f6d0b85 --- /dev/null +++ b/recipes-containers/lxc/lxc_1.1.5.bb | |||
| @@ -0,0 +1,179 @@ | |||
| 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 | PRIORITY = "optional" | ||
| 6 | DEPENDS = "libxml2 libcap" | ||
| 7 | RDEPENDS_${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 | " | ||
| 22 | RDEPENDS_${PN}-ptest += "file make" | ||
| 23 | |||
| 24 | SRC_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 | file://open_without_symlink-Account-when-prefix-is-empty-st.patch \ | ||
| 38 | file://lxc_setup_fs-Create-dev-shm-folder-if-it-doesn-t-exi.patch \ | ||
| 39 | file://mount_proc_if_needed-only-safe-mount-when-rootfs-is-.patch \ | ||
| 40 | file://open_without_symlink-Don-t-SYSERROR-on-something-els.patch \ | ||
| 41 | file://lxc-busybox-Touch-etc-fstab-in-the-container-rootfs.patch \ | ||
| 42 | file://lxc-busybox-Remove-warning-for-dynamically-linked-Bu.patch \ | ||
| 43 | " | ||
| 44 | |||
| 45 | SRC_URI[md5sum] = "dd9684dde0a58ed13f4f49c855b79a1a" | ||
| 46 | SRC_URI[sha256sum] = "9588ad1b04e114ee7370f690c65131e28098b28d2521d97c73557d11897ed0be" | ||
| 47 | |||
| 48 | S = "${WORKDIR}/${BPN}-${PV}" | ||
| 49 | |||
| 50 | # Let's not configure for the host distro. | ||
| 51 | # | ||
| 52 | PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" | ||
| 53 | EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}" | ||
| 54 | |||
| 55 | EXTRA_OECONF += "--with-init-script=\ | ||
| 56 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\ | ||
| 57 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
| 58 | |||
| 59 | EXTRA_OECONF += "--enable-log-src-basename" | ||
| 60 | |||
| 61 | PACKAGECONFIG ??= "templates \ | ||
| 62 | ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ | ||
| 63 | " | ||
| 64 | PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," | ||
| 65 | PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," | ||
| 66 | PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" | ||
| 67 | PACKAGECONFIG[templates] = ",,, ${PN}-templates" | ||
| 68 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" | ||
| 69 | PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" | ||
| 70 | PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core" | ||
| 71 | |||
| 72 | # required by python3 to run setup.py | ||
| 73 | export BUILD_SYS | ||
| 74 | export HOST_SYS | ||
| 75 | export STAGING_INCDIR | ||
| 76 | export STAGING_LIBDIR | ||
| 77 | |||
| 78 | inherit autotools pkgconfig ptest update-rc.d systemd | ||
| 79 | |||
| 80 | SYSTEMD_PACKAGES = "${PN}-setup" | ||
| 81 | SYSTEMD_SERVICE_${PN}-setup = "lxc.service" | ||
| 82 | SYSTEMD_AUTO_ENABLE_${PN}-setup = "disable" | ||
| 83 | |||
| 84 | INITSCRIPT_PACKAGES = "${PN}-setup" | ||
| 85 | INITSCRIPT_NAME_{PN}-setup = "lxc" | ||
| 86 | INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
| 87 | |||
| 88 | FILES_${PN}-doc = "${mandir} ${infodir}" | ||
| 89 | # For LXC the docdir only contains example configuration files and should be included in the lxc package | ||
| 90 | FILES_${PN} += "${docdir}" | ||
| 91 | FILES_${PN} += "${libdir}/python3*" | ||
| 92 | FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" | ||
| 93 | PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking" | ||
| 94 | FILES_${PN}-templates += "${datadir}/lxc/templates" | ||
| 95 | RDEPENDS_${PN}-templates += "bash" | ||
| 96 | |||
| 97 | ALLOW_EMPTY_${PN}-networking = "1" | ||
| 98 | |||
| 99 | FILES_${PN}-setup += "/etc/tmpfiles.d" | ||
| 100 | FILES_${PN}-setup += "/lib/systemd/system" | ||
| 101 | FILES_${PN}-setup += "/usr/lib/systemd/system" | ||
| 102 | FILES_${PN}-setup += "/etc/init.d" | ||
| 103 | |||
| 104 | PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" | ||
| 105 | |||
| 106 | CACHED_CONFIGUREVARS += " \ | ||
| 107 | ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \ | ||
| 108 | am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \ | ||
| 109 | am_cv_python_pythondir='${prefix}/${libdir}/python3.5/site-packages' \ | ||
| 110 | " | ||
| 111 | |||
| 112 | do_install_append() { | ||
| 113 | # The /var/cache/lxc directory created by the Makefile | ||
| 114 | # is wiped out in volatile, we need to create this at boot. | ||
| 115 | rm -rf ${D}${localstatedir}/cache | ||
| 116 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 117 | echo "d root root 0755 ${localstatedir}/cache/lxc none" \ | ||
| 118 | > ${D}${sysconfdir}/default/volatiles/99_lxc | ||
| 119 | |||
| 120 | for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ | ||
| 121 | sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done | ||
| 122 | |||
| 123 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 124 | install -d ${D}${sysconfdir}/init.d | ||
| 125 | install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d | ||
| 126 | fi | ||
| 127 | |||
| 128 | # since python3-native is used for install location this will not be | ||
| 129 | # suitable for the target and we will have to correct the package install | ||
| 130 | if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then | ||
| 131 | if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi | ||
| 132 | rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib | ||
| 133 | fi | ||
| 134 | } | ||
| 135 | |||
| 136 | EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" | ||
| 137 | |||
| 138 | do_install_ptest() { | ||
| 139 | oe_runmake -C src/tests install-ptest | ||
| 140 | } | ||
| 141 | |||
| 142 | pkg_postinst_${PN}() { | ||
| 143 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
| 144 | /etc/init.d/populate-volatile.sh update | ||
| 145 | fi | ||
| 146 | } | ||
| 147 | |||
| 148 | pkg_postinst_${PN}-networking() { | ||
| 149 | if [ "x$D" != "x" ]; then | ||
| 150 | exit 1 | ||
| 151 | fi | ||
| 152 | |||
| 153 | # setup for our bridge | ||
| 154 | echo "lxc.network.link=lxcbr0" >> ${sysconfdir}/lxc/default.conf | ||
| 155 | |||
| 156 | cat >> /etc/network/interfaces << EOF | ||
| 157 | |||
| 158 | auto lxcbr0 | ||
| 159 | iface lxcbr0 inet dhcp | ||
| 160 | bridge_ports eth0 | ||
| 161 | bridge_fd 0 | ||
| 162 | bridge_maxwait 0 | ||
| 163 | EOF | ||
| 164 | |||
| 165 | cat<<EOF>/etc/network/if-pre-up.d/lxcbr0 | ||
| 166 | #! /bin/sh | ||
| 167 | |||
| 168 | if test "x\$IFACE" = xlxcbr0 ; then | ||
| 169 | brctl show |grep lxcbr0 > /dev/null 2>/dev/null | ||
| 170 | if [ \$? != 0 ] ; then | ||
| 171 | brctl addbr lxcbr0 | ||
| 172 | brctl addif lxcbr0 eth0 | ||
| 173 | ip addr flush eth0 | ||
| 174 | ifconfig eth0 up | ||
| 175 | fi | ||
| 176 | fi | ||
| 177 | EOF | ||
| 178 | chmod 755 /etc/network/if-pre-up.d/lxcbr0 | ||
| 179 | } | ||
