Quick auto installer to the Armbian images | Быстрый авто-установщик проекта на образы Armbian
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1KB

  1. #!/bin/bash
  2. source tools.sh
  3. # var list
  4. NAME="ARISC firmware"
  5. DST_DIR="/boot"
  6. SRC_DIR="./armbian/arisc_firmware"
  7. ALL_FILES=("arisc-fw.code" "fixup.cmd" "fixup.scr")
  8. # greetings
  9. log ""
  10. log "--- Installing **${NAME}** -------"
  11. # check a folders
  12. if [[ ! -d "${SRC_DIR}" ]]; then
  13. log "!!ERROR!!: Can't find the **${SRC_DIR}** folder [**${0}:${LINENO}**]."
  14. exit 1
  15. fi
  16. if [[ ! -d "${DST_DIR}" ]]; then
  17. log "!!ERROR!!: Can't find the **${DST_DIR}** folder [**${0}:${LINENO}**]."
  18. exit 1
  19. fi
  20. # check/copy files
  21. for file in ${ALL_FILES[*]}; do
  22. if [[ ! -f "${SRC_DIR}/${file}" ]]; then
  23. log "!!ERROR!!: Can't find the **${SRC_DIR}/${file}** file [**${0}:${LINENO}**]."
  24. exit 1
  25. fi
  26. sudo cp -f "${SRC_DIR}/${file}" "${DST_DIR}/${file}"
  27. if [[ ! -f "${DST_DIR}/${file}" ]]; then
  28. log "!!ERROR!!: Can't create the **${DST_DIR}/${file}** file [**${0}:${LINENO}**]."
  29. exit 1
  30. fi
  31. done
  32. log "@@NOTE@@: You must reboot the system to complete the installation"
  33. log "--- **${NAME}** ++successfully installed++ -------"
  34. log ""