pal_loader 541 B

123456789101112131415161718192021222324252627282930313233343536373839
  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=
  7. PAL_CMD=$PAL
  8. while [ "$1" != "" ];
  9. do
  10. if [ "$1" = "-gdb" ]; then
  11. GDB="gdb --args"
  12. shift
  13. continue
  14. fi
  15. if [ "$1" = "-sec" ]; then
  16. PAL_CMD=$PAL_SEC
  17. shift
  18. continue
  19. fi
  20. if [ "$MANIFEST" == "" ]; then
  21. MANIFEST=$1
  22. shift
  23. continue
  24. fi
  25. break
  26. done
  27. if [ ! -f "$PAL_CMD" ]; then
  28. echo "$PAL_CMD is not built, or security mode is not supported"
  29. exit 1
  30. fi
  31. exec $GDB $PAL $MANIFEST $*