[lxc-devel] [PATCH] Enable support for chroot on busybox hosts

Serge Hallyn serge.hallyn at ubuntu.com
Tue Apr 9 13:12:19 UTC 2013


Quoting Bogdan Purcareata (bogdan.purcareata at freescale.com):
> Signed-off-by: Bogdan Purcareata <bogdan.purcareata at freescale.com>

We generally prefer that mounting be done in a fresh namespace
(lxc-unsahre -s MOUNT -- actions).  If lxc-busybox were switched to be
'set -e', it could leave lingering mounts (and we might not notice
this still being done).

Do you mind changing it to do that?

> ---
>  templates/lxc-busybox.in | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
> index cb425ec..450c5a5 100644
> --- a/templates/lxc-busybox.in
> +++ b/templates/lxc-busybox.in
> @@ -189,8 +189,11 @@ configure_busybox()
>      # passwd exec must be setuid
>      chmod +s $rootfs/bin/passwd
>      touch $rootfs/etc/shadow
> +
>      echo "setting root passwd to root"
> +    mount --bind /lib $rootfs/lib
>      echo "root:root" | chroot $rootfs chpasswd
> +    umount $rootfs/lib
>  
>  
>      # add ssh functionality if dropbear package available on host
> -- 
> 1.7.11.7
> 
> 
> 
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list