blobutil 877 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
  3. # SPDX-License-Identifier: GPL-3.0-only
  4. ./.gitcheck
  5. script_dir="resources/scripts/blobs"
  6. modes=$(ls -1 ${script_dir})
  7. Print_help(){
  8. cat <<- EOF
  9. Usage: ./blobutil [mode] <options>
  10. Example: ./blobutil download x230_12mb
  11. Possible options for mode are
  12. ${modes}
  13. Mode descriptions:
  14. download: Try to automatically generate blobs for specified board
  15. inject: Inject blobs for specified board into specified rom
  16. extract: Extract blobs from specified rom for specified board
  17. EOF
  18. }
  19. if [ $# -gt 0 ]; then
  20. mode="${1}"
  21. shift
  22. args="$@"
  23. if [ ! -f "${script_dir}/${mode}" ]; then
  24. printf "Error: No mode ${mode}\n"
  25. Print_help
  26. exit 1
  27. else
  28. ./${script_dir}/${mode} ${args}
  29. fi
  30. else
  31. printf 'Error: You must specify a mode\n'
  32. Print_help
  33. fi
  34. ./.gitcheck clean