diff options
Diffstat (limited to 'recipes-containers/lxc/lxc_1.1.4.bb')
| -rw-r--r-- | recipes-containers/lxc/lxc_1.1.4.bb | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_1.1.4.bb b/recipes-containers/lxc/lxc_1.1.4.bb new file mode 100644 index 00000000..4006debd --- /dev/null +++ b/recipes-containers/lxc/lxc_1.1.4.bb | |||
| @@ -0,0 +1,152 @@ | |||
| 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 | " | ||
| 38 | |||
| 39 | SRC_URI[md5sum] = "d33c4bd9c57755c0e2b0e2acbc3f171d" | ||
| 40 | SRC_URI[sha256sum] = "8f072ea2001bc94389003d82a91902855edf16b609e06f0486a74e4b8973e5dc" | ||
| 41 | |||
| 42 | S = "${WORKDIR}/${BPN}-${PV}" | ||
| 43 | |||
| 44 | # Let's not configure for the host distro. | ||
| 45 | # | ||
| 46 | PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" | ||
| 47 | EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}" | ||
| 48 | |||
| 49 | EXTRA_OECONF += "--with-init-script=\ | ||
| 50 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\ | ||
| 51 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
| 52 | |||
| 53 | EXTRA_OECONF += "--enable-log-src-basename" | ||
| 54 | |||
| 55 | PACKAGECONFIG ??= "templates \ | ||
| 56 | ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ | ||
| 57 | " | ||
| 58 | PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," | ||
| 59 | PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," | ||
| 60 | PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" | ||
| 61 | PACKAGECONFIG[templates] = ",,, ${PN}-templates" | ||
| 62 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" | ||
| 63 | PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" | ||
| 64 | |||
| 65 | inherit autotools pkgconfig ptest update-rc.d systemd | ||
| 66 | |||
| 67 | SYSTEMD_PACKAGES = "${PN}-setup" | ||
| 68 | SYSTEMD_SERVICE_${PN}-setup = "lxc.service" | ||
| 69 | SYSTEMD_AUTO_ENABLE_${PN}-setup = "disable" | ||
| 70 | |||
| 71 | INITSCRIPT_PACKAGES = "${PN}-setup" | ||
| 72 | INITSCRIPT_NAME_{PN}-setup = "lxc" | ||
| 73 | INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}" | ||
| 74 | |||
| 75 | FILES_${PN}-doc = "${mandir} ${infodir}" | ||
| 76 | # For LXC the docdir only contains example configuration files and should be included in the lxc package | ||
| 77 | FILES_${PN} += "${docdir}" | ||
| 78 | FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" | ||
| 79 | PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking" | ||
| 80 | FILES_${PN}-templates += "${datadir}/lxc/templates" | ||
| 81 | RDEPENDS_${PN}-templates += "bash" | ||
| 82 | |||
| 83 | ALLOW_EMPTY_${PN}-networking = "1" | ||
| 84 | |||
| 85 | FILES_${PN}-setup += "/etc/tmpfiles.d" | ||
| 86 | FILES_${PN}-setup += "/lib/systemd/system" | ||
| 87 | FILES_${PN}-setup += "/usr/lib/systemd/system" | ||
| 88 | FILES_${PN}-setup += "/etc/init.d" | ||
| 89 | |||
| 90 | PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" | ||
| 91 | |||
| 92 | do_install_append() { | ||
| 93 | # The /var/cache/lxc directory created by the Makefile | ||
| 94 | # is wiped out in volatile, we need to create this at boot. | ||
| 95 | rm -rf ${D}${localstatedir}/cache | ||
| 96 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 97 | echo "d root root 0755 ${localstatedir}/cache/lxc none" \ | ||
| 98 | > ${D}${sysconfdir}/default/volatiles/99_lxc | ||
| 99 | |||
| 100 | for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ | ||
| 101 | sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done | ||
| 102 | |||
| 103 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 104 | install -d ${D}${sysconfdir}/init.d | ||
| 105 | install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d | ||
| 106 | fi | ||
| 107 | } | ||
| 108 | |||
| 109 | EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" | ||
| 110 | |||
| 111 | do_install_ptest() { | ||
| 112 | oe_runmake -C src/tests install-ptest | ||
| 113 | } | ||
| 114 | |||
| 115 | pkg_postinst_${PN}() { | ||
| 116 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
| 117 | /etc/init.d/populate-volatile.sh update | ||
| 118 | fi | ||
| 119 | } | ||
| 120 | |||
| 121 | pkg_postinst_${PN}-networking() { | ||
| 122 | if [ "x$D" != "x" ]; then | ||
| 123 | exit 1 | ||
| 124 | fi | ||
| 125 | |||
| 126 | # setup for our bridge | ||
| 127 | echo "lxc.network.link=lxcbr0" >> ${sysconfdir}/lxc/default.conf | ||
| 128 | |||
| 129 | cat >> /etc/network/interfaces << EOF | ||
| 130 | |||
| 131 | auto lxcbr0 | ||
| 132 | iface lxcbr0 inet dhcp | ||
| 133 | bridge_ports eth0 | ||
| 134 | bridge_fd 0 | ||
| 135 | bridge_maxwait 0 | ||
| 136 | EOF | ||
| 137 | |||
| 138 | cat<<EOF>/etc/network/if-pre-up.d/lxcbr0 | ||
| 139 | #! /bin/sh | ||
| 140 | |||
| 141 | if test "x\$IFACE" = xlxcbr0 ; then | ||
| 142 | brctl show |grep lxcbr0 > /dev/null 2>/dev/null | ||
| 143 | if [ \$? != 0 ] ; then | ||
| 144 | brctl addbr lxcbr0 | ||
| 145 | brctl addif lxcbr0 eth0 | ||
| 146 | ip addr flush eth0 | ||
| 147 | ifconfig eth0 up | ||
| 148 | fi | ||
| 149 | fi | ||
| 150 | EOF | ||
| 151 | chmod 755 /etc/network/if-pre-up.d/lxcbr0 | ||
| 152 | } | ||
