Skip to content

Instantly share code, notes, and snippets.

@strobo
Last active September 3, 2019 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strobo/9a8663676e0dc9a670789583b50653b3 to your computer and use it in GitHub Desktop.
Save strobo/9a8663676e0dc9a670789583b50653b3 to your computer and use it in GitHub Desktop.
Update SDK 0.10.3
#!/bin/bash
set -Ceu
# Initial setup
SDK_INSTALLER_URL="https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.10.3/zephyr-sdk-0.10.3-setup.run"
SDK_INSTALLER="zephyr-sdk-0.10.3-setup.run"
sudo apt update
sudo apt upgrade
# Install dependencies.
sudo apt install --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-pip python3-setuptools python3-wheel xz-utils file make gcc \
gcc-multilib
# Install newer cmake. apt doesn't install newer cmake.
pip3 install --user cmake
# Apply PATH that installed by pip3
source ~/.profile
# Install zephyr SDK
mkdir -p $HOME/zephyr
if [ ! -f "$HOME/zephyr/$SDK_INSTALLER" ] ; then
wget $SDK_INSTALLER_URL
fi
if [ -d "$HOME/zephyr/zephyr-sdk-0.10.3" ] ; then
echo "Aleady exists $HOME/zephyr/zephyr-sdk-0.10.3"
exit -1
fi
echo ""
echo "please type install dir $HOME/zephyr/zephyr-sdk-0.10.3"
echo ""
sh $HOME/zephyr/$SDK_INSTALLER --target $HOME/zephyr/zephyr-sdk-0.10.3/
rm $SDK_INSTALLER
echo "" >> $HOME/.bashrc
echo "export ZEPHYR_TOOLCHAIN_VARIANT=zephyr" >> $HOME/.bashrc
echo "export ZEPHYR_SDK_INSTALL_DIR=$HOME/zephyr/zephyr-sdk-0.10.3/" >> $HOME/.bashrc
echo "Complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment