summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Thomas <james.thomas@codethink.co.uk>2014-11-13 16:33:38 (GMT)
committerJames Thomas <james.thomas@codethink.co.uk>2014-11-13 16:33:38 (GMT)
commite1b77a93930403da0eb7c65617b00a76908fe879 (patch)
treeabddd48ab41354bb424a1746c991c3a5ac55beb3
parentc88fab247a5a67c87196222ff0c74a7310394683 (diff)
downloaddefinitions-baserock/james/add-baserock-flash.tar.gz
Add baserock-jetson-flash to scripts directorybaserock/james/add-baserock-flash
-rwxr-xr-xscripts/baserock-jetson-flash.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/baserock-jetson-flash.sh b/scripts/baserock-jetson-flash.sh
new file mode 100755
index 0000000..7579438
--- /dev/null
+++ b/scripts/baserock-jetson-flash.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+uboot_file=baserock/u-boot.bin
+system_image=$1
+
+if [[ $(id -u) != 0 ]]; then
+ echo "Script must be run as root"
+ exit
+fi;
+
+if [ ! -f "${uboot_file}" ]; then
+ echo "Error: missing u-boot file $uboot_file"
+ exit
+fi;
+
+if [ ! -f "${system_image}" ]; then
+ echo "Error: missing system image"
+ exit
+fi;
+
+if [ -f "bootloader/system.img" ]; then
+ echo "Backup existing system image"
+ cp bootloader/system.img bootloader/system.img.bak
+fi;
+
+ln -s $1 bootloader/system.img
+echo "Flashing u-boot and baserock image to emmc"
+ROOTFS_SIZE=15032385536 ./flash.sh -L baserock/u-boot.bin -r jetson-tk1 mmcblk0p1
+echo "Finished flashing...."
+rm bootloader/system.img
+if [ -f "bootloader/system.img.bak" ]; then
+ cp bootloader/system.img.bak bootloader/system.img
+fi;