SHARE
TWEET

Untitled

a guest Nov 8th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. echo "Updating U-Boot to Improve Support for booting other distros..."
  4.  
  5. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  6.  
  7. #SYSPART=$(findmnt -n -o SOURCE /)
  8. #if echo $SYSPART | grep -qE 'p[0-9]$' ; then
  9. #   DEVID=$(echo $SYSPART | sed -e s+'p[0-9]$'+''+)
  10. #else
  11. #   DEVID=$(echo $SYSPART | sed -e s+'[0-9]$'++)
  12. #fi
  13.  
  14. #DEVID='/dev/mmcblk1'
  15. DEVID='/dev/loop0'
  16.  
  17. echo Identified $DEVID as device to flash uboot to...
  18. echo press ENTER to flash, or ctrl-c to abort
  19. read -p "$*"
  20.  
  21. if [ -f $DIR/idbloader.img ] ; then
  22.     echo "Upgrading idbloader.img..."
  23.     dd if=$DIR/idbloader.img of=$DEVID bs=32k seek=1 conv=fsync &>/dev/null
  24. fi
  25. if [ -f $DIR/uboot.img ] ; then
  26.     echo "Upgrading uboot.img..."
  27.     dd if=$DIR/uboot.img of=$DEVID bs=64k seek=128 conv=fsync &>/dev/null
  28. fi
  29. if [ -f $DIR/trust.img ] ; then
  30.     echo "Upgrading trust.img..."
  31.     dd if=$DIR/trust.img of=$DEVID bs=64k seek=192 conv=fsync &>/dev/null
  32. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top