aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract
diff options
context:
space:
mode:
authorPatrick Meyer <meyerpatrick@google.com>2021-05-15 17:38:03 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-05-20 13:29:54 +0200
commit5681e9317b1f70c3cc1fba432eb138c183b8bdd1 (patch)
tree15b0ea3d2c92d966b0889810e423d93e79bc99f0 /sys/syz-extract
parentac040bb3def51ecf81966d7801521b5a59fac0db (diff)
sys/syz-extract: move SOURCEDIR check to caller
Diffstat (limited to 'sys/syz-extract')
-rw-r--r--sys/syz-extract/akaros.go4
-rw-r--r--sys/syz-extract/darwin.go3
-rw-r--r--sys/syz-extract/extract.go4
-rw-r--r--sys/syz-extract/freebsd.go3
-rw-r--r--sys/syz-extract/fuchsia.go4
-rw-r--r--sys/syz-extract/linux.go3
-rw-r--r--sys/syz-extract/netbsd.go3
-rw-r--r--sys/syz-extract/openbsd.go3
-rw-r--r--sys/syz-extract/trusty.go4
9 files changed, 4 insertions, 27 deletions
diff --git a/sys/syz-extract/akaros.go b/sys/syz-extract/akaros.go
index 368f77f87..2c6bee2d1 100644
--- a/sys/syz-extract/akaros.go
+++ b/sys/syz-extract/akaros.go
@@ -4,7 +4,6 @@
package main
import (
- "fmt"
"path/filepath"
"strings"
@@ -14,9 +13,6 @@ import (
type akaros struct{}
func (*akaros) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
return nil
}
diff --git a/sys/syz-extract/darwin.go b/sys/syz-extract/darwin.go
index c6d694696..8f2267f04 100644
--- a/sys/syz-extract/darwin.go
+++ b/sys/syz-extract/darwin.go
@@ -14,9 +14,6 @@ import (
type darwin struct{}
func (*darwin) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
return nil
}
diff --git a/sys/syz-extract/extract.go b/sys/syz-extract/extract.go
index 24ea5f725..79eaccc9c 100644
--- a/sys/syz-extract/extract.go
+++ b/sys/syz-extract/extract.go
@@ -89,6 +89,10 @@ func main() {
if err != nil {
tool.Fail(err)
}
+ if *flagSourceDir == "" {
+ tool.Fail(fmt.Errorf("provide path to kernel checkout via -sourcedir " +
+ "flag (or make extract SOURCEDIR)"))
+ }
if err := extractor.prepare(*flagSourceDir, *flagBuild, arches); err != nil {
tool.Fail(err)
}
diff --git a/sys/syz-extract/freebsd.go b/sys/syz-extract/freebsd.go
index f1537e2a0..708d0baa0 100644
--- a/sys/syz-extract/freebsd.go
+++ b/sys/syz-extract/freebsd.go
@@ -15,9 +15,6 @@ import (
type freebsd struct{}
func (*freebsd) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
if !build {
return fmt.Errorf("freebsd requires -build flag")
}
diff --git a/sys/syz-extract/fuchsia.go b/sys/syz-extract/fuchsia.go
index 8e802b5e5..8a473984a 100644
--- a/sys/syz-extract/fuchsia.go
+++ b/sys/syz-extract/fuchsia.go
@@ -4,7 +4,6 @@
package main
import (
- "fmt"
"path/filepath"
"github.com/google/syzkaller/pkg/compiler"
@@ -14,9 +13,6 @@ import (
type fuchsia struct{}
func (*fuchsia) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
return nil
}
diff --git a/sys/syz-extract/linux.go b/sys/syz-extract/linux.go
index c7f1f02e3..e4f8d1bfe 100644
--- a/sys/syz-extract/linux.go
+++ b/sys/syz-extract/linux.go
@@ -19,9 +19,6 @@ import (
type linux struct{}
func (*linux) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
if build {
// Run 'make mrproper', otherwise out-of-tree build fails.
// However, it takes unreasonable amount of time,
diff --git a/sys/syz-extract/netbsd.go b/sys/syz-extract/netbsd.go
index 4f5cf84e8..8f86cd5d5 100644
--- a/sys/syz-extract/netbsd.go
+++ b/sys/syz-extract/netbsd.go
@@ -15,9 +15,6 @@ import (
type netbsd struct{}
func (*netbsd) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
if !build {
return fmt.Errorf("netbsd requires -build flag")
}
diff --git a/sys/syz-extract/openbsd.go b/sys/syz-extract/openbsd.go
index 0e322fb27..5f7036356 100644
--- a/sys/syz-extract/openbsd.go
+++ b/sys/syz-extract/openbsd.go
@@ -15,9 +15,6 @@ import (
type openbsd struct{}
func (*openbsd) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
if !build {
return fmt.Errorf("openbsd requires -build flag")
}
diff --git a/sys/syz-extract/trusty.go b/sys/syz-extract/trusty.go
index 0022d86ff..cb031734a 100644
--- a/sys/syz-extract/trusty.go
+++ b/sys/syz-extract/trusty.go
@@ -4,7 +4,6 @@
package main
import (
- "fmt"
"path/filepath"
"strings"
@@ -14,9 +13,6 @@ import (
type trusty struct{}
func (*trusty) prepare(sourcedir string, build bool, arches []*Arch) error {
- if sourcedir == "" {
- return fmt.Errorf("provide path to kernel checkout via -sourcedir flag (or make extract SOURCEDIR)")
- }
return nil
}