From 3ef5f27e49f6ce3b268111337642cb02f1ff924a Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Fri, 14 Jul 2017 09:10:42 +0000 Subject: [PATCH] ARM64: specify external firware binary for containerized qemu Current implementation uses a fixed firmware(bios) binary installed by the build process of the qemu container image, which will prevent us from providing an external firmware binary outside the container. This patch removes this limitation, thus we can assign a firware binary image file with "-fw" option. Signed-off-by: Dennis Chen --- src/cmd/linuxkit/run_qemu.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cmd/linuxkit/run_qemu.go b/src/cmd/linuxkit/run_qemu.go index 176feb922..210faa630 100644 --- a/src/cmd/linuxkit/run_qemu.go +++ b/src/cmd/linuxkit/run_qemu.go @@ -302,6 +302,13 @@ func runQemuContainer(config QemuConfig) error { var args []string config, args = buildQemuCmdline(config) + // if user specify the "-fw" parameter, this should override the default in container context, + // with "-v" option, we will have the chance to assign an external FW binary to the containerized qemu + // instead of the fixed FW bin instealled by the build process of the image. + if config.UEFI { + binds = append(binds, "-v", fmt.Sprintf("%[1]s:%[1]s", config.FWPath)) + } + dockerArgs := append([]string{"run", "--interactive", "--rm", "-w", cwd}, binds...) dockerArgsImg := append([]string{"run", "--rm", "-w", cwd}, binds...)