pal_loader 711 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. RUNTIME_DIR=$(/usr/bin/dirname $(readlink -f ${BASH_SOURCE[0]}))
  3. PAL_HOST=$(/usr/bin/make --quiet -f $RUNTIME_DIR/../Pal/src/Makefile.Host print_host 2>&1)
  4. MANIFEST=
  5. GDB_CMD=
  6. PAL_CMD=$RUNTIME_DIR/pal-$PAL_HOST
  7. if [ "$GDB" == "1" ]; then
  8. GDB="/usr/bin/gdb"
  9. fi
  10. if [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then
  11. GDB_CMD="$GDB --args"
  12. fi
  13. if [ "$SEC" == "1" ]; then
  14. echo "Use reference monitor"
  15. PAL_CMD=$RUNTIME_DIR/pal_sec-$PAL_HOST
  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 "$@"