mirror of
https://github.com/containers/podman.git
synced 2025-09-17 06:47:10 +08:00
Merge pull request #9846 from afbjorklund/qemu-arm64
[NO TESTS NEEDED] Add machine support for qemu-system-aarch64 on linux
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build !amd64 arm64,linux amd64,windows
|
||||
// +build !amd64 amd64,windows
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build amd64,linux amd64,darwin arm64,darwin
|
||||
// +build amd64,linux arm64,linux amd64,darwin arm64,darwin
|
||||
|
||||
package machine
|
||||
|
||||
|
@ -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
|
||||
|
@ -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(), "/")
|
||||
|
41
pkg/machine/qemu/options_linux_arm64.go
Normal file
41
pkg/machine/qemu/options_linux_arm64.go
Normal file
@ -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
|
||||
}
|
Reference in New Issue
Block a user