update scripts to accept a locale argument

This commit is contained in:
bunnie 2022-03-10 16:22:48 +08:00
parent 21ad8d9283
commit dc2c393c5c
6 changed files with 47 additions and 11 deletions

13
Cargo.lock generated
View file

@ -637,13 +637,13 @@ dependencies = [
[[package]]
name = "curve25519-dalek"
version = "3.2.1"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#ec0fe92578bba6dd47457a9bb8287deb48432ce1"
version = "3.1.0"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#c0ee5bf18c606b51bbffb02fde5801ac129b4e7d"
dependencies = [
"byteorder",
"digest",
"engine-25519",
"engine25519-as",
"engine25519-as 0.1.0 (git+https://github.com/betrusted-io/engine25519-as.git?rev=6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3)",
"log",
"rand_core 0.5.1",
"subtle",
@ -764,7 +764,7 @@ dependencies = [
name = "engine-25519"
version = "0.1.0"
dependencies = [
"engine25519-as",
"engine25519-as 0.1.0 (git+https://github.com/betrusted-io/engine25519-as.git?rev=274b82899d28535ac6d4b7869e26eef2039578d5)",
"llio",
"log",
"log-server",
@ -784,6 +784,11 @@ name = "engine25519-as"
version = "0.1.0"
source = "git+https://github.com/betrusted-io/engine25519-as.git?rev=274b82899d28535ac6d4b7869e26eef2039578d5#274b82899d28535ac6d4b7869e26eef2039578d5"
[[package]]
name = "engine25519-as"
version = "0.1.0"
source = "git+https://github.com/betrusted-io/engine25519-as.git?rev=6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3#6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3"
[[package]]
name = "enum_dispatch"
version = "0.3.7"

View file

@ -1,3 +1,6 @@
param (
[string]$LOCALE="en"
)
Write-Output "This script will do a factory reset, removing all stored data and keys."
$title = 'Factory reset'
$question = 'Are you sure you want to proceed?'
@ -17,7 +20,7 @@ Remove-Item loader.bin
Write-Output "waiting for device to reboot"
Start-Sleep 5
Invoke-WebRequest https://ci.betrusted.io/releases/latest/xous.img -OutFile xous.img
Invoke-WebRequest https://ci.betrusted.io/releases/latest/xous-$LOCALE.img -OutFile xous.img
python usb_update.py -k xous.img
Remove-Item xous.img

View file

@ -11,13 +11,24 @@ elif [ $ARG1 == "-b" ]; then
echo "Updating to bleeding edge release"
REVISION="latest-ci"
else
echo "Usage: ${0} [-s] [-b]"
echo "Usage: ${0} [-s] [-b] [[-l LOCALE]], where LOCALE is one of en, ja, zh, or en-tts"
echo "One of -s or -b must be specified for either stabilized or bleeding edge branches"
echo " "
echo "This script does a factory reset: all keys and data will be lost. No backsies."
exit 1
fi
ARG2=${2:-bogus}
if [ $ARG2 == "-l" ]; then
if [ -z "$3" ]; then
echo "Missing locale specifier"
exit 0
fi
LOCALE="-"$3
else
LOCALE=""
fi
wget https://ci.betrusted.io/$REVISION/loader.bin -O /tmp/loader.bin
./usb_update.py -l /tmp/loader.bin
rm /tmp/loader.bin
@ -25,7 +36,7 @@ rm /tmp/loader.bin
echo "waiting for device to reboot"
sleep 5
wget https://ci.betrusted.io/$REVISION/xous.img -O /tmp/xous.img
wget https://ci.betrusted.io/$REVISION/xous$LOCALE.img -O /tmp/xous.img
./usb_update.py -k /tmp/xous.img
rm /tmp/xous.img

View file

@ -1,3 +1,6 @@
param (
[string]$LOCALE="en"
)
Write-Output "This script will update Xous and stage gateware and EC firmware for self-provisioning. No secrets will be erased."
Write-Output "This script will use the bleeding edge CI build."
$title = 'Update to bleeding edge CI'
@ -18,7 +21,7 @@ Remove-Item loader.bin
Write-Output "waiting for device to reboot"
Start-Sleep 5
Invoke-WebRequest https://ci.betrusted.io/latest-ci/xous.img -OutFile xous.img
Invoke-WebRequest https://ci.betrusted.io/latest-ci/xous-$LOCALE.img -OutFile xous.img
python usb_update.py -k xous.img
Remove-Item xous.img

View file

@ -11,7 +11,7 @@ elif [ $ARG1 == "-b" ]; then
echo "Updating to bleeding edge release"
REVISION="latest-ci"
else
echo "Usage: ${0} [-s] [-b]"
echo "Usage: ${0} [-s] [-b] [[-l LOCALE]], where LOCALE is one of en, ja, zh, or en-tts"
echo "One of -s or -b must be specified for either stabilized or bleeding edge branches"
echo " "
echo "This script also assumes you have initialized your root keys. If you have not,"
@ -20,6 +20,17 @@ else
exit 1
fi
ARG2=${2:-bogus}
if [ $ARG2 == "-l" ]; then
if [ -z "$3" ]; then
echo "Missing locale specifier"
exit 0
fi
LOCALE="-"$3
else
LOCALE=""
fi
wget https://ci.betrusted.io/$REVISION/loader.bin -O /tmp/loader.bin
./usb_update.py -l /tmp/loader.bin
rm /tmp/loader.bin
@ -27,7 +38,7 @@ rm /tmp/loader.bin
echo "waiting for device to reboot"
sleep 5
wget https://ci.betrusted.io/$REVISION/xous.img -O /tmp/xous.img
wget https://ci.betrusted.io/$REVISION/xous$LOCALE.img -O /tmp/xous.img
./usb_update.py -k /tmp/xous.img
rm /tmp/xous.img

View file

@ -1,3 +1,6 @@
param (
[string]$LOCALE="en"
)
Write-Output "This script will update Xous and stage gateware and EC firmware for self-provisioning. No secrets will be erased."
Write-Output "This script will use the latest release."
$title = 'Update to latest release'
@ -18,7 +21,7 @@ Remove-Item loader.bin
Write-Output "waiting for device to reboot"
Start-Sleep 5
Invoke-WebRequest https://ci.betrusted.io/releases/latest/xous.img -OutFile xous.img
Invoke-WebRequest https://ci.betrusted.io/releases/latest/xous-$LOCALE.img -OutFile xous.img
python usb_update.py -k xous.img
Remove-Item xous.img