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

Rob Landley rob at landley.net
Tue Apr 16 07:49:30 UTC 2013


On 04/10/2013 05:39:41 AM, Purcareata Bogdan-B43198 wrote:
> Hello,
> 
> Thank you very much for your reply! I'm sorry for sending this in a  
> hurry, and not providing enough explanations. Please find my  
> additional comment inline.
> 
> Thank you,
> Bogdan P.
> 
> > -----Original Message-----
> > From: Serge Hallyn [mailto:serge.hallyn at ubuntu.com]
> > Sent: Tuesday, April 09, 2013 4:12 PM
> > To: Purcareata Bogdan-B43198
> > Cc: lxc-devel at lists.sourceforge.net
> > Subject: Re: [lxc-devel] [PATCH] Enable support for chroot on  
> busybox hosts
> >
> > 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?
> 
> What I am trying to do is install a busybox container on a busybox  
> host.
> 
> When running the template, in order to change the root password, I  
> need to do that chroot. But on my host, the chroot utility is not  
> part of the coreutils package - it's part of busybox. And the busybox  
> implementation for chroot only works if it has /lib in the new root  
> populated with the right executables (or at least that's the solution  
> I found to make it work).
> 
> My patch for this was to temporarily bind-mount /lib in the NEWROOT,  
> chroot there, change the password, go back and unmount. All this is  
> done while installing the template, and the mount should last only  
> while executing the chroot command.
> 
> Is there a better way of achieving this?

Use a statically linked busybox binary?

Rob



More information about the lxc-devel mailing list