diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-03-24 00:29:00 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-03-24 00:29:00 +0000 |
commit | ef951e3798d0c6efffbbf104b12a00e432e2849d (patch) | |
tree | d5c03e97345d9e7e7eefbed04658eb839837c9c3 /app-emulation/lxc | |
parent | Linux patches 3.0.24, 3.0.25 and 3.0.26 (diff) | |
download | historical-ef951e3798d0c6efffbbf104b12a00e432e2849d.tar.gz historical-ef951e3798d0c6efffbbf104b12a00e432e2849d.tar.bz2 historical-ef951e3798d0c6efffbbf104b12a00e432e2849d.zip |
Version bump; change init script as the path is changed. Assume a modern OpenRC is used.
Package-Manager: portage-2.2.0_alpha94/cvs/Linux x86_64
Diffstat (limited to 'app-emulation/lxc')
-rw-r--r-- | app-emulation/lxc/ChangeLog | 11 | ||||
-rw-r--r-- | app-emulation/lxc/Manifest | 11 | ||||
-rw-r--r-- | app-emulation/lxc/files/lxc.initd.2 | 119 | ||||
-rw-r--r-- | app-emulation/lxc/lxc-0.8.0_rc1.ebuild | 118 |
4 files changed, 253 insertions, 6 deletions
diff --git a/app-emulation/lxc/ChangeLog b/app-emulation/lxc/ChangeLog index 01e666fe8b5e..9d1df2c33c4b 100644 --- a/app-emulation/lxc/ChangeLog +++ b/app-emulation/lxc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-emulation/lxc -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.29 2011/10/19 17:51:49 flameeyes Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.30 2012/03/24 00:29:00 flameeyes Exp $ + +*lxc-0.8.0_rc1 (24 Mar 2012) + + 24 Mar 2012; Diego E. Pettenò <flameeyes@gentoo.org> +files/lxc.initd.2, + +lxc-0.8.0_rc1.ebuild: + Version bump; change init script as the path is changed. Assume a modern + OpenRC is used. *lxc-0.7.5-r3 (19 Oct 2011) diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest index d1bd38540a4c..c808597a244e 100644 --- a/app-emulation/lxc/Manifest +++ b/app-emulation/lxc/Manifest @@ -2,14 +2,17 @@ Hash: SHA1 AUX lxc.initd 3746 RMD160 3a8749586c3ed6dedce7fc18d908903dfb8bf5a0 SHA1 7308443ab4c99de8604c31d2e3ef9c55a197ee05 SHA256 7c805f22792fd1b26b2ef102b4345479401c9b2f1e6f32622d66717354fb4328 +AUX lxc.initd.2 3298 RMD160 c231a4d3cb3f1aee180f29bb1327c8f212bf7c2d SHA1 d403f21e89e5a5af36d72d9d6619b4c7998efc38 SHA256 da2bdca3ec5d57e40ec06effc68e01628e3dbf44357d6e841fdcdcd21cad7499 DIST lxc-0.7.5.tar.gz 265562 RMD160 93407be1ebf31bdcfa617e60672d9f86ba2940d1 SHA1 9712dccdcd2c10a522134fa17384a5b9e38fce0e SHA256 019ec63f250c874bf7625b1f1bf555b1a6e3a947937a4fca73100abddf829b1c +DIST lxc-0.8.0-rc1.tar.gz 301029 RMD160 3480209a82f361f11a1476d5e92d747bcf751e8b SHA1 6e9a641b3ca06ad034712ecf437588c4585ff40e SHA256 32bf83902c07387646c55de440d6d12cf61bd54c97417109c2d1ac47d17cb911 EBUILD lxc-0.7.5-r3.ebuild 3206 RMD160 0b7d5f0ef7e6e908ce783af5662a0ad089a2b866 SHA1 f0a44bec950502bd74b3abcd81421d1e0a15f937 SHA256 43a9c13ea56d238a8797f266795d2837ba321ddf0d7db88a877be45dfcd4713a -MISC ChangeLog 6918 RMD160 aefabcbfad4969606fed2257d974b25ade8f8724 SHA1 2aae2d1e27d9fda7998e0fa5be8bafa647257c49 SHA256 d3dda626d338a8fc2cfb6cfcf80d7463426cfc6649bc1626302daadba6e5b21e +EBUILD lxc-0.8.0_rc1.ebuild 3428 RMD160 9908b974075acf124072ad5b2e96d6c454c8dd26 SHA1 de68cbb0fcbffeccd23a1cb2e31d0586c56929e4 SHA256 cb39e00d0ef79e3870af4743e3a8bb9411b69822d49c6959b27b9ac4ee00be71 +MISC ChangeLog 7143 RMD160 59aa363d42fa7e0ae5d9ef3597f809e8faa3d889 SHA1 63bf5ca43469aed7253086443928afbf22926afc SHA256 30f1e666bc6f6b4eb58a11b6e74fb3bc22d6fdff2fac5d222bad15ea67bafe78 MISC metadata.xml 653 RMD160 d6139a7ce3a5dab18f33c7f111f2e7827c290723 SHA1 47ba631625b4f2b20e491a964e65c78dd236f6f2 SHA256 35f64761067f47ff7abd0e3f3cb57f4bab888a2546bf3267d59987505101a190 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) -iEYEARECAAYFAk6fDjcACgkQAiZjviIA2XgyzACgo3eKX66/mj/RnkAzRu6n31Qq -BrQAn1u/bkp9r/T4Sv6GmpvguKqg2OYE -=6IQg +iEYEARECAAYFAk9tFWwACgkQAiZjviIA2XjlHwCeLqL7vLAZzAIL2V4eo0OTqsjW +SoAAn1uX/32mhRk0fH+HnOVlq8Hv/rgQ +=vMhx -----END PGP SIGNATURE----- diff --git a/app-emulation/lxc/files/lxc.initd.2 b/app-emulation/lxc/files/lxc.initd.2 new file mode 100644 index 000000000000..fb4edc62c340 --- /dev/null +++ b/app-emulation/lxc/files/lxc.initd.2 @@ -0,0 +1,119 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.1 2012/03/24 00:29:00 flameeyes Exp $ + +CONTAINER=${SVCNAME#*.} + +lxc_get_configfile() { + if [ -f "/etc/lxc/${CONTAINER}.conf" ]; then + echo "/etc/lxc/${CONTAINER}.conf" + elif [ -f "/etc/lxc/${CONTAINER}/config" ]; then + echo "/etc/lxc/${CONTAINER}/config" + else + eerror "Unable to find a suitable configuration file." + eerror "If you set up the contianer in a non-standard" + eerror "location, please set the CONFIGFILE variable." + return 1 + fi +} + +[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)} + +lxc_get_var() { + awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE} +} + +checkconfig() { + if [ ${CONTAINER} = ${SVCNAME} ]; then + eerror "You have to create an init script for each container:" + eerror " ln -s lxc /etc/init.d/lxc.container" + return 1 + fi + + # no need to output anything, the function takes care of that. + [ -z "${CONFIGFILE}" ] && return 1 + + utsname=$(lxc_get_var lxc.utsname) + if [ ${CONTAINER} != ${utsname} ]; then + eerror "You should use the same name for the service and the" + eerror "container. Right now the container is called ${utsname}" + return 1 + fi +} + +depend() { + # be quiet, since we have to run depend() also for the + # non-muxed init script, unfortunately. + checkconfig 2>/dev/null || return 0 + + config ${CONFIGFILE} + need localmount + + # find out which network interface the container is linked to, + # and then require that to be enabled, so that the + # dependencies are correct. + netif=$(lxc_get_var lxc.network.link) + [ -n "${netif}" ] && use net.${netif} +} + +start() { + checkconfig || return 1 + rm /var/log/lxc/${CONTAINER}.log + + rootpath=$(lxc_get_var lxc.rootfs) + + # Check the format of our init and the chroot's init, to see if we + # have to use linux32 or linux64... + case $(scanelf -BF '%M#f' /sbin/init ${rootpath}/sbin/init | tr '\n' ':') in + ELFCLASS64:ELFCLASS64:) setarch=;; + ELFCLASS32:ELFCLASS32:) setarch=;; + ELFCLASS32:ELFCLASS64:) setarch=linux64;; + ELFCLASS64:ELFCLASS32:) setarch=linux32;; + esac + + ebegin "Starting ${CONTAINER}" + env -i ${setarch} $(type -p lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log + sleep 0.5 + + # lxc-start -d will _always_ report a correct startup, even if it + # failed, so rather than trust that, check that the cgroup exists. + [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ] + eend $? +} + +stop() { + checkconfig || return 1 + + + if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then + ewarn "${CONTAINER} doesn't seem to be started." + return 0 + fi + + init_pid=$(lxc-info -n ${CONTAINER} --pid | cut -d: -f 2) + + if [ "${init_pid}" = "-1" ]; then + ewarn "${CONTAINER} doesn't seem to be running." + return 0 + fi + + ebegin "Shutting down system in ${CONTAINER}" + kill -INT ${init_pid} + eend $? + + TIMEOUT=${TIMEOUT:-30} + i=0 + while [ -n "$(pgrep -P ${init_pid})" -a $i -lt ${TIMEOUT} ]; do + sleep 1 + i=$(expr $i + 1) + done + + if [ -n "${missingprocs}" ]; then + ewarn "Something failed to properly shut down in ${CONTAINER}" + fi + + ebegin "Stopping ${CONTAINER}" + lxc-stop -n ${CONTAINER} + eend $? +} diff --git a/app-emulation/lxc/lxc-0.8.0_rc1.ebuild b/app-emulation/lxc/lxc-0.8.0_rc1.ebuild new file mode 100644 index 000000000000..08dc87e50652 --- /dev/null +++ b/app-emulation/lxc/lxc-0.8.0_rc1.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/lxc-0.8.0_rc1.ebuild,v 1.1 2012/03/24 00:29:00 flameeyes Exp $ + +EAPI="4" + +MY_P="${P/_/-}" + +inherit eutils linux-info versionator flag-o-matic + +DESCRIPTION="LinuX Containers userspace utilities" +HOMEPAGE="http://lxc.sourceforge.net/" +SRC_URI="http://lxc.sourceforge.net/download/lxc/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +KEYWORDS="~amd64 ~ppc64 ~x86" + +LICENSE="LGPL-3" +SLOT="0" +IUSE="examples vanilla" + +RDEPEND="sys-libs/libcap" + +DEPEND="${RDEPEND} + app-text/docbook-sgml-utils + >=sys-kernel/linux-headers-2.6.29" + +# For init script, so protect with vanilla, they are not strictly +# needed. +RDEPEND="${RDEPEND} + vanilla? ( + sys-apps/util-linux + app-misc/pax-utils + )" + +CONFIG_CHECK="~CGROUPS + ~CPUSETS ~CGROUP_CPUACCT + ~RESOURCE_COUNTERS ~CGROUP_MEM_RES_CTLR + ~CGROUP_SCHED + + ~NAMESPACES + ~IPC_NS ~USER_NS ~PID_NS + + ~DEVPTS_MULTIPLE_INSTANCES + ~CGROUP_FREEZER + ~UTS_NS ~NET_NS + ~VETH ~MACVLAN + + ~POSIX_MQUEUE + ~!NETPRIO_CGROUP" + +ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container" + +ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers" + +ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info" +ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network" + +ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking" +ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking" + +ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command" + +ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting." + +DOCS=(AUTHORS CONTRIBUTING MAINTAINERS TODO README doc/FAQ.txt) + +src_configure() { + append-flags -fno-strict-aliasing + + econf \ + --localstatedir=/var \ + --bindir=/usr/sbin \ + --docdir=/usr/share/doc/${PF} \ + --with-config-path=/etc/lxc \ + --with-rootfs-path=/usr/lib/lxc/rootfs \ + --with-linuxdir="${KERNEL_DIR}" \ + --enable-doc \ + $(use_enable examples) +} + +src_install() { + default + + rm -r "${D}"/usr/sbin/lxc-{setcap,ls} \ + "${D}"/usr/share/man/man1/lxc-ls.1 \ + || die "unable to remove extraenous content" + + keepdir /etc/lxc /usr/lib/lxc/rootfs + + find "${D}" -name '*.la' -delete + + use vanilla && return 0 + + # Gentoo-specific additions! + newinitd "${FILESDIR}/${PN}.initd.2" ${PN} + keepdir /var/log/lxc +} + +pkg_postinst() { + if ! use vanilla; then + elog "There is an init script provided with the package now; no documentation" + elog "is currently available though, so please check out /etc/init.d/lxc ." + elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname" + elog "to start the container defined into /etc/lxc/configname.conf ." + elog "For further information about LXC development see" + elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available + elog "" + fi + ewarn "With version 0.7.4, the mountpoint syntax came back to the one used by 0.7.2" + ewarn "and previous versions. This means you'll have to use syntax like the following" + ewarn "" + ewarn " lxc.rootfs = /container" + ewarn " lxc.mount.entry = /usr/portage /container/usr/portage none bind 0 0" + ewarn "" + ewarn "To use the Fedora, Debian and (various) Ubuntu auto-configuration scripts, you" + ewarn "will need sys-apps/yum or dev-util/debootstrap." +} |