summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/machine/fcos_arm64.go2
-rw-r--r--pkg/machine/pull.go2
-rw-r--r--pkg/machine/qemu/options_linux_arm64.go41
3 files changed, 43 insertions, 2 deletions
diff --git a/pkg/machine/fcos_arm64.go b/pkg/machine/fcos_arm64.go
index ab50ca874..4d7e4e4db 100644
--- a/pkg/machine/fcos_arm64.go
+++ b/pkg/machine/fcos_arm64.go
@@ -34,7 +34,7 @@ func getFCOSDownload() (*fcosDownloadInfo, error) {
return nil, err
}
return &fcosDownloadInfo{
- Location: "https://fedorapeople.org/groups/fcos-images/builds/latest/aarch64/fedora-coreos-33.20210310.dev.0-qemu.aarch64.qcow2",
+ Location: aarchBaseURL + "/" + meta.BuildArtifacts.Qemu.Path,
Release: "",
Sha256Sum: meta.BuildArtifacts.Qemu.Sha256,
}, nil
diff --git a/pkg/machine/pull.go b/pkg/machine/pull.go
index 39dde15b8..3f54f76ff 100644
--- a/pkg/machine/pull.go
+++ b/pkg/machine/pull.go
@@ -38,7 +38,7 @@ func DownloadVMImage(downloadURL fmt.Stringer, localImagePath string) error {
}()
if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("error downloading VM image: %s", resp.Status)
+ return fmt.Errorf("error downloading VM image %s: %s", downloadURL, resp.Status)
}
size := resp.ContentLength
urlSplit := strings.Split(downloadURL.String(), "/")
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
+}