From 1f454622064da8db625f4e1833c83a63c403a80f Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Thu, 21 May 2015 22:18:14 -0400 Subject: [PATCH] [extras] run ramdisk creation script from top level sources directory --- extras/ramdisk/ramdisk-create.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) 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 $?