uboot4grub-udoo.install 723 B

12345678910111213141516171819202122232425262728
  1. flash_uboot() {
  2. echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
  3. echo "Do you want to do this now? [y|N]"
  4. read -r shouldwe
  5. if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
  6. dd if=/boot/u-boot.imx of=/dev/mmcblk0 bs=512 seek=2
  7. grub-install /dev/mmcblk0
  8. grub-mkconfig -o /boot/grub/grub.cfg
  9. sync
  10. else
  11. echo "You can do this later by running:"
  12. echo "# dd if=/boot/u-boot.imx of=/dev/mmcblk0 bs=512 seek=2"
  13. echo "# grub-install /dev/mmcblk0"
  14. echo "# grub-mkconfig -o /boot/grub/grub.cfg"
  15. fi
  16. }
  17. ## arg 1: the new package version
  18. post_install() {
  19. flash_uboot
  20. }
  21. ## arg 1: the new package version
  22. ## arg 2: the old package version
  23. post_upgrade() {
  24. flash_uboot
  25. }