Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (24 sloc) 0.788 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/bash
#
# We need to run ctfconvert on all the .o files in qemu. However, some of these
# .o files contain some snippets that are going to cause ctfconvert to fail. If
# ctfconvert is run with the -i option, it will delete the .o file. This is bad.
# Instead we end up using a temporary file and move over it.
#

sh_arg0=$(basename $0)

function fail
{
        local msg="$*"
        [[ -z "$msg" ]] && msg="failed"
        echo "$sh_arg0: $msg" >&2
        exit 1
}

[[ $# -eq 1 ]] || fail "missing arguments"

# CTFCONVERT may contain a wildcard, so expand it out:
ctfconvert=$(echo ${CTFCONVERT})
[[ -x ${ctfconvert} ]] || fail "could not find ctfconvert at $CTFCONVERT"

echo "Converting $1"
$ctfconvert -L VERSION -o $1.ctf $1
[[ $? -ne 0 ]] && exit 1
mv $1.ctf $1
exit 0
Something went wrong with that request. Please try again.