[lxc-devel] lxc + gento + qemu, almost there

Stéphane Graber stgraber at ubuntu.com
Wed Mar 11 15:15:36 UTC 2015


On Wed, Mar 11, 2015 at 03:02:32PM +0000, Joakim Tjernlund wrote:
> >On Thu, Mar 05, 2015 at 02:28:42PM +0000, Joakim Tjernlund wrote: > I am running a gentoo ppc stage3 on lxc 
> amd64.
> >> 
> >> All I needed to do for this to boot was:
> >> Add to gentoo template 
> >> chroot()
> >> {
> >>     rr=$1
> >> 
> >>     shift 1
> >>     proot -w / -r "${rr}" -q qemu-ppc "$@"
> >> }
> >> 
> >> ppc-qemu.conf:
> >>  lxc.network.type = veth
> >>  lxc.network.link = virbr0
> >>  lxc.network.flags = up
> >>  #for user emulation of PPC arch
> >>  lxc.mount.entry=/usr/bin/qemu-ppc usr/bin/qemu-ppc none ro,bind,optional 0 0
> >> 
> >> 
> >> lxc-create -n cusfpv3 -t gentoo  -f /etc/lxc/ppc-qemu.conf -- -a ppc -v ppc
> >> 
> >> touch /var/lib/lxc/cusfpv3/rootfs/usr/bin/qemu-ppc # create a handle for bind mount
> >
> >You can avoid that by passing create=file as a mount option in lxc.mount.entry
> 
> Nice! one less special thing to do :)
> 
> However to remove the chroot() -> proot hack one need to create this file much
> earlier during lxc-create (and bind mount qemu-ppc so all the chroot stuff inside
> the gentoo template script can execute(or replace the chroot with something else)
> Anything you can consider?
> 
>  Jocke
> 
> PS: Please CC me as I am not on the list.

Ah yeah, I guess it's reasonable for the runtime config, but the
template scripts aren't running in a container so you'll still need your
proot trick for that.

Note that since proot isn't available in quite a few distros (or not
supported in some others), it'd be good to have this be conditional to
proot being available (or if it's reasonably easy, see the ubuntu
template for example, not use it at all).

> 
> >
> >> 
> >> lxc-start -n cusfpv3
> >> 
> >> Could this be added to the template? 
> >> Obviously some rework is needed, but I suck at shell programming :( > 
> >> the new chroot() function should be replaced with a bind mount of /usr/bin/qemu-ppc in ${rootfs}
> >> 
> >>  Jocke

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150311/2c14241b/attachment.sig>


More information about the lxc-devel mailing list