aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorCameron Finucane <eep@google.com>2022-09-21 12:48:22 -0700
committerChris Palmer <snackypants@gmail.com>2022-10-10 16:02:39 -0700
commit2b253ced7f2f29cbe3de4782c1da91ff9d8a8a8c (patch)
tree7e75ad2c9dea6fe729291d375fcc66fa6d4dd3f5 /docs
parent5bcf0c31a14edd29532df8af88f246446873fe93 (diff)
docs/fuchsia: look up Fuchsia dependency paths dynamically
For context, see fxbug.dev/110060
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/fuchsia/setup.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/docs/fuchsia/setup.sh b/docs/fuchsia/setup.sh
index 053dbc98c..050bd783d 100755
--- a/docs/fuchsia/setup.sh
+++ b/docs/fuchsia/setup.sh
@@ -88,12 +88,22 @@ run() {
preflight "$syzkaller" "$fuchsia"
cd "$fuchsia"
- ./out/x64/host_x64/zbi -o out/x64/fuchsia-ssh.zbi out/x64/fuchsia.zbi \
+
+ # Look up needed deps from build_api metadata
+ fvm_path=$(jq -r '.[] | select(.name == "storage-full" and .type == "blk").path' out/x64/images.json)
+ zbi_path=$(jq -r '.[] | select(.name == "zircon-a" and .type == "zbi").path' out/x64/images.json)
+ multiboot_path=$(jq -r '.[] | select(.name == "qemu-kernel" and .type == "kernel").path' out/x64/images.json)
+
+ # Make a separate directory for copies of files we need to modify
+ syz_deps_path=$fuchsia/out/x64/syzdeps
+ mkdir -p $syz_deps_path
+
+ ./out/x64/host_x64/zbi -o $syz_deps_path/fuchsia-ssh.zbi out/x64/$zbi_path \
--entry "data/ssh/authorized_keys=${fuchsia}/.ssh/authorized_keys"
- cp out/x64/obj/build/images/fuchsia/fuchsia/fvm.blk \
- out/x64/obj/build/images/fuchsia/fuchsia/fvm-extended.blk
+ cp out/x64/$fvm_path \
+ $syz_deps_path/fvm-extended.blk
./out/x64/host_x64/fvm \
- out/x64/obj/build/images/fuchsia/fuchsia/fvm-extended.blk extend --length 3G
+ $syz_deps_path/fvm-extended.blk extend --length 3G
echo "{
\"name\": \"fuchsia\",
@@ -102,7 +112,7 @@ run() {
\"workdir\": \"$workdir\",
\"kernel_obj\": \"$fuchsia/out/x64/kernel_x64-kasan/obj/zircon/kernel\",
\"syzkaller\": \"$syzkaller\",
- \"image\": \"$fuchsia/out/x64/obj/build/images/fuchsia/fuchsia/fvm-extended.blk\",
+ \"image\": \"$syz_deps_path/fvm-extended.blk\",
\"sshkey\": \"$fuchsia/.ssh/pkey\",
\"reproduce\": false,
\"cover\": false,
@@ -112,8 +122,8 @@ run() {
\"count\": 10,
\"cpu\": 4,
\"mem\": 2048,
- \"kernel\": \"$fuchsia/out/x64/multiboot.bin\",
- \"initrd\": \"$fuchsia/out/x64/fuchsia-ssh.zbi\"
+ \"kernel\": \"$fuchsia/out/x64/$multiboot_path\",
+ \"initrd\": \"$syz_deps_path/fuchsia-ssh.zbi\"
}
}" > "$workdir/fx-syz-manager-config.json"