uboot-grub-install-am335x_evm.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # U-Boot install script.
  3. # Copyright (C) 2015 Márcio Alexandre Silva Delgado <coadde@parabola.nu>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. _uboot-install-question() {
  18. echo "Do you want to install the Das U-Boot to Parabola $(if [ "$(uname -o)" = 'GNU/Linux' ]; then echo "$(uname -o)"-libre; else echo "$(uname -o)"; fi) $(uname -m)"?
  19. _wait-for-uboot-install-answer
  20. }
  21. _wait-for-uboot-install-answer() {
  22. select _answer in yes no; do
  23. case ${_answer} in
  24. yes)
  25. echo 'Installing the Das U-Boot (MLO file)'
  26. dd if=/boot/uboot-grub-am335x_evm/MLO of=/dev/mmcblk0 count=1 seek=1 conv=notrunc bs=128k" || echo '!!! ERROR !!!' && exit 1
  27. echo 'Installing the Das U-Boot (u-boot.img file)'
  28. dd if=/boot/uboot-grub-am335x_evm/u-boot.img of=/dev/mmcblk0 count=2 seek=1 conv=notrunc bs=384k" || echo '!!! ERROR !!!' && exit 1
  29. echo 'OK, installed' && exit 0
  30. ;;
  31. no)
  32. echo 'OK, exit without changes' && exit 0
  33. ;;
  34. *)
  35. _uboot-install-question
  36. ;;
  37. esac
  38. done
  39. }
  40. _uboot-install-question