include riscv64 in target architectures

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2025-01-08 10:15:32 +02:00
parent 18e7eea86f
commit c1ba0bf160
4 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import (
// If remoteName is empty, it is the same as name.
// If withArchSpecificTags is true, it will push all arch-specific images in the index, each as
// their own tag with the same name as the index, but with the architecture appended, e.g.
// image:foo will have image:foo-amd64, image:foo-arm64, etc.
// image:foo will have image:foo-amd64, image:foo-arm64, image:foo-riscv64, etc.
func (p *Provider) Push(name, remoteName string, withArchSpecificTags, override bool) error {
var (
err error

View File

@ -60,7 +60,7 @@ type PkglibConfig struct {
func NewPkgInfo() pkgInfo {
return pkgInfo{
Org: "linuxkit",
Arches: []string{"amd64", "arm64"},
Arches: []string{"amd64", "arm64", "riscv64"},
Tag: "{{.Hash}}",
GitRepo: "https://github.com/linuxkit/linuxkit",
Network: false,

View File

@ -70,6 +70,8 @@ func init() {
defaultArch = "x86_64"
case "s390x":
defaultArch = "s390x"
case "riscv64":
defaultArch = "riscv64"
}
switch {
case runtime.GOARCH == "s390x":
@ -475,6 +477,8 @@ func buildQemuCmdline(config QemuConfig) (QemuConfig, []string) {
goArch = "arm64"
case "x86_64":
goArch = "amd64"
case "riscv64":
goArch = "riscv64"
default:
log.Fatalf("%s is an unsupported architecture.", config.Arch)
}

View File

@ -20,6 +20,8 @@ func GoArch(in string) (string, error) {
return "amd64", nil
case "aarch64", "arm64":
return "arm64", nil
case "riscv64":
return "riscv64", nil
}
return "", fmt.Errorf("unknown arch %q", in)
}