tbs2910.install 931 B

123456789101112131415161718192021222324252627282930313233
  1. flash_instructions() {
  2. echo "# echo 0 > /sys/block/mmcblk2boot0/force_ro"
  3. echo "# dd if=/boot/u-boot/images/u-boot.imx of=/dev/mmcblk2boot0 bs=1k seek=1 conv=notrunc"
  4. }
  5. extlinux_warning() {
  6. echo "==> WARNING: Remember to set up your kernels in /boot/extlinux/extlinux.conf"
  7. }
  8. flash_uboot() {
  9. # For now we assume that users are flashing u-boot on the eMMC
  10. # u-boot.img can also be loaded through USB for the frist boot with imx_usb_loader
  11. echo "A new U-Boot version needs to be flashed."
  12. echo "Do you want to flash it on the eMMC now? [y|N]"
  13. read -r shouldwe
  14. if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
  15. echo 0 > /sys/block/mmcblk2boot0/force_ro
  16. dd if=/boot/u-boot/images/u-boot.imx of=/dev/mmcblk2boot0 bs=1k seek=1 conv=notrunc
  17. else
  18. echo "You can do this later by running:"
  19. flash_instructions
  20. fi
  21. extlinux_warning
  22. }
  23. post_install() {
  24. flash_uboot
  25. }
  26. post_upgrade() {
  27. flash_uboot
  28. }