#! /bin/bash
download_dir=download
script_fusing=sd_fusing_rpi3.sh
+tizen_download_url=http://download.tizen.org/snapshots/tizen/unified/
binary_prefix=tizen-unified
-binary_version=20170824.1
-boot_img_name=common-boot-arm64-rpi3
-platform_img_name=common-iot_core-2parts-armv7l-rpi3
+binary_version=20170911.1
+boot_img_name=iot-boot-arm64-rpi3
+platform_img_name=iot-headless-2parts-armv7l-rpi3
usb_node=/dev/sdb
tmp_rfs_dir=$download_dir/rootfs
wget https://git.tizen.org/cgit/platform/kernel/u-boot/plain/scripts/tizen/sd_fusing_rpi3.sh?h=tizen --output-document=$download_dir/$script_fusing
fi
+if [ ! -e $download_dir/$script_fusing ]; then
+ echo "[ERROR] fail to download fusing script"
+ exit 1
+fi
+
chmod 755 $download_dir/$script_fusing
if [ ! -e $download_dir/brcmfmac43430-sdio.bin ]; then
wget https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.bin -P $download_dir
fi
+if [ ! -e $download_dir/brcmfmac43430-sdio.bin ]; then
+ echo "[ERROR] fail to download [brcmfmac43430-sdio.bin]"
+ exit 1
+fi
+
if [ ! -e $download_dir/brcmfmac43430-sdio.txt ]; then
wget https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm80211/brcm/brcmfmac43430-sdio.txt -P $download_dir
fi
+if [ ! -e $download_dir/brcmfmac43430-sdio.txt ]; then
+ echo "[ERROR] fail to download [brcmfmac43430-sdio.txt]"
+ exit 1
+fi
if [ ! -e $download_dir/BCM43430A1.hcd ]; then
wget https://github.com/OpenELEC/misc-firmware/raw/master/firmware/brcm/BCM43430A1.hcd -P $download_dir
fi
+if [ ! -e $download_dir/BCM43430A1.hcd ]; then
+ echo "[ERROR] fail to download [BCM43430A1.hcd]"
+ exit 1
+fi
if [ ! -e $download_dir/$boot_img ]; then
- wget http://download.tizen.org/snapshots/tizen/unified/${binary_prefix}_${binary_version}/images/standard/${boot_img_name}/$boot_img -P $download_dir
+ wget ${tizen_download_url}${binary_prefix}_${binary_version}/images/standard/${boot_img_name}/$boot_img -P $download_dir
+fi
+if [ ! -e $download_dir/$boot_img ]; then
+ echo "[ERROR] fail to download [${boot_img}]"
+ exit 1
fi
if [ ! -e $download_dir/$platform_img ]; then
- wget http://download.tizen.org/snapshots/tizen/unified/${binary_prefix}_${binary_version}/images/standard/${platform_img_name}/$platform_img -P $download_dir
+ wget ${tizen_download_url}${binary_prefix}_${binary_version}/images/standard/${platform_img_name}/$platform_img -P $download_dir
fi
+if [ ! -e $download_dir/$platform_img ]; then
+ echo "[ERROR] fail to download [${platform_img}]"
+ exit 1
+fi
+
}
fusing_sdcard() {
echo
echo "##################################################"
echo
-echo "Please enter device node of usb[enter to use default($usb_node) : "
+echo "Please enter device node of usb [press enter key to use default($usb_node)] : "
read input_node
if [ "$input_node" = "" ]; then
echo "########### use default dev node : ${usb_node}"
echo "########### use dev node : $usb_node"
fi
-echo "Please enter binary version of usb[enter to use default($binary_version) : "
+echo "Please enter binary version of usb [press enter key to use default($binary_version)] : "
read input_version
if [ "$input_version" = "" ]; then
echo "########### use default version : $binary_version"
download_binaries
-sleep 5
+sleep 1
fusing_sdcard
copy_firmware