2014-03-04 13:31:30 +00:00
|
|
|
flash_uboot() {
|
2017-02-11 01:18:35 +00:00
|
|
|
if mountpoint -d /boot > /dev/null 2>&1; then
|
|
|
|
base=/boot
|
|
|
|
else
|
|
|
|
base=/
|
|
|
|
fi
|
|
|
|
major=$(mountpoint -d $base | cut -f 1 -d ':')
|
|
|
|
minor=$(expr $(mountpoint -d $base | cut -f 2 -d ':') - 1)
|
|
|
|
device=/dev/$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
|
|
|
|
|
|
|
|
echo "A new U-Boot version needs to be flashed onto ${device}."
|
2014-03-04 13:31:30 +00:00
|
|
|
echo "Do you want to do this now? [y|N]"
|
|
|
|
read -r shouldwe
|
|
|
|
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
2017-02-11 01:18:35 +00:00
|
|
|
dd if=/boot/SPL of=${device} bs=1K seek=1
|
|
|
|
dd if=/boot/u-boot.img of=${device} bs=1K seek=69
|
2014-03-04 13:31:30 +00:00
|
|
|
sync
|
|
|
|
else
|
|
|
|
echo "You can do this later by running:"
|
2017-02-11 01:18:35 +00:00
|
|
|
echo "# dd if=/boot/SPL of=${device} bs=1K seek=1"
|
|
|
|
echo "# dd if=/boot/u-boot.img of=${device} bs=1K seek=69"
|
2014-03-04 13:31:30 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
|
|
|
flash_uboot
|
|
|
|
}
|
|
|
|
|
|
|
|
post_upgrade() {
|
|
|
|
flash_uboot
|
2017-02-11 01:18:35 +00:00
|
|
|
if (( $(vercmp $2 2017.01-1) < 0 )); then
|
|
|
|
echo ' >>> Note: uEnv.txt is no longer sourced. Make any customizations within /boot/boot.txt'
|
|
|
|
echo ' and run ./mkscr within /boot to convert it to the boot.scr file.'
|
|
|
|
fi
|
2014-03-04 13:31:30 +00:00
|
|
|
}
|