gorots: add automated script to set up the TBM

master
S.J.R. van Schaik 7 years ago
parent 4e10ada708
commit a7021ab486
  1. 30
      admin/prepare.sh

@ -0,0 +1,30 @@
#!/bin/sh
die()
{
echo $1
exit -1
}
echo -n "Synchronizing time... "
timeout 1 ./admin -serial-baud 115200 sync-time || die "ERROR"
echo -n "Identifying flash chip... "
timeout 1 ./admin -serial-baud 115200 flash_probe 1>/dev/null || die "ERROR"
timeout 1 ./admin -serial-baud 115200 flash_info
echo -n "Erasing flash chip..."
timeout 60 ./admin -serial-baud 115200 flash_erase 0x0 0x100 1>/dev/null || die "ERROR"
echo "OK"
echo -n "Formatting flash chip... "
timeout 10 ./admin -serial-baud 115200 ftl_probe || die "ERROR"
timeout 10 ./admin -serial-baud 115200 format || die "ERROR"
echo "OK"
echo -n "Testing filesystem..."
timeout 10 ./admin -serial-baud 115200 mount || die "ERROR"
timeout 10 ./admin -serial-baud 115200 mkdir test || die "ERROR"
timeout 10 ./admin -serial-baud 115200 ls | grep -Fqe "test" || die "ERROR"
timeout 10 ./admin -serial-baud 115200 rmdir test || die "ERROR"
echo "OK"
Loading…
Cancel
Save