aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-11-27 19:09:26 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-11-28 12:57:33 +0100
commit7f1628e52a51160e3e9000e70aca59933d39fd8a (patch)
tree32bc21b6c7234bd42a876d9e3a539bacc99ab72a /tools
parent3c7136c000d478908c0d17b38cf6ae8e2e2164c3 (diff)
tools/syz-kconf: support non-make shell
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-kconf/kconf.go26
1 files changed, 18 insertions, 8 deletions
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)