From 870beaf137d6afb674bbd1743eaa8a761dd54511 Mon Sep 17 00:00:00 2001 From: Anders F Björklund Date: Sun, 28 Mar 2021 10:27:57 +0200 Subject: Add machine support for qemu-system-aarch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Build machine also for podman-linux-arm64 - Add default machine type for linux arm64 - Add the required qemu-uefi bios parameter - Remove hardcoded outdated path and show url Signed-off-by: Anders F Björklund --- pkg/machine/qemu/options_linux_arm64.go | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pkg/machine/qemu/options_linux_arm64.go (limited to 'pkg/machine/qemu') diff --git a/pkg/machine/qemu/options_linux_arm64.go b/pkg/machine/qemu/options_linux_arm64.go new file mode 100644 index 000000000..948117653 --- /dev/null +++ b/pkg/machine/qemu/options_linux_arm64.go @@ -0,0 +1,41 @@ +package qemu + +import ( + "os" + "path/filepath" +) + +var ( + QemuCommand = "qemu-system-aarch64" +) + +func (v *MachineVM) addArchOptions() []string { + opts := []string{ + "-accel", "kvm", + "-cpu", "host", + "-M", "virt,gic-version=max", + "-bios", getQemuUefiFile("QEMU_EFI.fd"), + } + return opts +} + +func (v *MachineVM) prepare() error { + return nil +} + +func (v *MachineVM) archRemovalFiles() []string { + return []string{} +} + +func getQemuUefiFile(name string) string { + dirs := []string{ + "/usr/share/qemu-efi-aarch64", + "/usr/share/edk2/aarch64", + } + for _, dir := range dirs { + if _, err := os.Stat(dir); err == nil { + return filepath.Join(dir, name) + } + } + return name +} -- cgit v1.2.3-54-g00ecf