自动安装gnuradio的脚本
首先埋汰一下Ubuntu自带的gnuradio版本,就算是在最新的测试版11.10上,gnuradio的版本也还是3.2.0,太旧了,以至于无法兼容USRP上的WBX之类的射频子板,运行时会出现如下错误:
Warning: Treating daughterboard with invalid EEPROM contents as if it
were a “Basic Tx.”
Warning: This is almost certainly wrong… Use appropriate
burn-*-eeprom utility.出现这个错误的根源是因为gnuradio 3.2.0版本中射频子板数据库中并没有WBX子板的ID(这个值是存储在各块子板的eeprom中),解决的方法是更新到3.3.0版,或者直接从git源中安装gnuradio和uhd。通过Google,找到了一个安装脚本:
Build script for UHD+GnuRadio on Fedora and Ubuntu感谢原作者Marcus Leech,不过这个脚本存在一些问题,里面在对很多重要命令的执行结果进行判断的时候使用的是“grep前一个命令的输出”这样的方式,所以当这个脚本运行在非英语locale的系统上时,会出现相当多的误判。我把这些检查方式换成了判断前一个命令结果的返回值,应该能够适用于各种locale设置的Fedora、Ubuntu系统,修改后的版本在这里:gnuradio_build(放在Google doc上了),改动如下:
53,54c53,54 < which $1 >tmp$$ 2>&1 < if grep -q no.${1}.in tmp$$ --- > which $1 > if [ $? -ne 0 ] 59d58 < rm -f tmp$$ 68d66 < rm -f tmp$$ 72d69 < rm -f tmp$$ 80c77 < if grep -q "No such" tmp$$ --- > if [ $? -ne 0 ] 162c159 < sudo apt-get remove 'gnuradio-*' >/dev/null 2>&1 --- > sudo apt-get -y remove 'gnuradio-*' >/dev/null 2>&1 214c211,218 < sudo apt-get -y install $PKGLIST >prereq.log 2>&1 --- > sudo apt-get -y install $PKGLIST 2>&1 | tee prereq.log > if [ $? -ne 0 ] > then > echo Error occured during installing build dependency of gnuradio > echo Please check your network setting and look prereq.log for details. > more prereq.log > exit > fi 274c278 < if [ ! -d gnuradio/gnuradio-core ] --- > if [ $? -ne 0 ] 287c291 < if [ ! -d uhd/host ] --- > if [ $? -ne 0 ]