summaryrefslogtreecommitdiffstats
path: root/recipes-tools/lxc/libmounts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-tools/lxc/libmounts.patch')
-rw-r--r--recipes-tools/lxc/libmounts.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-tools/lxc/libmounts.patch b/recipes-tools/lxc/libmounts.patch
new file mode 100644
index 0000000..7e092f1
--- /dev/null
+++ b/recipes-tools/lxc/libmounts.patch
@@ -0,0 +1,48 @@
1From dfef62f0334c65397254215f809a8f25364ea6ef Mon Sep 17 00:00:00 2001
2From: Stuart Yoder <stuart.yoder@freescale.com>
3Date: Wed, 12 Sep 2012 11:05:07 -0500
4Subject: [PATCH] create lib mounts only if the host directories exist
5
6Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
7---
8 templates/lxc-busybox.in | 24 +++++++++++-------------
9 1 file changed, 11 insertions(+), 13 deletions(-)
10
11diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
12index 720ceef..f6cb1ba 100644
13--- a/templates/lxc-busybox.in
14+++ b/templates/lxc-busybox.in
15@@ -235,19 +235,17 @@ lxc.pts = 1
16 lxc.rootfs = $rootfs
17 EOF
18
19-if [ -d "$rootfs/lib" ]; then
20-cat <<EOF >> $path/config
21-lxc.mount.entry=/lib $rootfs/lib none ro,bind 0 0
22-lxc.mount.entry=/usr/lib $rootfs/usr/lib none ro,bind 0 0
23-EOF
24-fi
25-
26-if [ -d "/lib64" ] && [ -d "$rootfs/lib64" ]; then
27-cat <<EOF >> $path/config
28-lxc.mount.entry=/lib64 $rootfs/lib64 none ro,bind 0 0
29-lxc.mount.entry=/usr/lib64 $rootfs/usr/lib64 none ro,bind 0 0
30-EOF
31-fi
32+ libdirs="\
33+ /lib \
34+ /usr/lib \
35+ /lib64 \
36+ /usr/lib64"
37+
38+ for dir in $libdirs; do
39+ if [ -d $dir ]; then
40+ echo "lxc.mount.entry=$dir $rootfs$dir none ro,bind 0 0" >> $path/config
41+ fi
42+ done
43 }
44
45 usage()
46--
471.7.9.7
48