]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-busybox: Use relative mounts in lxc.mount.entry
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 12 Sep 2012 19:22:15 +0000 (15:22 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 25 Oct 2012 08:34:45 +0000 (10:34 +0200)
To make it easier to clone/rename the container, replace hardcoded
entries (with rootfs in the destination path) by rootfs-relative entries.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-busybox.in

index 3cab7e7e25805561e5bbb207f249f868bebfb1e4..06d2f8916ffc8f343959fe2f515de85ec531be90 100644 (file)
@@ -239,14 +239,14 @@ lxc.rootfs = $rootfs
 EOF
 
     libdirs="\
-        /lib \
-        /usr/lib \
-        /lib64 \
-        /usr/lib64"
+        lib \
+        usr/lib \
+        lib64 \
+        usr/lib64"
 
     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
+        if [ -d "/$dir" ] && [ -d "$rootfs/$dir" ]; then
+            echo "lxc.mount.entry=/$dir $dir none ro,bind 0 0" >> $path/config
         fi
     done
 }