Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

dependencies_check 1.2 KiB

il y a 4 ans
il y a 4 ans
il y a 4 ans
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # dependencies_check
  2. # $@ Dependency files to check
  3. #
  4. # Each dependency is in the form of a tool to test for, optionally followed by
  5. # a : and the name of a package if the package on a Debian-ish system is not
  6. # named for the tool (i.e., qemu-user-static).
  7. dependencies_check()
  8. {
  9. local depfile deps missing
  10. for depfile in "$@"; do
  11. if [[ -e "$depfile" ]]; then
  12. deps="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${BASE_DIR}/depends")"
  13. fi
  14. for dep in $deps; do
  15. if ! hash "${dep%:*}" 2>/dev/null; then
  16. missing="${missing:+$missing }${dep#*:}"
  17. fi
  18. done
  19. done
  20. if [[ "$missing" ]]; then
  21. echo "Required dependencies not installed"
  22. echo
  23. echo "This can be resolved on Debian/Raspbian systems by installing:"
  24. echo "$missing"
  25. false
  26. fi
  27. # If we're building on a native arm platform, we don't need to check for
  28. # binfmt_misc or require it to be loaded.
  29. binfmt_misc_required=1
  30. case $(uname -m) in
  31. aarch64)
  32. binfmt_misc_required=0
  33. ;;
  34. arm*)
  35. binfmt_misc_required=0
  36. ;;
  37. esac
  38. if [[ "${binfmt_misc_required}" == "1" ]]; then
  39. if ! grep -q "/proc/sys/fs/binfmt_misc" /proc/mounts; then
  40. echo "Module binfmt_misc not loaded in host"
  41. echo "Please run:"
  42. echo " sudo modprobe binfmt_misc"
  43. exit 1
  44. fi
  45. fi
  46. }