All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lxc: create lxc cache directory
@ 2013-07-13 16:11 Mark Asselstine
  2013-07-14  3:07 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Asselstine @ 2013-07-13 16:11 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

Many LXC templates expect the cache directory to exist and use it without
necessarily checking if it exists. Normally the Makefile would create this
directory but since /var/cache is volatile we must use the volatile system to
create this directory at boot, or when the package is installed.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---

If templates are expecting longer term cache they will need to be
modified accordingly since this cache directory will not survive
reboots...

 recipes-containers/lxc/lxc_0.9.0.bb | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/recipes-containers/lxc/lxc_0.9.0.bb b/recipes-containers/lxc/lxc_0.9.0.bb
index 30316bb..563131f 100644
--- a/recipes-containers/lxc/lxc_0.9.0.bb
+++ b/recipes-containers/lxc/lxc_0.9.0.bb
@@ -3,7 +3,7 @@ SECTION = "console/utils"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 PRIORITY = "optional"
-PR = "r2"
+PR = "r3"
 DEPENDS = "libxml2 libcap"
 RDEPENDS_${PN} = " \
 		rsync \
@@ -47,3 +47,19 @@ 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"
+
+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
+
+}
+
+pkg_postinst_${PN}() {
+	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+		/etc/init.d/populate-volatile.sh update
+	fi
+}
-- 
1.7.12



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lxc: create lxc cache directory
  2013-07-13 16:11 [PATCH] lxc: create lxc cache directory Mark Asselstine
@ 2013-07-14  3:07 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2013-07-14  3:07 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: meta-virtualization

On 13-07-13 12:11 PM, Mark Asselstine wrote:
> Many LXC templates expect the cache directory to exist and use it without
> necessarily checking if it exists. Normally the Makefile would create this
> directory but since /var/cache is volatile we must use the volatile system to
> create this directory at boot, or when the package is installed.
>
> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> ---
>
> If templates are expecting longer term cache they will need to be
> modified accordingly since this cache directory will not survive
> reboots...

Fine with me.

Merged.

Bruce

>
>   recipes-containers/lxc/lxc_0.9.0.bb | 18 +++++++++++++++++-
>   1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/recipes-containers/lxc/lxc_0.9.0.bb b/recipes-containers/lxc/lxc_0.9.0.bb
> index 30316bb..563131f 100644
> --- a/recipes-containers/lxc/lxc_0.9.0.bb
> +++ b/recipes-containers/lxc/lxc_0.9.0.bb
> @@ -3,7 +3,7 @@ SECTION = "console/utils"
>   LICENSE = "GPLv2"
>   LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
>   PRIORITY = "optional"
> -PR = "r2"
> +PR = "r3"
>   DEPENDS = "libxml2 libcap"
>   RDEPENDS_${PN} = " \
>   		rsync \
> @@ -47,3 +47,19 @@ 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"
> +
> +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
> +
> +}
> +
> +pkg_postinst_${PN}() {
> +	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
> +		/etc/init.d/populate-volatile.sh update
> +	fi
> +}
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-14  3:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-13 16:11 [PATCH] lxc: create lxc cache directory Mark Asselstine
2013-07-14  3:07 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.