diff options
author | van Hauser <vh@thc.org> | 2022-07-15 10:12:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 10:12:35 +0200 |
commit | c57988e672634ee98048eba6432cc1f4e377e07c (patch) | |
tree | 1ea5ebbb0b47e8d55b1950e9b787ec9f254655af /nyx_mode | |
parent | 40947508037b874020c8dd1251359fecaab04b9d (diff) | |
parent | b847e0f414e7b310e1a68bc501d4e2453bfce70e (diff) | |
download | afl++-c57988e672634ee98048eba6432cc1f4e377e07c.tar.gz |
Merge pull request #1469 from AFLplusplus/dev
push to stable
Diffstat (limited to 'nyx_mode')
-rwxr-xr-x | nyx_mode/build_nyx_support.sh | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/nyx_mode/build_nyx_support.sh b/nyx_mode/build_nyx_support.sh index 83e0ae32..e7fca64f 100755 --- a/nyx_mode/build_nyx_support.sh +++ b/nyx_mode/build_nyx_support.sh @@ -1,4 +1,7 @@ #!/bin/bash + +set -e + echo "=================================================" echo " Nyx build script" echo "=================================================" @@ -6,14 +9,14 @@ echo echo "[*] Performing basic sanity checks..." -if [ ! "`uname -s`" = "Linux" ]; then +if [ ! "$(uname -s)" = "Linux" ]; then echo "[-] Error: Nyx mode is only available on Linux." exit 0 fi -if [ ! "`uname -m`" = "x86_64" ]; then +if [ ! "$(uname -m)" = "x86_64" ]; then echo "[-] Error: Nyx mode is only available on x86_64 (yet)." exit 0 @@ -22,10 +25,10 @@ fi echo "[*] Making sure all Nyx is checked out" -git status 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - git submodule init || exit 1 +if git status 1>/dev/null 2>&1; then + + git submodule init echo "[*] initializing QEMU-Nyx submodule" git submodule update ./QEMU-Nyx 2>/dev/null # ignore errors echo "[*] initializing packer submodule" @@ -47,32 +50,27 @@ test -e QEMU-Nyx/.git || { echo "[-] QEMU-Nyx not checked out, please install gi echo "[*] checking packer init.cpio.gz ..." if [ ! -f "packer/linux_initramfs/init.cpio.gz" ]; then - cd packer/linux_initramfs/ - sh pack.sh || exit 1 - cd ../../ + (cd packer/linux_initramfs/ && sh pack.sh) fi echo "[*] Checking libnyx ..." if [ ! -f "libnyx/libnyx/target/release/liblibnyx.a" ]; then - cd libnyx/libnyx - cargo build --release || exit 1 - cd ../../ + (cd libnyx/libnyx && cargo build --release) fi echo "[*] Checking QEMU-Nyx ..." if [ ! -f "QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64" ]; then - cd QEMU-Nyx/ - ./compile_qemu_nyx.sh static || exit 1 - cd .. + + if ! dpkg -s gtk3-devel > /dev/null 2>&1; then + echo "[-] Disabling GTK because gtk3-devel is not installed." + sed -i 's/--enable-gtk//g' QEMU-Nyx/compile_qemu_nyx.sh + fi + (cd QEMU-Nyx && ./compile_qemu_nyx.sh static) fi echo "[*] Checking libnyx.so ..." -if [ -f "libnyx/libnyx/target/release/liblibnyx.so" ]; then - cp -v libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so || exit 1 -else - echo "[ ] libnyx.so not found..." - exit 1 -fi +cp libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so + echo "[+] All done for nyx_mode, enjoy!" exit 0 |