pal_loader 659 B

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