From 7f1628e52a51160e3e9000e70aca59933d39fd8a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 27 Nov 2020 19:09:26 +0100 Subject: tools/syz-kconf: support non-make shell --- tools/syz-kconf/kconf.go | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/syz-kconf/kconf.go b/tools/syz-kconf/kconf.go index 00134e30b..20430f1e4 100644 --- a/tools/syz-kconf/kconf.go +++ b/tools/syz-kconf/kconf.go @@ -31,6 +31,7 @@ const ( featBaseline = "baseline" featClang = "clang" featAndroid = "android" + featChromeos = "chromeos" ) func main() { @@ -204,10 +205,16 @@ func (ctx *Context) executeShell() error { continue } args := strings.Split(shell.Cmd, " ") - if args[0] != "make" { - return fmt.Errorf("non-make shell is not supported yet") + for i := 1; i < len(args); i++ { + args[i] = strings.ReplaceAll(args[i], "${BUILDDIR}", ctx.BuildDir) } - if err := ctx.Make(args[1:]...); err != nil { + if args[0] == "make" { + if err := ctx.Make(args[1:]...); err != nil { + return err + } + continue + } + if _, err := osutil.RunCmd(10*time.Minute, ctx.SourceDir, args[0], args[1:]...); err != nil { return err } } @@ -254,11 +261,14 @@ func (ctx *Context) verifyConfigs(cf *kconfig.ConfigFile) error { } func (ctx *Context) addUSBConfigs(cf *kconfig.ConfigFile) error { - android := "" - if ctx.Inst.Features[featAndroid] { - android = "android" - } - distroConfig := filepath.Join(ctx.ConfigDir, "distros", android+"*") + prefix := "" + switch { + case ctx.Inst.Features[featAndroid]: + prefix = "android" + case ctx.Inst.Features[featChromeos]: + prefix = "chromeos" + } + distroConfig := filepath.Join(ctx.ConfigDir, "distros", prefix+"*") // Some USB drivers don't depend on any USB related symbols, but rather on a generic symbol // for some input subsystem (e.g. HID), so include it as well. return ctx.addDependentConfigs(cf, []string{"USB_SUPPORT", "HID"}, distroConfig) -- cgit mrf-deployment