[lxc-devel] lxc + gento + qemu, almost there
Joakim Tjernlund
joakim.tjernlund at transmode.se
Wed Mar 11 15:02:32 UTC 2015
>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.
>
>>
>> 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
More information about the lxc-devel
mailing list