From 2fe31df39f956886ef214b5b028362964aa07a53 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 16 Jul 2021 14:57:55 +0000 Subject: all: capture compiler id during the build process Default compilers are specified in the OS- and platform-dependent logic. It is more convenient to extract info about them during the kernel build itself, rather than during the manager object initialization. Apply the necessary changes throughout the code that is involved in building the kernels and processing information about this process. --- pkg/instance/instance.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/instance/instance.go') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 3e28f2170..70846711f 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -29,7 +29,7 @@ import ( type Env interface { BuildSyzkaller(string, string) error - BuildKernel(string, string, string, string, string, []byte) (string, string, error) + BuildKernel(string, string, string, string, string, []byte) (string, build.ImageDetails, error) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]error, error) } @@ -106,7 +106,7 @@ func (env *env) BuildSyzkaller(repoURL, commit string) error { } func (env *env) BuildKernel(compilerBin, ccacheBin, userspaceDir, cmdlineFile, sysctlFile string, kernelConfig []byte) ( - string, string, error) { + string, build.ImageDetails, error) { imageDir := filepath.Join(env.cfg.Workdir, "image") params := build.Params{ TargetOS: env.cfg.TargetOS, @@ -121,18 +121,18 @@ func (env *env) BuildKernel(compilerBin, ccacheBin, userspaceDir, cmdlineFile, s SysctlFile: sysctlFile, Config: kernelConfig, } - kernelSign, err := build.Image(params) + details, err := build.Image(params) if err != nil { - return "", "", err + return "", details, err } if err := SetConfigImage(env.cfg, imageDir, true); err != nil { - return "", "", err + return "", details, err } kernelConfigFile := filepath.Join(imageDir, "kernel.config") if !osutil.IsExist(kernelConfigFile) { kernelConfigFile = "" } - return kernelConfigFile, kernelSign, nil + return kernelConfigFile, details, nil } func SetConfigImage(cfg *mgrconfig.Config, imageDir string, reliable bool) error { -- cgit mrf-deployment