From 4eee3730ff98927b43498d22bad9aa8b5d2766a9 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 20 Jan 2015 14:16:16 -0500 Subject: lxc: uprev to 1.0.7 lxc 1.0.7 is available, and integrates two patches that we were carrying against 1.0.6 .. so we do the update, and drop the two busybox patches. Signed-off-by: Bruce Ashfield --- ...sybox_template_mount_fstab_when_available.patch | 32 -------- ...plate_support_for_unprivileged_containers.patch | 92 ---------------------- recipes-containers/lxc/lxc_1.0.6.bb | 86 -------------------- recipes-containers/lxc/lxc_1.0.7.bb | 84 ++++++++++++++++++++ 4 files changed, 84 insertions(+), 210 deletions(-) delete mode 100644 recipes-containers/lxc/files/busybox_template_mount_fstab_when_available.patch delete mode 100644 recipes-containers/lxc/files/busybox_template_support_for_unprivileged_containers.patch delete mode 100644 recipes-containers/lxc/lxc_1.0.6.bb create mode 100644 recipes-containers/lxc/lxc_1.0.7.bb (limited to 'recipes-containers') diff --git a/recipes-containers/lxc/files/busybox_template_mount_fstab_when_available.patch b/recipes-containers/lxc/files/busybox_template_mount_fstab_when_available.patch deleted file mode 100644 index 74b4fdfa..00000000 --- a/recipes-containers/lxc/files/busybox_template_mount_fstab_when_available.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 12c3b43fbeacd9cc471adf565ecea3263e37e353 Mon Sep 17 00:00:00 2001 -From: Bogdan Purcareata -Date: Mon, 20 Oct 2014 15:56:54 -0400 -Subject: [PATCH] busybox template: mount fstab when available - -When running unprivileged, lxc-create will touch a fstab file, with bind-mounts -for the ttys and other devices. Add this entry in the container config. - -Upstream-Status: Accepted -[https://github.com/lxc/lxc/commit/12c3b43fbeacd9cc471adf565ecea3263e37e353] - -Signed-off-by: Bogdan Purcareata -Acked-by: Serge E. Hallyn ---- - templates/lxc-busybox.in | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in -index ca2dd43..ee54a7a 100644 ---- a/templates/lxc-busybox.in -+++ b/templates/lxc-busybox.in -@@ -301,6 +301,10 @@ EOF - done - echo "lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0" >>$path/config - echo "lxc.mount.auto = proc:mixed sys" >>$path/config -+ -+ if [ -f "$path/fstab" ]; then -+ echo "lxc.mount = $path/fstab" >>$path/config -+ fi - } - - remap_userns() diff --git a/recipes-containers/lxc/files/busybox_template_support_for_unprivileged_containers.patch b/recipes-containers/lxc/files/busybox_template_support_for_unprivileged_containers.patch deleted file mode 100644 index 4e9ab74f..00000000 --- a/recipes-containers/lxc/files/busybox_template_support_for_unprivileged_containers.patch +++ /dev/null @@ -1,92 +0,0 @@ -From a542dd3c1aca8b6674f631d625d888eb13ae3a4d Mon Sep 17 00:00:00 2001 -From: Bogdan Purcareata -Date: Mon, 20 Oct 2014 15:56:53 -0400 -Subject: [PATCH] busybox template: support for unprivileged containers - -Apply the changes found in templates/lxc-download to the busybox template as -well. Change ownership of the config and fstab files to the unprivileged user, -and the ownership of the rootfs to root in the new user namespace. - -Eliminate the "unsupported for userns" flag. - -Upstream-Status: Accepted -[https://github.com/lxc/lxc/commit/a542dd3c1aca8b6674f631d625d888eb13ae3a4d] - -Signed-off-by: Bogdan Purcareata -Acked-by: Serge E. Hallyn ---- - templates/lxc-busybox.in | 36 ++++++++++++++++++++++++++---------- - 1 file changed, 26 insertions(+), 10 deletions(-) - -diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in -index 246e743..ca2dd43 100644 ---- a/templates/lxc-busybox.in -+++ b/templates/lxc-busybox.in -@@ -20,15 +20,8 @@ - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - --# Detect use under userns (unsupported) --for arg in "$@"; do -- [ "$arg" = "--" ] && break -- if [ "$arg" = "--mapped-uid" -o "$arg" = "--mapped-gid" ]; then -- echo "This template can't be used for unprivileged containers." 1>&2 -- echo "You may want to try the \"download\" template instead." 1>&2 -- exit 1 -- fi --done -+LXC_MAPPED_UID= -+LXC_MAPPED_GID= - - # Make sure the usual locations are in PATH - export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin -@@ -310,6 +303,21 @@ EOF - echo "lxc.mount.auto = proc:mixed sys" >>$path/config - } - -+remap_userns() -+{ -+ path=$1 -+ -+ if [ -n "$LXC_MAPPED_UID" ] && [ "$LXC_MAPPED_UID" != "-1" ]; then -+ chown $LXC_MAPPED_UID $path/config $path/fstab >/dev/null 2>&1 -+ chown -R root $path/rootfs >/dev/null 2>&1 -+ fi -+ -+ if [ -n "$LXC_MAPPED_GID" ] && [ "$LXC_MAPPED_GID" != "-1" ]; then -+ chgrp $LXC_MAPPED_GID $path/config $path/fstab >/dev/null 2>&1 -+ chgrp -R root $path/rootfs >/dev/null 2>&1 -+ fi -+} -+ - usage() - { - cat < ${D}${sysconfdir}/default/volatiles/99_lxc - - for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ - sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done -} - -EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" - -do_install_ptest() { - oe_runmake -C src/tests install-ptest -} - -pkg_postinst_${PN}() { - if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then - /etc/init.d/populate-volatile.sh update - fi -} diff --git a/recipes-containers/lxc/lxc_1.0.7.bb b/recipes-containers/lxc/lxc_1.0.7.bb new file mode 100644 index 00000000..952c9262 --- /dev/null +++ b/recipes-containers/lxc/lxc_1.0.7.bb @@ -0,0 +1,84 @@ +DESCRIPTION = "lxc aims to use these new functionnalities to provide an userspace container object" +SECTION = "console/utils" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" +PRIORITY = "optional" +DEPENDS = "libxml2 libcap" +RDEPENDS_${PN} = " \ + rsync \ + gzip \ + libcap-bin \ + bridge-utils \ + dnsmasq \ + perl-module-strict \ + perl-module-getopt-long \ + perl-module-vars \ + perl-module-warnings-register \ + perl-module-exporter \ + perl-module-constant \ + perl-module-overload \ + perl-module-exporter-heavy \ +" +RDEPENDS_${PN}-ptest += "file make" + +SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ + file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \ + file://runtest.patch \ + file://run-ptest \ + file://automake-ensure-VPATH-builds-correctly.patch \ + " + +SRC_URI[md5sum] = "b48f468a9bef0e4e140dd723f0a65ad0" +SRC_URI[sha256sum] = "3c0cb2d95d9d8a8d59c7189d237a45cde77f38ea180fbff2c148d59e176e9dab" + +S = "${WORKDIR}/${BPN}-${PV}" + +# Let's not configure for the host distro. +# +PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" +EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}" + +PACKAGECONFIG ??= "templates \ + ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ +" +PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," +PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," +PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" +PACKAGECONFIG[templates] = ",,, ${PN}-templates" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" + +inherit autotools pkgconfig ptest + +FILES_${PN}-doc = "${mandir} ${infodir}" +# For LXC the docdir only contains example configuration files and should be included in the lxc package +FILES_${PN} += "${docdir}" +FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" +PACKAGES =+ "${PN}-templates" +FILES_${PN}-templates += "${datadir}/lxc/templates" +RDEPENDS_${PN}-templates += "bash" + +PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" + +do_install_append() { + # The /var/cache/lxc directory created by the Makefile + # is wiped out in volatile, we need to create this at boot. + rm -rf ${D}${localstatedir}/cache + install -d ${D}${sysconfdir}/default/volatiles + echo "d root root 0755 ${localstatedir}/cache/lxc none" \ + > ${D}${sysconfdir}/default/volatiles/99_lxc + + for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ + sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done +} + +EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" + +do_install_ptest() { + oe_runmake -C src/tests install-ptest +} + +pkg_postinst_${PN}() { + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi +} -- cgit v1.2.3-54-g00ecf