1#!/usr/bin/bash
2
3set -u
4
5# ------------------------------------------------------------------------------
6# READ FIRMWARE LIST
7# ------------------------------------------------------------------------------
8source ndrun_fwlist
9
10# ------------------------------------------------------------------------------
11# SET FIRMWARE
12# ------------------------------------------------------------------------------
13if [ $# -eq 0 ]
14then
15    echo "usage: setfirmware <major version of firmware>"
16    echo " Sets the firmware for local or network."
17	echo " * for network     : ${FW_FOR_EXTENSION}.x.x"
18	echo " * for local       : ${FW_FOR_STANDARD}.x.x"
19    exit 0
20fi
21
22# if [ $1 != "net" -a $1 != "not_net" ]
23# then
24#     echo "Illegal argument. Do nothing and exit."
25#     exit 1
26# fi
27
28if [ "$NDEV" = "" ]
29then
30    echo "NDEV is not found. Do nothing and exit."
31    exit 0
32fi
33
34if [ "$NDEV" != "" ]
35then
36    echo "NDEV detected"
37
38    #
39    # change NDEV configuration
40    #
41    if cp -pf $REVOLUTION_SDK_ROOT/x86/bin/rvl.no.${1}.bin $REVOLUTION_SDK_ROOT/x86/bin/rvl.bin && cp -pf $REVOLUTION_SDK_ROOT/RVL/boot/apploader${1}.img $REVOLUTION_SDK_ROOT/RVL/boot/apploader.img
42    then
43		case $1 in
44       		${FW_FOR_EXTENSION})
45            echo "Successfully done. Set the firmware for EXTENSION."
46        		;;
47       		${FW_FOR_STANDARD})
48            echo "Successfully done. Set the firmware for STANDARD."
49        		;;
50       		*)
51            echo "Successfully done. Set the unexpected firmware."
52				;;
53		esac
54	else
55        echo "Failed to set the firmware version."
56        exit 1
57    fi
58fi
59
60echo
61echo "**********************************************************************"
62echo "* If you make master data, you must execute ndrun before you do so!! *"
63echo "**********************************************************************"
64echo
65