Print this page
HVM-785 kvm-cmd build should use CTFMERGE and CTFCONVERT

Split Close
Expand all
Collapse all
          --- old/./ctf.sh
          +++ new/./ctf.sh
   1    1  #!/usr/bin/bash
   2    2  #
   3    3  # We need to run ctfconvert on all the .o files in qemu. However, some of these
   4    4  # .o files contain some snippets that are going to cause ctfconvert to fail. If
   5    5  # ctfconvert is run with the -i option, it will delete the .o file. This is bad.
   6    6  # Instead we end up using a temporary file and move over it. 
   7    7  #
   8      -# This file gets invoked from inside the x86-64_softmmu directory, hence the
   9      -# extra .. in the path below. That's kind of ugly, and I almost apologize.
  10      -#
  11    8  
  12    9  sh_arg0=$(basename $0)
  13      -ctf_bin=$(pwd)/../../../illumos/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/ctfconvert
  14   10  
  15   11  function fail
  16   12  {
  17   13          local msg="$*"
  18   14          [[ -z "$msg" ]] && msg="failed"
  19   15          echo "$sh_arg0: $msg" >&2
  20   16          exit 1
  21   17  }
  22   18  
  23      -
  24   19  [[ $# -eq 1 ]] || fail "missing arguments"
  25   20  
       21 +# CTFCONVERT may contain a wildcard, so expand it out:
       22 +ctfconvert=$(echo ${CTFCONVERT})
       23 +[[ -x ${ctfconvert} ]] || fail "could not find ctfconvert at $CTFCONVERT"
       24 +
  26   25  echo "Converting $1"
  27      -$ctf_bin -L VERSION -o $1.ctf $1
       26 +$ctfconvert -L VERSION -o $1.ctf $1
  28   27  [[ $? -ne 0 ]] && exit 1
  29   28  mv $1.ctf $1
  30   29  exit 0
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX