一键安装主要是采用shell脚本将所以的安装步骤组合起来,对于新手入门安装很方便。

废话就不多说了,直接粘贴代码:

#!/bin/sh
gpg --keyserver keyserver.ubuntu.com --recv-keys 34EC655A
gpg -a --export 34EC655A | sudo apt-key add -
cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo echo "deb http://tinyprod.net/repos/debian squeeze main" >> /etc/apt/sources.list
sudo echo "deb http://tinyprod.net/repos/debian msp430-46 main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install nesc tinyos-tools msp430-46 avr-tinyos mspdebug avarice-tinyos avrdude-tinyos avr-binutils-tinyos-legacy avr-gcc-tinyos-legacy avr-libc-tinyos-legacy avr-tinyos-legacy avrdude-tinyos-legacy uisp-tinyos msp430-binutils-tinyos-legacy msp430-gcc-tinyos-legacy msp430-libc-tinyos-legacy msp430-tinyos-legacy arm-all-tinyos
cd /opt/
wget http://github.com/tinyos/tinyos-release/archive/tinyos-2_1_2.tar.gz
tar xf tinyos-2_1_2.tar.gz
mv tinyos-release-tinyos-2_1_2 tinyos
cp ~/.bashrc ~/.bashrc.backup
sudo echo "export TOSROOT=\"/opt/tinyos\"" >> ~/.bashrc
sudo echo "export TOSDIR=\"$TOSROOT/tos\"" >> ~/.bashrc
sudo echo "export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java" >> ~/.bashrc
sudo echo "export MAKERULES=\"$TOSROOT/support/make/Makerules\"" >> ~/.bashrc
sudo echo "export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python" >> ~/.bashrc
echo "setting up TinyOS on source path $TOSROOT"
sudo gpasswd -a norbert dialout

直接将上述的代码保存为“tinyos-install.sh”,然后用命令行运行即可。

注意,在运行过程中需要数据管理员权限的密码。