From c2a623d6448d34158ff2b6a5f50dc371644425b7 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Tue, 9 Aug 2022 08:14:07 -0700 Subject: docs/fuchsia: make --debug optional (#3283) See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=106099. Co-authored-by: Chris Palmer --- docs/fuchsia/setup.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/fuchsia/setup.sh b/docs/fuchsia/setup.sh index fe5eb60e1..32503c8f9 100755 --- a/docs/fuchsia/setup.sh +++ b/docs/fuchsia/setup.sh @@ -12,6 +12,8 @@ IFS=$'\n\t' # TODO: Make the workdir be a parameter. # TODO: Scope locals, pass more things as parameters. +# TODO: This script is getting overgrown enough that it's probably time start +# using Go instead. help="This script will set up, build, and run Syzkaller for Fuchsia. You will need a Syzkaller checkout and a Fuchsia checkout, and you will need a working @@ -31,10 +33,11 @@ Prints this help message. Builds Syzkaller and Fuchsia for x64. - setup.sh run syzkaller-directory fuchsia-directory + setup.sh [-d] run syzkaller-directory fuchsia-directory Runs Syzkaller on the Fuchsia emulator. (You must have built both first, using -\`setup.sh build ...\`.) +\`setup.sh build ...\`.) If you pass the \`-d\` option, \`syz-manager\` will be +run with the \`--debug\` option. setup.sh update syzkaller-directory fuchsia-directory @@ -120,7 +123,7 @@ run() { # also //scripts/hermetic-env and //tools/devshell/lib/prebuilt.sh in # $fuchsia. PATH="$PATH:$fuchsia/prebuilt/third_party/qemu/linux-x64/bin:$fuchsia/prebuilt/third_party/qemu/mac-x64/bin" - bin/syz-manager -config "$workdir/fx-syz-manager-config.json" --debug + bin/syz-manager -config "$workdir/fx-syz-manager-config.json" "$debug" } update_syscall_definitions() { @@ -136,6 +139,15 @@ update_syscall_definitions() { } main() { + debug="" + while getopts "d" o; do + case "$o" in + d) + debug="--debug" + esac + done + shift $((OPTIND - 1)) + if [[ $# != 3 ]]; then usage fi -- cgit mrf-deployment