mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-08 00:34:34 +08:00
Confirmed with milkv, only the sd card version is sold by default for duo in the market. The spi pins are provided through stamp holes, so that users can solder the corresponding components on their baseboard during secondary development. In order to simplify maintenance work, the mainline will only support the sd-card version and no longer support spinor/spinand. Updated config files the same in this patch. Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function get_board_type()
|
|
{
|
|
BOARD_CONFIG=("CONFIG_BOARD_TYPE_MILKV_DUO" "CONFIG_BOARD_TYPE_MILKV_DUO256M" "CONFIG_BOARD_TYPE_MILKV_DUOS")
|
|
BOARD_VALUE=("milkv-duo" "milkv-duo256m" "milkv-duos-sd")
|
|
STORAGE_VAUE=("sd" "sd" "sd")
|
|
|
|
for ((i=0;i<${#BOARD_CONFIG[@]};i++))
|
|
do
|
|
config_value=$(grep -w "${BOARD_CONFIG[i]}" ${PROJECT_PATH}/.config | cut -d= -f2)
|
|
if [ "$config_value" == "y" ]; then
|
|
BOARD_TYPE=${BOARD_VALUE[i]}
|
|
STORAGE_TYPE=${STORAGE_VAUE[i]}
|
|
break
|
|
fi
|
|
done
|
|
export BOARD_TYPE=${BOARD_TYPE}
|
|
export STORAGE_TYPE=${STORAGE_TYPE}
|
|
}
|
|
|
|
function check_bootloader()
|
|
{
|
|
restult=$(curl -m 10 -s http://www.ip-api.com/json)
|
|
COUNTRY=$(echo $restult | sed 's/.*"country":"\([^"]*\)".*/\1/')
|
|
echo "Country: $COUNTRY"
|
|
|
|
if [ "$COUNTRY" == "China" ]; then
|
|
BOOTLOADER_URL=https://gitee.com/flyingcys/cvitek_bootloader
|
|
else
|
|
BOOTLOADER_URL=https://github.com/flyingcys/cvitek_bootloader
|
|
fi
|
|
|
|
if [ ! -d cvitek_bootloader ]; then
|
|
echo "cvitek_bootloader not exist, clone it from ${BOOTLOADER_URL}"
|
|
git clone ${BOOTLOADER_URL}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to clone ${BOOTLOADER_URL} !"
|
|
exit 1
|
|
fi
|
|
fi
|
|
}
|
|
|