12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/bin/bash
- PAL_LOADER=$(readlink -f ${BASH_SOURCE[0]})
- PAL_DIR=$(readlink -f $(dirname $PAL_LOADER)/../../../../Pal/src)
- PAL=$PAL_DIR/pal
- PAL_SEC=$PAL_DIR/pal_sec
- MANIFEST=
- GDB_CMD=
- PAL_CMD=$PAL
- if [ "$GDB" == "1" ]; then
- GDB="gdb"
- fi
- if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then
- GDB_CMD="$GDB --args"
- fi
- if [ "$SEC" == "1" ]; then
- echo "Use reference monitor"
- PAL_CMD=$PAL_SEC
- fi
- while [ "$1" != "" ];
- do
- if [ "$1" = "-gdb" ]; then
- GDB_CMD="gdb --args"
- shift
- continue
- fi
- if [ "$1" = "-sec" ]; then
- PAL_CMD=$PAL_SEC
- shift
- continue
- fi
- if [ "$MANIFEST" == "" ]; then
- MANIFEST=$1
- shift
- continue
- fi
- break
- done
- if [ ! -f "$PAL_CMD" ]; then
- echo "$PAL_CMD is not built, or security mode is not supported"
- exit 1
- fi
- set -x
- exec $GDB_CMD $PAL_CMD $MANIFEST "$@"
|