diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-30 00:37:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-30 00:37:36 +0000 |
commit | 4fe1ce154f364932129fb6d53c9dbe5b374ed38d (patch) | |
tree | c0481ca3d8e88535ef2a12463cd73bda722a5a50 | |
parent | b9e064ab84044f3db25e48384a1bd6fe5dc6ecdc (diff) | |
parent | 870beaf137d6afb674bbd1743eaa8a761dd54511 (diff) | |
download | podman-4fe1ce154f364932129fb6d53c9dbe5b374ed38d.tar.gz podman-4fe1ce154f364932129fb6d53c9dbe5b374ed38d.tar.bz2 podman-4fe1ce154f364932129fb6d53c9dbe5b374ed38d.zip |
Merge pull request #9846 from afbjorklund/qemu-arm64
[NO TESTS NEEDED] Add machine support for qemu-system-aarch64 on linux
-rw-r--r-- | cmd/podman/machine/init.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/machine.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/machine_unsupported.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/rm.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/ssh.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/start.go | 2 | ||||
-rw-r--r-- | cmd/podman/machine/stop.go | 2 | ||||
-rw-r--r-- | pkg/machine/fcos_arm64.go | 2 | ||||
-rw-r--r-- | pkg/machine/pull.go | 2 | ||||
-rw-r--r-- | pkg/machine/qemu/options_linux_arm64.go | 41 |
10 files changed, 50 insertions, 9 deletions
diff --git a/cmd/podman/machine/init.go b/cmd/podman/machine/init.go index 05474fd89..61261e008 100644 --- a/cmd/podman/machine/init.go +++ b/cmd/podman/machine/init.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine diff --git a/cmd/podman/machine/machine.go b/cmd/podman/machine/machine.go index ed284ee10..9a2377d12 100644 --- a/cmd/podman/machine/machine.go +++ b/cmd/podman/machine/machine.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine diff --git a/cmd/podman/machine/machine_unsupported.go b/cmd/podman/machine/machine_unsupported.go index cb1636419..3bb44b51f 100644 --- a/cmd/podman/machine/machine_unsupported.go +++ b/cmd/podman/machine/machine_unsupported.go @@ -1,4 +1,4 @@ -// +build !amd64 arm64,linux amd64,windows +// +build !amd64 amd64,windows package machine diff --git a/cmd/podman/machine/rm.go b/cmd/podman/machine/rm.go index cd2cc84f2..002a793a3 100644 --- a/cmd/podman/machine/rm.go +++ b/cmd/podman/machine/rm.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine diff --git a/cmd/podman/machine/ssh.go b/cmd/podman/machine/ssh.go index 879122a14..586c4267d 100644 --- a/cmd/podman/machine/ssh.go +++ b/cmd/podman/machine/ssh.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine diff --git a/cmd/podman/machine/start.go b/cmd/podman/machine/start.go index 80fd77102..40800160e 100644 --- a/cmd/podman/machine/start.go +++ b/cmd/podman/machine/start.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine diff --git a/cmd/podman/machine/stop.go b/cmd/podman/machine/stop.go index 4fcb065a3..7d655f0ba 100644 --- a/cmd/podman/machine/stop.go +++ b/cmd/podman/machine/stop.go @@ -1,4 +1,4 @@ -// +build amd64,linux amd64,darwin arm64,darwin +// +build amd64,linux arm64,linux amd64,darwin arm64,darwin package machine 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 +} |