2022-03-28 22:43:47 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-08-24 14:59:10 +00:00
|
|
|
set -e
|
2021-08-24 14:37:31 +00:00
|
|
|
|
2021-10-04 07:38:04 +00:00
|
|
|
# populate with an invalid default so the equals compares work downstream
|
|
|
|
|
ARG1=${1:-bogus}
|
|
|
|
|
|
|
|
|
|
if [ $ARG1 == "-s" ]; then
|
|
|
|
|
echo "Updating to latest stabilized release"
|
2022-02-28 08:06:48 +00:00
|
|
|
REVISION="releases/latest"
|
2021-10-04 07:38:04 +00:00
|
|
|
elif [ $ARG1 == "-b" ]; then
|
|
|
|
|
echo "Updating to bleeding edge release"
|
|
|
|
|
REVISION="latest-ci"
|
|
|
|
|
else
|
2022-03-10 08:22:48 +00:00
|
|
|
echo "Usage: ${0} [-s] [-b] [[-l LOCALE]], where LOCALE is one of en, ja, zh, or en-tts"
|
2021-10-04 07:38:04 +00:00
|
|
|
echo "One of -s or -b must be specified for either stabilized or bleeding edge branches"
|
2021-10-04 07:48:23 +00:00
|
|
|
echo " "
|
2021-10-04 07:47:02 +00:00
|
|
|
echo "This script also assumes you have initialized your root keys. If you have not,"
|
|
|
|
|
echo "you will have to download and overwrite your base gateware image manually"
|
|
|
|
|
echo "using the './usb_update --soc' command."
|
2021-10-04 07:38:04 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2022-03-10 08:22:48 +00:00
|
|
|
ARG2=${2:-bogus}
|
|
|
|
|
if [ $ARG2 == "-l" ]; then
|
|
|
|
|
if [ -z "$3" ]; then
|
|
|
|
|
echo "Missing locale specifier"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
LOCALE="-"$3
|
|
|
|
|
else
|
|
|
|
|
LOCALE=""
|
|
|
|
|
fi
|
|
|
|
|
|
2022-04-20 08:57:10 +00:00
|
|
|
./usb_update.py --disable-boot
|
2022-04-20 08:59:19 +00:00
|
|
|
echo "waiting for device to reconnect"
|
2021-08-24 14:59:10 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
2022-03-10 08:22:48 +00:00
|
|
|
wget https://ci.betrusted.io/$REVISION/xous$LOCALE.img -O /tmp/xous.img
|
2021-08-24 14:37:31 +00:00
|
|
|
./usb_update.py -k /tmp/xous.img
|
|
|
|
|
rm /tmp/xous.img
|
|
|
|
|
|
2022-04-20 08:59:19 +00:00
|
|
|
echo "waiting for device to reconnect"
|
2021-08-24 14:59:10 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
2021-10-04 07:38:04 +00:00
|
|
|
wget https://ci.betrusted.io/$REVISION/ec_fw.bin -O /tmp/ec_fw.bin
|
2021-08-29 19:30:45 +00:00
|
|
|
./usb_update.py -e /tmp/ec_fw.bin
|
|
|
|
|
rm /tmp/ec_fw.bin
|
2021-10-04 07:47:02 +00:00
|
|
|
|
2022-04-20 08:59:19 +00:00
|
|
|
echo "waiting for device to reconnect"
|
2021-10-05 14:34:53 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
2021-10-05 14:28:30 +00:00
|
|
|
wget https://ci.betrusted.io/$REVISION/wf200_fw.bin -O /tmp/wf200_fw.bin
|
|
|
|
|
./usb_update.py -w /tmp/wf200_fw.bin
|
|
|
|
|
rm /tmp/wf200_fw.bin
|
|
|
|
|
|
2022-04-20 08:59:19 +00:00
|
|
|
echo "waiting for device to reconnect"
|
2022-04-20 08:57:10 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
|
|
wget https://ci.betrusted.io/$REVISION/loader.bin -O /tmp/loader.bin
|
|
|
|
|
wget https://ci.betrusted.io/$REVISION/soc_csr.bin -O /tmp/soc_csr.bin
|
2022-04-20 09:15:46 +00:00
|
|
|
./usb_update.py --enable-boot-update -s /tmp/soc_csr.bin -l /tmp/loader.bin
|
2022-04-20 08:57:10 +00:00
|
|
|
rm /tmp/loader.bin
|
|
|
|
|
rm /tmp/soc_csr.bin
|
|
|
|
|
|
2022-04-20 09:03:02 +00:00
|
|
|
echo " "
|
|
|
|
|
echo "Please insert a paperclip into the hole in the lower right hand corner to force a full reset."
|
2021-10-04 07:48:37 +00:00
|
|
|
echo " "
|
2022-07-16 19:13:13 +00:00
|
|
|
echo "Follow the on-device instructions to finalize the update."
|