diff options
author | Robert Mustacchi <rm@joyent.com> | 2011-11-19 02:09:11 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2011-11-19 02:12:36 +0000 |
commit | 0fc8719996feb46a3718daaea07176e09a33bf51 (patch) | |
tree | 0945ed12fed2a682ec6c31cb4b063992c989407b /ctf.sh | |
parent | 7bdfeb90593194a6d242831c9e085e8798c84702 (diff) | |
download | illumos-kvm-cmd-0fc8719996feb46a3718daaea07176e09a33bf51.tar.gz |
HVM-23 Compile qemu userland tools with CTF data
Diffstat (limited to 'ctf.sh')
-rwxr-xr-x | ctf.sh | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#!/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. +# +# This file gets invoked from inside the x86-64_softmmu directory, hence the +# extra .. in the path below. That's kind of ugly, and I almost apologize. +# + +sh_arg0=$(basename $0) +ctf_bin=$(pwd)/../../../illumos/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/ctfconvert + +function fail +{ + local msg="$*" + [[ -z "$msg" ]] && msg="failed" + echo "$sh_arg0: $msg" >&2 + exit 1 +} + + +[[ $# -eq 1 ]] || fail "missing arguments" + +echo "Converting $1" +$ctf_bin -L VERSION -o $1.ctf $1 +[[ $? -ne 0 ]] && exit 1 +mv $1.ctf $1 +exit 0 |