uboot4extlinux-am335x_bone.install 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. extlinux_warning() {
  6. echo "==> WARNING: Remember to set up your kernels in /boot/extlinux/extlinux.conf"
  7. }
  8. flash_uboot() {
  9. root=$(mount | awk '/ on \/ / { print $1; }')
  10. if [[ $root =~ ^/dev/mmcblk.*$ ]]; then
  11. root=${root:0:12}
  12. echo "A new U-Boot version needs to be flashed onto $root."
  13. echo "Do this now? [y|N]"
  14. read -r shouldwe
  15. if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
  16. dd if=/boot/MLO of=$root count=1 seek=1 conv=notrunc bs=128k
  17. dd if=/boot/u-boot.img of=$root count=2 seek=1 conv=notrunc bs=384k
  18. else
  19. echo "You can do this later by running:"
  20. flash_instructions
  21. fi
  22. else
  23. echo "Flash the new U-Boot version onto your boot device. For example:"
  24. flash_instructions
  25. fi
  26. extlinux_warning
  27. }
  28. post_install() {
  29. flash_uboot
  30. }
  31. post_upgrade() {
  32. flash_uboot
  33. }