uboot-am335x_bone.install 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. flash_instructions() {
  2. echo "# dd if=/boot/MLO of=/dev/mmcblk0 count=1 seek=1 conv=notrunc bs=128k"
  3. echo "# dd if=/boot/u-boot.img of=/dev/mmcblk0 count=2 seek=1 conv=notrunc bs=384k"
  4. }
  5. flash_uboot() {
  6. root=$(mount | awk '/ on \/ / { print $1; }')
  7. if [[ $root =~ ^/dev/mmcblk.*$ ]]; then
  8. root=${root:0:12}
  9. echo "A new U-Boot version needs to be flashed onto $root."
  10. echo "Do this now? [y|N]"
  11. read -r shouldwe
  12. if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
  13. dd if=/boot/MLO of=$root count=1 seek=1 conv=notrunc bs=128k
  14. dd if=/boot/u-boot.img of=$root count=2 seek=1 conv=notrunc bs=384k
  15. else
  16. echo "You can do this later by running:"
  17. flash_instructions
  18. fi
  19. else
  20. echo "Flash the new U-Boot version onto your boot device. For example:"
  21. flash_instructions
  22. fi
  23. }
  24. post_install() {
  25. flash_uboot
  26. }
  27. post_upgrade() {
  28. flash_uboot
  29. if (( $(vercmp $2 2017.07-1) < 0 )); then
  30. echo ' >>> Note: uEnv.txt is no longer sourced. Make any customizations within /boot/boot.txt'
  31. echo ' and run ./mkscr within /boot to convert it to the boot.scr file.'
  32. fi
  33. }