diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-07-07 08:36:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-07 08:36:32 +0200 |
| commit | 9b7b5cffbe1ca399cc106b0a8a248da86694852d (patch) | |
| tree | 6beddc58da8f147a5c187944a5db69cdcab33c82 | |
| parent | 4782c2b8e6d9cf4c75612c444760060d0a103da3 (diff) | |
| parent | 7156b5c3c72faca2ef2b101df6f6a9685e9f0f0c (diff) | |
Merge pull request #49 from bittorrent3389/for_submit
Add initrd qemu flag.
| -rw-r--r-- | AUTHORS | 2 | ||||
| -rw-r--r-- | CONTRIBUTORS | 1 | ||||
| -rw-r--r-- | config/config.go | 2 | ||||
| -rw-r--r-- | syz-manager/example.cfg | 1 | ||||
| -rw-r--r-- | vm/qemu/qemu.go | 5 | ||||
| -rw-r--r-- | vm/vm.go | 1 |
6 files changed, 12 insertions, 0 deletions
@@ -8,3 +8,5 @@ Google Inc. Baozeng Ding Lorenzo Stoakes + +Jeremy Huang diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c48c9101d..572e21026 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -9,3 +9,4 @@ Google Inc. David Drysdale Baozeng Ding Lorenzo Stoakes +Jeremy Huang diff --git a/config/config.go b/config/config.go index ce5b8553b..ccd3df615 100644 --- a/config/config.go +++ b/config/config.go @@ -24,6 +24,7 @@ type Config struct { Kernel string // e.g. arch/x86/boot/bzImage Cmdline string // kernel command line Image string // linux image for VMs + Initrd string // linux initial ramdisk. (optional) Cpu int // number of VM CPUs Mem int // amount of VM memory in MBs Sshkey string // root ssh key for the image @@ -218,6 +219,7 @@ func CreateVMConfig(cfg *Config) (*vm.Config, error) { Kernel: cfg.Kernel, Cmdline: cfg.Cmdline, Image: cfg.Image, + Initrd: cfg.Initrd, Sshkey: cfg.Sshkey, Executor: filepath.Join(cfg.Syzkaller, "bin", "syz-executor"), ConsoleDev: cfg.ConsoleDev, diff --git a/syz-manager/example.cfg b/syz-manager/example.cfg index cae69d826..c5142856f 100644 --- a/syz-manager/example.cfg +++ b/syz-manager/example.cfg @@ -2,6 +2,7 @@ "http": "myhost.com:56741", "workdir": "/syzkaller/workdir", "kernel": "/linux/arch/x86/boot/bzImage", + "initrd": "linux/initrd", "vmlinux": "/linux/vmlinux", "image": "/linux_image/wheezy.img", "sshkey": "/linux_image/ssh/id_rsa", diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index ab669b9b1..444e556ca 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -143,6 +143,11 @@ func (inst *instance) Boot() error { "-usb", "-usbdevice", "mouse", "-usbdevice", "tablet", "-soundhw", "all", } + if inst.cfg.Initrd != "" { + args = append(args, + "-initrd", inst.cfg.Initrd, + ) + } if inst.cfg.Kernel != "" { args = append(args, "-kernel", inst.cfg.Kernel, @@ -33,6 +33,7 @@ type Config struct { Index int Workdir string Bin string + Initrd string Kernel string Cmdline string Image string |
