diff --git a/extras/ramdisk/ramdisk-create.sh b/extras/ramdisk/ramdisk-create.sh index 40620da4..d4eaef23 100755 --- a/extras/ramdisk/ramdisk-create.sh +++ b/extras/ramdisk/ramdisk-create.sh @@ -1,8 +1,26 @@ #!/bin/sh -x +# +# This script creates a ramdisk and clones the fwknop git repository +# into it. This is meant for AFL fuzzing cycles. +# +RSIZE=768M RAMDISK=/tmp/afl-ramdisk -mkdir $RAMDISK && chmod 777 $RAMDISK -mount -t tmpfs -o size=768M tmpfs $RAMDISK -cd ../.. && git clone . $RAMDISK/fwknop.git +if [ -d $RAMDISK ] +then + echo "[*] $RAMDISK directory already exists" + exit 1 +fi + +if [ -f extras/ramdisk/ramdisk-create.sh ] +then + mkdir $RAMDISK && chmod 777 $RAMDISK + mount -t tmpfs -o size=$RSIZE tmpfs $RAMDISK + git clone . $RAMDISK/fwknop.git +else + echo "[*] Run this script from the top level fwknop sources directory" + exit 1 +fi + exit $?