]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-debian: allow to specify a binfmt interpreter 1047/head
authorLaurent Vivier <laurent@vivier.eu>
Mon, 13 Jun 2016 12:34:06 +0000 (14:34 +0200)
committerChristian Brauner <christian.brauner@mailbox.org>
Mon, 13 Jun 2016 20:12:54 +0000 (22:12 +0200)
commitd50cebd6974da307bc4fe8b7e28fbebd204b43ff
tree55370d0b2b6884f65cdf10ee998d29459164ba87
parent56c80e0d4d129e83185cfa014b1b6b9adaea6bc6
lxc-debian: allow to specify a binfmt interpreter

If you specify an interpreter path with "-I" or "--interpreter-path",
the architecture of the debian container can differ from the one of
the host.

Before creating the container, binfmt must be configured on the host:
the script checks the name of the interpreter in /proc/sys/fs/binfmt_misc/
to know where to install it in the container.

To create a MIPS container on an x86_64 host:

$ cat /proc/sys/fs/binfmt_misc/qemu-mips
enabled
interpreter //qemu-mips
flags: OC
offset 0
magic 7f454c4601020100000000000000000000020008
mask ffffffffffffff00fffffffffffffffffffeffff

$ sudo lxc-create -n virtmips-stretch -t debian -- \
                 --arch=mips \
                 --interpreter-path=./mips-linux-user/qemu-mips \
                 --mirror=http://ftp.debian.org/debian \
                 --release=stretch

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
templates/lxc-debian.in