pkg/build: support Linux s390x

Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
This commit is contained in:
Alexander Egorenkov 2020-09-08 16:17:22 +02:00 committed by Dmitry Vyukov
parent abf9ba4fc7
commit a86a864df5
2 changed files with 4 additions and 1 deletions

View File

@ -120,6 +120,7 @@ func getBuilder(targetOS, targetArch, vmType string) (builder, error) {
{"linux", "amd64", []string{"gvisor"}, gvisor{}},
{"linux", "amd64", []string{"gce", "qemu"}, linux{}},
{"linux", "ppc64le", []string{"qemu"}, linux{}},
{"linux", "s390x", []string{"qemu"}, linux{}},
{"fuchsia", "amd64", []string{"qemu"}, fuchsia{}},
{"fuchsia", "arm64", []string{"qemu"}, fuchsia{}},
{"akaros", "amd64", []string{"qemu"}, akaros{}},

View File

@ -64,7 +64,7 @@ func (linux) buildKernel(params *Params) error {
// We build only zImage/bzImage as we currently don't use modules.
var target string
switch params.TargetArch {
case "386", "amd64":
case "386", "amd64", "s390x":
target = "bzImage"
case "ppc64le":
target = "zImage"
@ -97,6 +97,8 @@ func (linux) createImage(params *Params) error {
kernelImage = "arch/x86/boot/bzImage"
case "ppc64le":
kernelImage = "arch/powerpc/boot/zImage.pseries"
case "s390x":
kernelImage = "arch/s390/boot/bzImage"
}
kernelImagePath := filepath.Join(params.KernelDir, filepath.FromSlash(kernelImage))
cmd := osutil.Command(scriptFile, params.UserspaceDir, kernelImagePath, params.TargetArch)