pal_loader 611 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. PAL_LOADER=$(readlink -f ${BASH_SOURCE[0]})
  3. PAL_DIR=$(readlink -f $(dirname $PAL_LOADER)/../../../../Pal/src)
  4. PAL=$PAL_DIR/pal
  5. MANIFEST=
  6. GDB_CMD=
  7. PAL_CMD=$PAL
  8. if [ "$GDB" == "1" ]; then
  9. GDB="gdb"
  10. fi
  11. if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then
  12. GDB_CMD="$GDB --args"
  13. fi
  14. if [ "$SEC" == "1" ]; then
  15. echo "Use reference monitor"
  16. fi
  17. while [ "$1" != "" ];
  18. do
  19. if [ "$MANIFEST" == "" ]; then
  20. MANIFEST=$1
  21. shift
  22. continue
  23. fi
  24. break
  25. done
  26. if [ ! -f "$PAL_CMD" ]; then
  27. echo "$PAL_CMD is not built, or security mode is not supported"
  28. exit 1
  29. fi
  30. set -x
  31. exec $GDB_CMD $PAL_CMD $MANIFEST "$@"