aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/kernel/kernel.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-07-17 12:36:05 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-07-17 12:39:11 +0200
commitcc1c342923b30616acc9344fe5eade7eb1412850 (patch)
tree10899cc66516fcfc9e63acfa0c64218a5e6bd840 /pkg/kernel/kernel.go
parente489b6cafdd3702f6d14307ae2f2278c3c2f6783 (diff)
syz-ci: allow to specify cmdline/sysctls
Allow to specify per-kernel command line and sysctl values to more closely mimic the target kernel.
Diffstat (limited to 'pkg/kernel/kernel.go')
-rw-r--r--pkg/kernel/kernel.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/kernel/kernel.go b/pkg/kernel/kernel.go
index 208b61815..5b97715b4 100644
--- a/pkg/kernel/kernel.go
+++ b/pkg/kernel/kernel.go
@@ -68,8 +68,10 @@ func build(dir, compiler string) error {
// CreateImage creates a disk image that is suitable for syzkaller.
// Kernel is taken from kernelDir, userspace system is taken from userspaceDir.
+// If cmdlineFile is not empty, contents of the file are appended to the kernel command line.
+// If sysctlFile is not empty, contents of the file are appended to the image /etc/sysctl.conf.
// Produces image and root ssh key in the specified files.
-func CreateImage(kernelDir, userspaceDir, image, sshkey string) error {
+func CreateImage(kernelDir, userspaceDir, cmdlineFile, sysctlFile, image, sshkey string) error {
tempDir, err := ioutil.TempDir("", "syz-build")
if err != nil {
return err