From 9e74f8161b8db05365fde0646b0c29c852afc3a0 Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Tue, 14 May 2013 11:54:23 +0300 Subject: [PATCH] lxc-busybox: check when bind-mounting host libdirs The patch changes the busybox template behavior to automatically mount /lib and /usr/lib. In case one of these folders does not exist, starting the container will fail. Also, if there are other lib entries on the host - e.g. /usr/lib64 - mount them as well. Signed-off-by: Bogdan Purcareata --- templates/lxc-busybox.in | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index cb425ec..49effae 100644 --- a/templates/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -240,13 +240,6 @@ lxc.pts = 1 #lxc.aa_profile = unconfined EOF -if [ -d "$rootfs/lib" ]; then -cat <> $path/config -lxc.mount.entry = /lib $rootfs/lib none ro,bind 0 0 -lxc.mount.entry = /usr/lib $rootfs/usr/lib none ro,bind 0 0 -EOF -fi - libdirs="\ lib \ usr/lib \ @@ -255,6 +248,7 @@ fi for dir in $libdirs; do if [ -d "/$dir" ] && [ -d "$rootfs/$dir" ]; then + echo "lxc.mount.entry = /$dir $rootfs/$dir none ro,bind 0 0" >> $path/config echo "lxc.mount.entry = /$dir $dir none ro,bind 0 0" >> $path/config fi done -- 1.7.11.7