#!/bin/bash echo "Updating U-Boot to Improve Support for booting other distros..." DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" #SYSPART=$(findmnt -n -o SOURCE /) #if echo $SYSPART | grep -qE 'p[0-9]$' ; then # DEVID=$(echo $SYSPART | sed -e s+'p[0-9]$'+''+) #else # DEVID=$(echo $SYSPART | sed -e s+'[0-9]$'++) #fi #DEVID='/dev/mmcblk1' DEVID='/dev/loop0' echo Identified $DEVID as device to flash uboot to... echo press ENTER to flash, or ctrl-c to abort read -p "$*" if [ -f $DIR/idbloader.img ] ; then echo "Upgrading idbloader.img..." dd if=$DIR/idbloader.img of=$DEVID bs=32k seek=1 conv=fsync &>/dev/null fi if [ -f $DIR/uboot.img ] ; then echo "Upgrading uboot.img..." dd if=$DIR/uboot.img of=$DEVID bs=64k seek=128 conv=fsync &>/dev/null fi if [ -f $DIR/trust.img ] ; then echo "Upgrading trust.img..." dd if=$DIR/trust.img of=$DEVID bs=64k seek=192 conv=fsync &>/dev/null fi