FRET-LibAFL/libafl_nyx/build_nyx_support.sh
Tobias Mayer d7ac802fb2
Update libafl_nyx to newest qemu-nyx and nyx-packer, fixing some problems with build_nyx_support.sh. Providing Makefile for bug in qemu-nyx (#2070)
Co-authored-by: ganbarutobi <ganbarutobi@gmail.com>
Co-authored-by: Romain Malmain <romain.malmain@pm.me>
2024-04-19 10:41:55 +02:00

58 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
echo "================================================="
echo " Nyx build script"
echo "================================================="
echo
echo "[*] Making sure all Nyx is checked out"
git status 1>/dev/null 2>/dev/null
if [ ! -e ./QEMU-Nyx/.git ]; then
rm -rf ./QEMU-Nyx
git clone https://github.com/nyx-fuzz/QEMU-Nyx.git || exit 1
pushd QEMU-Nyx
git reset --hard e5e1c4c21ff9c4dc80e6409d4eab47146c6024cd
popd
fi
if [ ! -e ./packer/.git ]; then
rm -rf ./packer
git clone https://github.com/nyx-fuzz/packer || exit 1
pushd packer
git reset --hard bcf3e248b660764f48af54232a3388389a2dfc22
popd
fi
git submodule init || exit 1
echo "[*] initializing QEMU-Nyx submodule"
cd QEMU-Nyx/ || return
git submodule update --init .
cd ..
echo "[*] initializing packer submodule"
git submodule update ./packer 2>/dev/null # ignore errors
test -e packer/.git || { echo "[-] packer not checked out, please install git or check your internet connection." ; exit 1 ; }
test -e QEMU-Nyx/.git || { echo "[-] QEMU-Nyx not checked out, please install git or check your internet connection." ; exit 1 ; }
echo "[*] Checking QEMU-Nyx ..."
if [ ! -f "QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64" ]; then
cd QEMU-Nyx/ || return
cp ../Makefile.libxdc ./libxdc/Makefile || exit 1
./compile_qemu_nyx.sh lto || exit 1
cd ..
fi
echo "[*] checking packer init.cpio.gz ..."
if [ ! -f "packer/linux_initramfs/init.cpio.gz" ]; then
cd packer/linux_initramfs/ || return
sh pack.sh || exit 1
cd ../../
fi
echo "[+] All done for nyx_mode, enjoy!"
exit 0