summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Purcareata <bogdan.purcareata@freescale.com>2013-05-14 12:41:26 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-05-15 08:46:09 -0700
commit583002d427aa450abb50adbe1b8c1f266c29ed75 (patch)
treec3c70abf923cf1dbc644f401f2ce0d234ce9f8cc
parent22e7b5e92b33e5fe18723083ce69867749839894 (diff)
downloadmeta-virtualization-583002d427aa450abb50adbe1b8c1f266c29ed75.tar.gz
lxc-busybox: check when bind-mounting host libdirs
The patch checks bind mounting lib directories when starting a busybox container on a 64bit platform. Some entries in the host filesystem are not present but the busybox template expects them to be there, and thus container start fails. Please see further details in added patch description. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch44
-rw-r--r--recipes-containers/lxc/lxc_0.9.0.bb1
2 files changed, 45 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch b/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch
new file mode 100644
index 00000000..4d21a02d
--- /dev/null
+++ b/recipes-containers/lxc/files/lxc-0.9.0-check-when-bind-mounting-libdirs.patch
@@ -0,0 +1,44 @@
1From 9e74f8161b8db05365fde0646b0c29c852afc3a0 Mon Sep 17 00:00:00 2001
2From: Bogdan Purcareata <bogdan.purcareata@freescale.com>
3Date: Tue, 14 May 2013 11:54:23 +0300
4Subject: [PATCH] lxc-busybox: check when bind-mounting host libdirs
5
6The patch changes the busybox template behavior to automatically
7mount /lib and /usr/lib. In case one of these folders does not exist,
8starting the container will fail. Also, if there are other lib entries
9on the host - e.g. /usr/lib64 - mount them as well.
10
11Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
12---
13 templates/lxc-busybox.in | 8 +-------
14 1 file changed, 1 insertion(+), 7 deletions(-)
15
16diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
17index cb425ec..49effae 100644
18--- a/templates/lxc-busybox.in
19+++ b/templates/lxc-busybox.in
20@@ -240,13 +240,6 @@ lxc.pts = 1
21 #lxc.aa_profile = unconfined
22 EOF
23
24-if [ -d "$rootfs/lib" ]; then
25-cat <<EOF >> $path/config
26-lxc.mount.entry = /lib $rootfs/lib none ro,bind 0 0
27-lxc.mount.entry = /usr/lib $rootfs/usr/lib none ro,bind 0 0
28-EOF
29-fi
30-
31 libdirs="\
32 lib \
33 usr/lib \
34@@ -255,6 +248,7 @@ fi
35
36 for dir in $libdirs; do
37 if [ -d "/$dir" ] && [ -d "$rootfs/$dir" ]; then
38+ echo "lxc.mount.entry = /$dir $rootfs/$dir none ro,bind 0 0" >> $path/config
39 echo "lxc.mount.entry = /$dir $dir none ro,bind 0 0" >> $path/config
40 fi
41 done
42--
431.7.11.7
44
diff --git a/recipes-containers/lxc/lxc_0.9.0.bb b/recipes-containers/lxc/lxc_0.9.0.bb
index 63ce2d66..1cbbad04 100644
--- a/recipes-containers/lxc/lxc_0.9.0.bb
+++ b/recipes-containers/lxc/lxc_0.9.0.bb
@@ -24,6 +24,7 @@ RDEPENDS_${PN} = " \
24SRC_URI = "http://lxc.sourceforge.net/download/lxc/${PN}-${PV}.tar.gz \ 24SRC_URI = "http://lxc.sourceforge.net/download/lxc/${PN}-${PV}.tar.gz \
25 file://lxc-0.9.0-disable-udhcp-from-busybox-template.patch \ 25 file://lxc-0.9.0-disable-udhcp-from-busybox-template.patch \
26 file://lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch \ 26 file://lxc-0.9.0-enable-chroot-chpasswd-functionality-for-busybox-hosts.patch \
27 file://lxc-0.9.0-check-when-bind-mounting-libdirs.patch \
27 " 28 "
28SRC_URI[md5sum] = "8552a4479090616f4bc04d8473765fc9" 29SRC_URI[md5sum] = "8552a4479090616f4bc04d8473765fc9"
29SRC_URI[sha256sum] = "1e1767eae6cc5fbf892c0e193d25da420ba19f2db203716c38f7cdea3b654120" 30SRC_URI[sha256sum] = "1e1767eae6cc5fbf892c0e193d25da420ba19f2db203716c38f7cdea3b654120"