diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-02-13 12:12:44 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-02-13 15:58:42 +0100 |
| commit | f16dce862ba8b48c3148dcff51d89aec0a6b3c8f (patch) | |
| tree | c7fbc2753517d86a8cfd70b7d1a8ce733fcc0162 | |
| parent | 22f84b5e5691e13679b10ae18792e9547f093c68 (diff) | |
vm/qemu: fix default flags for arm/arm64
The console and root that we use are specific for 386/amd64.
arm/arm64 usually use a different console and root device.
Use separate settings for 386/amd64 and arm/arm64.
| -rw-r--r-- | vm/qemu/qemu.go | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index b10668080..2e36edc07 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -85,6 +85,8 @@ var archConfigs = map[string]*archConfig{ // But other arches don't use e1000e, e.g. arm64 uses virtio by default. NicModel: ",model=e1000", CmdLine: append(linuxCmdline, + "root=/dev/sda", + "console=ttyS0", "kvm-intel.nested=1", "kvm-intel.unrestricted_guest=1", "kvm-intel.vmm_exclusive=1", @@ -103,18 +105,27 @@ var archConfigs = map[string]*archConfig{ Qemu: "qemu-system-i386", TargetDir: "/", NicModel: ",model=e1000", - CmdLine: linuxCmdline, + CmdLine: append(linuxCmdline, + "root=/dev/sda", + "console=ttyS0", + ), }, "linux/arm64": { Qemu: "qemu-system-aarch64", - QemuArgs: "-machine virt -cpu cortex-a57", + QemuArgs: "-machine virt,virtualization=on -cpu cortex-a57", TargetDir: "/", - CmdLine: linuxCmdline, + CmdLine: append(linuxCmdline, + "root=/dev/vda", + "console=ttyAMA0", + ), }, "linux/arm": { Qemu: "qemu-system-arm", TargetDir: "/", - CmdLine: linuxCmdline, + CmdLine: append(linuxCmdline, + "root=/dev/vda", + "console=ttyAMA0", + ), }, "linux/ppc64le": { Qemu: "qemu-system-ppc64", @@ -154,7 +165,6 @@ var archConfigs = map[string]*archConfig{ } var linuxCmdline = []string{ - "console=ttyS0", "earlyprintk=serial", "oops=panic", "nmi_watchdog=panic", @@ -343,8 +353,6 @@ func (inst *instance) Boot() error { "rootflags=trans=virtio,version=9p2000.L,cache=loose", "init="+filepath.Join(inst.workdir, "init.sh"), ) - } else { - cmdline = append(cmdline, "root=/dev/sda") } cmdline = append(cmdline, inst.cfg.Cmdline) args = append(args, |
