2017-10-18 12:04:02 +02:00
|
|
|
# header for fuzzer generate.sh scripts
|
2020-04-16 10:50:39 +02:00
|
|
|
# Copyright (C) 2017-2020 The Project X-Ray Authors.
|
|
|
|
|
#
|
|
|
|
|
# Use of this source code is governed by a ISC-style
|
|
|
|
|
# license that can be found in the LICENSE file or at
|
|
|
|
|
# https://opensource.org/licenses/ISC
|
|
|
|
|
#
|
|
|
|
|
# SPDX-License-Identifier: ISC
|
2017-10-18 12:04:02 +02:00
|
|
|
|
|
|
|
|
if [ -z "$XRAY_DATABASE" ]; then
|
|
|
|
|
echo "No XRAY environment found. Make sure to source the settings file first!"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
2018-12-19 02:39:24 +01:00
|
|
|
export FUZDIR=$PWD
|
|
|
|
|
|
2018-10-04 01:20:23 +02:00
|
|
|
# for some reason on sourced script set -e doesn't work
|
2018-12-03 21:00:06 +01:00
|
|
|
# Scripts may have additional arguments, but first is reserved for build directory
|
|
|
|
|
test $# -ge 1 || exit 1
|
2018-12-06 04:51:45 +01:00
|
|
|
test ! -e "$SPECDIR"
|
|
|
|
|
export SPECDIR=$1
|
2017-10-18 12:04:02 +02:00
|
|
|
|
2018-12-06 04:51:45 +01:00
|
|
|
mkdir -p "$SPECDIR"
|
|
|
|
|
cd "$SPECDIR"
|
2018-10-23 21:24:16 +02:00
|
|
|
|
2018-12-06 04:51:45 +01:00
|
|
|
export SEED="$(echo $SPECDIR | md5sum | cut -c1-8)"
|
2018-10-24 08:20:26 +02:00
|
|
|
export SEEDN="$(basename $(pwd) |sed s/specimen_0*//)"
|
2018-10-23 04:46:53 +02:00
|
|
|
|
|
|
|
|
function seed_vh () {
|
|
|
|
|
echo '`define SEED 32'"'h${SEED}" > setseed.vh
|
|
|
|
|
}
|
|
|
|
|
|