1#!/bin/bash
2
3source ./utils.sh
4
5BSP_PATH=$(realpath $(dirname $0))
6echo "BSP_PATH: $BSP_PATH"
7
8download_rttpkgtool $BSP_PATH
9result=$?
10if [ $result -ne 0 ]; then
11	echo "ERROR: rttpkgtool is unavailable! Please check your network connection!"
12	exit 1
13fi
14
15pushd $BSP_PATH/rttpkgtool > /dev/null
16
17./script/sdcard.sh > /dev/null
18result=$?
19
20if [ $result -eq 1 ]; then
21	echo "ERROR: The kernel file to be flashed does not exist!"
22	exit 1
23fi
24if [ $result -eq 2 ]; then
25	echo "ERROR: The USB/SDcard does not exist!"
26	exit 1
27fi
28
29echo "INFO: The kernel file has been flashed to the USB/SDcard successfully!"
30
31popd > /dev/null
32