mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-26 21:00:30 +00:00
syz-ci: fix seeds copying
1. Copy seeds from syzkaller checkout into syzkaller build dir. They need to be stable. 2. Make the code generic (current is linux-specific). 3. Don't copy seeds to workdir/seeds. We can load them directly from sys/OS/test. There are some unresolved comments for LinkDir on #2053 anyway. Follow up to #2053
This commit is contained in:
parent
bf14d79b03
commit
605d25b511
@ -235,21 +235,6 @@ func LinkFiles(srcDir, dstDir string, files map[string]bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// LinkDir creates soft links from dstDir to srcDir.
|
||||
// All other files in dstDir are removed.
|
||||
func LinkDir(srcDir, dstDir string) error {
|
||||
if err := os.RemoveAll(dstDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := MkdirAll(dstDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Symlink(srcDir, dstDir); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func MkdirAll(dir string) error {
|
||||
return os.MkdirAll(dir, DefaultDirPerm)
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ type Manager struct {
|
||||
stop chan struct{}
|
||||
}
|
||||
|
||||
func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{}, syzLinuxTestDir string) (*Manager, error) {
|
||||
func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{}) (*Manager, error) {
|
||||
dir := osutil.Abs(filepath.Join("managers", mgrcfg.Name))
|
||||
if err := osutil.MkdirAll(dir); err != nil {
|
||||
log.Fatal(err)
|
||||
@ -127,11 +127,6 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{}, syzLi
|
||||
stop: stop,
|
||||
}
|
||||
|
||||
// Copy test files into the current manager workdir.
|
||||
if err := osutil.LinkDir(syzLinuxTestDir, filepath.Join(dir, "workdir", "seeds")); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
os.RemoveAll(mgr.currentDir)
|
||||
return mgr, nil
|
||||
}
|
||||
|
@ -170,10 +170,9 @@ func main() {
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
syzLinuxTestDir := filepath.Join(updater.syzkallerDir, "sys", "linux", "test")
|
||||
var managers []*Manager
|
||||
for _, mgrcfg := range cfg.Managers {
|
||||
mgr, err := createManager(cfg, mgrcfg, stop, syzLinuxTestDir)
|
||||
mgr, err := createManager(cfg, mgrcfg, stop)
|
||||
if err != nil {
|
||||
log.Logf(0, "failed to create manager %v: %v", mgrcfg.Name, err)
|
||||
continue
|
||||
|
@ -72,6 +72,7 @@ func NewSyzUpdater(cfg *Config) *SyzUpdater {
|
||||
"tag": true, // contains syzkaller repo git hash
|
||||
"bin/syz-ci": true, // these are just copied from syzkaller dir
|
||||
"bin/syz-manager": true,
|
||||
"sys/*/test/*": true,
|
||||
}
|
||||
targets := make(map[string]bool)
|
||||
for _, mgr := range cfg.Managers {
|
||||
|
Loading…
Reference in New Issue
Block a user