修改build-gnuradio的github本地安装

1.将VMWare镜像中的~/sdr/ 复制到你的linux中

2.将以下文本替换掉build-gnuradio里的内容,没错

这部分代码位于function all之中,这就是本大侠改动的地方了。

其实在all之中还有一段重要的代码,如下

高手写的代码条理就是清晰,每个安装包给出一个单独的function
如果你想跳过一些包,修改这里即可。

3.将所有目录中的MAKECache.txt删掉

4.执行./build-gnuradio

5.如果觉得麻烦,我会将所有打包放在云盘里,http://pan.baidu.com/s/1i3uV8sH 点击下载

完整shell代码如下

#!/bin/bash # # Build script for UHD+GnuRadio on Fedora and Ubuntu # # # # Updates: https://github.com/guruofquality/grextras/wiki # Updates: https://github.com/balint256/gr-baz.git # # # # Exit function--Id like to be able to upload stats to a website somewhere... # function doexit { echo -n "Send success/fail info to sbrac.org?" read ans case $ans in y|Y|YES|yes|Yes) wget http://www.sbrac.org/bgrstats.php?status="$1"?systype=${SYSTYPE}?sysinfo="`uname -a`" >/dev/null 2>&1 echo Thanks ;; esac exit } function help { cat <<!EOF! Usage: build-gnuradio [--help|-h] [-v|--verbose] [-jN] [-ja] [-l|--logfile logfile ] [-u|--users ulist] [-m] funcs -m - Use HEAD of master branch, rather than 3.7.1. Use compatible extras as well -o - User v3.6.5.1 and compatible extras. -v|--verbose - turn on verbose logging to stdout -jN - have make use N concurrent jobs -ja - have make use N concurrent jobs with auto setting of N (based on number of cpu cores on build system) -josh - use Josh Blums enhanced Gnu Radio GIT repo -u|--users ul - add comma-separated users to 'usrp' group in addition to calling user ( $USER ) -l|--logfile lf - log messages to 'lf' -ut - set tag for UHD checkout to -gt - set tag for Gnu Radio checkout to -e|--extras - add an item to "extras" to be built after Gnu Radio/UHD/gs-osmosdr available funcs are: all - do all functions prereqs - install prerequisites gitfetch - use GIT to fetch Gnu Radio and UHD uhd_build - build only UHD firmware - fetch firmware/FPGA gnuradio_build - build only Gnu Radio mod_groups - modify the /etc/groups and add user to group 'usrp' mod_udev - add UDEV rule for USRP1 mod_sysctl - modify SYSCTL for larger net buffers !EOF! } if [ $USER = root -o $UID -eq 0 ] then echo Please run this script as an ordinary user echo it will acquire root privileges as it needs them via \"sudo\". exit fi VERBOSE=No JFLAG="" LOGDEV=/dev/null USERSLIST=None JOSHMODE=False UTAG=None GTAG=None export LC_LANG=C EXTRAS="" MASTER_MODE=0 OLD_MODE=0 PULLED_LIST="gnuradio uhd rtl-sdr gr-osmosdr gr-iqbal hackrf gr-baz bladeRF" which python3 >/dev/null 2>&1 if [ $? -eq 0 ] then CMAKE_FLAG1=-DPythonLibs_FIND_VERSION:STRING="2.7" CMAKE_FLAG2=-DPythonInterp_FIND_VERSION:STRING="2.7" fi while : do case $1 in -ja) cnt=`grep 'processor.*:' /proc/cpuinfo|wc -l` cnt=`expr $cnt - 1` if [ $cnt -lt 1 ] then cnt=1 fi JFLAG=-j$cnt shift ;; -j[123456789]) JFLAG=$1 shift ;; -josh) JOSHMODE=True shift ;; -v|--verbose) LOGDEV=/dev/stdout shift ;; -l|--logfile) case $2 in /*) LOGDEV=$2 ;; *) LOGDEV=`pwd`/$2 ;; esac shift shift rm -f $LOGDEV echo $LOGDEV Starts at: `date` >>$LOGDEV 2>&1 ;; -u|--users) USERSLIST=$2 shift shift ;; -m|--master) MASTER_MODE=1 shift ;; -o|--old) OLD_MODE=1 shift ;; -h|--help) help exit ;; -ut) UTAG=$2 shift shift ;; -gt) GTAG=$2 shift shift ;; -e|--extras) EXTRAS=$EXTRAS" "$2 shift 2 ;; -*) echo Unrecognized option: $1 echo help exit break ;; *) break ;; esac done CWD=`pwd` SUDOASKED=n SYSTYPE=unknown good_to_go=no for files in /etc/fedora-release /etc/linuxmint/info /etc/lsb-release /etc/debian_version /etc/redhat-release do if [ -f $file ] then good_to_go=yes fi done if [ $good_to_go = no ] then echo Supported systems: Fedora, Ubuntu, Redhat, Debian, Mint, OpenSuse echo You appear to be running none of the above, exiting exit fi echo This script will install Gnu Radio from current GIT sources echo You will require Internet access from the computer on which this echo script runs. You will also require SUDO access. You will require echo approximately 500MB of free disk space to perform the build. echo " " echo This script will, as a side-effect, remove any existing Gnu Radio echo installation that was installed from your Linux distribution packages. echo It must do this to prevent problems due to interference between echo a linux-distribution-installed Gnu Radio/UHD and one installed from GIT source. echo " " echo The whole process may take up to two hours to complete, depending on the echo capabilities of your system. echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo NOTE: if you run into problems while running this script, you can re-run it with echo the --verbose option to produce lots of diagnostic output to help debug problems. echo This script has been written to anticipate some of the more common problems one might echo encounter building ANY large, complex software package. But it is not pefect, and echo there are certainly some situations it could encounter that it cannot deal with echo gracefully. Altering the system configuration from something reasonably standard, echo removing parts of the filesystem, moving system libraries around arbitrarily, etc, echo it likely cannot cope with. It is just a script. It isn\'t intuitive or artificially echo intelligent. It tries to make life a little easier for you, but at the end of the day echo if it runs into trouble, a certain amount of knowledge on your part about echo system configuration and idiosyncrasies will inevitably be necessary. echo echo echo -n Proceed? read ans case $ans in y|Y|YES|yes|Yes) PROCEED=y ;; *) exit esac SPACE=`df $HOME| grep -v blocks|grep '%'` SPACE=`echo $SPACE | awk '/./ {n=NF-2; printf ("%d\n", $n/1.0e3)}'` if [ $SPACE -lt 500 ] then echo "You don't appear to have enough free disk space on $HOME" echo to complete this build/install echo exiting doexit DISKSPACE fi total=0 for file in $PULLED_LIST do found=0 for instance in ${file}.20* do if [ -d $instance ] then found=1 sz=`du -s $instance|awk '{print $1}'` total=`expr $total + $sz` fi done done total=`expr $total '*' 1024` total=`expr $total / 1000000` if [ $total -gt 100 ] then echo Your old 'uhd.*' and 'gnuradio.*' etc directories are using roughly $total MB echo of disk space: for file in $PULLED_LIST do for instance in ${file}.20* do if [ -d $instance ] then ls -ld $instance fi done done echo " " echo -n Remove them'?' read ans case $ans in y|Y|YES|yes|Yes) for file in $PULLED_LIST do for instance in ${file}.20* do if [ -d $instance ] then echo removing ${instance} rm -rf ${instance} fi done done echo Done ;; esac fi rm -rf *.20*.bgmoved function my_echo { if [ $LOGDEV = /dev/stdout ] then echo $* else echo $* echo $* >>$LOGDEV 2>&1 fi } function checkcmd { found=0 which $1 >/dev/null 2>&1 x=$? if [ $x -eq 0 ] then found=1 fi for place in /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin /opt/bin /opt/local/bin do if [ -e $place/$1 ] then found=1 fi done if [ $found -eq 0 ] then which $1 >/dev/null 2>&1 if [ $? -eq 0 ] then found=1 fi fi if [ $found -eq 0 ] then my_echo Failed to find just-installed command \'$1\' after pre-requisite installation. my_echo This very likely indicates that the pre-requisite installation failed my_echo to install one or more critical pre-requisites for Gnu Radio/UHD doexit PREREQFAIL-CMD-$1 fi } function checklib { found=0 my_echo -n Checking for library $1 ... for dir in /lib /usr/lib /usr/lib64 /lib64 /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu \ /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabi do for file in $dir/${1}*.so* do if [ -e "$file" ] then found=1 fi done done if [ $found -le 0 ] then my_echo Failed to find libraries with prefix \'$1\' after pre-requisite installation. my_echo This very likely indicates that the pre-requisite installation failed my_echo to install one or more critical pre-requisites for Gnu Radio/UHD my_echo exiting build doexit PREREQFAIL-LIB-$1 else my_echo Found library $1 fi } function checkpkg { my_echo Checking for package $1 if [ `apt-cache search $1 | wc -l` -eq 0 ] then my_echo Failed to find package \'$1\' in known package repositories my_echo Perhaps you need to add the Ubuntu universe or multiverse PPA? my_echo see https://help.ubuntu.com/community/Repositories/Ubuntu my_echo exiting build doexit PREREQFAIL-PKG-$1 fi } function prereqs { sudocheck my_echo Installing prerequisites. my_echo "====>" THIS MAY TAKE QUITE SOME TIME "<=====" # # It's a Fedora system # if [ -f /etc/fedora-release ] then SYSTYPE=Fedora case `cat /etc/fedora-release` in *12*|*13*|*14*|*15*|*16*|*17*|*18*) sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1 sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1 sudo yum -y install fftw-devel cppunit-devel wxPython-devel \ boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \ python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \ PyQt4-devel qwt-devel qwtplot3d-qt4-devel libusb-devel libusb \ libusb1 libusb1-devel cmake git wget python-docutils \ PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc \ orc-devel python-sphinx SDL-devel swig >>$LOGDEV 2>&1 ;; *19*|*20*) sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1 sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1 sudo yum -y install fftw-devel cppunit-devel wxPython-devel \ boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \ python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \ PyQt4-devel qwt-devel qwtplot3d-qt4-devel \ libusbx-devel cmake git wget python-docutils \ PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc \ orc-devel python-sphinx SDL-devel swig >>$LOGDEV 2>&1 ;; *) my_echo Only Fedora release 12 - 20 are supported by this script doexit WRONGRELEASE ;; esac # # It's a RedHat system elif [ -f /etc/redhat-release ] then SYSTYPE=Redhat case `cat /etc/redhat-release` in *elease*6*) sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1 sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1 sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1 sudo yum -y install fftw-devel cppunit-devel wxPython-devel libusb-devel \ boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \ python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \ PyQt4-devel qwt-devel qwtplot3d-qt4-devel libusb libusb-devel \ libusb1 libusb1-devel cmake git wget python-docutils \ PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc >>$LOGDEV 2>&1 ;; *) my_echo Your Redhat system release must be release 6 to proceed doexit WRONGRELEASE ;; esac # # It's a Mint system # elif [ -f /etc/linuxmint/info ] then SYSTYPE=Mint sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1 case `grep RELEASE /etc/linuxmint/info` in *11*|*12*|*13*|*14*|*15*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2" ;; *) my_echo Your Mint release must be at least Linux Mint 11 to proceed doexit WRONGRELEASE ;; esac for pkg in $PKGLIST; do checkpkg $pkg; done sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1 # # It's a Ubuntu system # elif [ -f /etc/lsb-release -a ! -f /etc/SuSE-release ] then SYSTYPE=Ubuntu sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1 case `grep DISTRIB_RELEASE /etc/lsb-release` in *13.*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2" CMAKE_FLAG1=-DPythonLibs_FIND_VERSION:STRING="2.7" CMAKE_FLAG2=-DPythonInterp_FIND_VERSION:STRING="2.7" ;; *11.*|*12.10*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2" CMAKE_FLAG1=-DPythonLibs_FIND_VERSION:STRING="2.7" CMAKE_FLAG2=-DPythonInterp_FIND_VERSION:STRING="2.7" ;; *12.04*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost1.48-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2" ;; *10.04*|*10.10*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget python-docutils gtk2-engines-pixbuf python-tk libasound2-dev python-gtk2" ;; *9.10*) PKGLIST="swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost1.38-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools cmake git wget python-docutils python-tk libasound2-dev" ;; *9.04*) sudo apt-get purge python-wxgtk2.6 PKGLIST="swig g++ automake1.9 autoconf libtool python-dev fftw3-dev libcppunit-dev libboost1.35-dev libusb-dev libusb-1.0-0-dev libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools cmake git wget python-docutils python-tk libasound2-dev" ;; *) my_echo Your Ubuntu release must be at least 9.04 to proceed doexit WRONGRELEASE ;; esac for pkg in $PKGLIST; do checkpkg $pkg; done my_echo Done checking packages sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1 # # It's a Debian system # elif [ -f /etc/debian_version ] then SYSTYPE=Debian sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1 sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1 case `cat /etc/debian_version` in *6.0*|*wheezy*|*sid*|*7.1*|*7.0*|*7.2*|*7.3*|*7.4*) PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libportaudio2 portaudio19-dev ca-certificates" ;; *) my_echo Unsupported Debian version `cat /etc/debian_version` doexit WRONGRELEASE ;; esac for pkg in $PKGLIST; do checkpkg $pkg; done sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1 elif [ -f /etc/SuSE-release ] then SYSTYPE=OpenSuSE if grep -q 12.1 /etc/SuSE-release then cool=1 else my_echo Only OpenSuSE 12.1 is supported by this script doexit WRONGRELEASE fi sudo zypper install cmake cppunit-devel doxygen fftw3-devel \ git gsl-devel libjack-devel libqt4-devel libqwtplot3d-devel \ libSDL-devel libusb-1_0-devel orc portaudio portaudio-devel \ python-cheetah python-devel python-lxml python-wxGTK python-wxWidgets-devel \ qwt-devel wxWidgets-devel boost-devel xmlto texlive-latex >>$LOGDEV 2>&1 else my_echo This script supports only Ubuntu,Mint,Fedora, Debian and OpenSuse systems my_echo Your Fedora system must be at least Fedora 12 my_echo Your Ubuntu system must be at least Ubuntu 9.04 my_echo Your Mint system must be at least Mint 11 my_echo Your Debian system must be release 6 doexit WRONGSYSTEM fi PATH=$PATH export PATH checkcmd git checkcmd cmake if [ $SYSTYPE = Fedora ] then checklib libusb-0 0 checklib libusb-1 0 else checklib libusb 2 fi checklib libboost 5 checklib libcppunit 0 checklib libfftw 5 checklib libgsl 0 my_echo Done } function gitfetch { date=`date +%Y%m%d%H%M%S` V=3.7/maint if [ $MASTER_MODE -eq 1 ] then V=Master/HEAD fi if [ $OLD_MODE -eq 1 ] then V=3.6.5.1 fi echo This script will fetch Gnu Radio version $V from the repositories, along with compatible echo extras. echo -n Is this OK? read ans case $ans in Y|y|YES|yes|Yes) ;; *) exit ;; esac my_echo "Fetching various packages (Gnu Radio, UHD, gr-osmosdr, gr-iqbal, etc)" my_echo " via the Internet" my_echo "=======> THIS MAY TAKE QUITE SOME TIME <=========" cd $CWD for dir in ${PULLED_LIST} do if [ -d $dir ] then mv $dir ${dir}.$date fi done # # GIT the gnu radio source tree # my_echo -n Fetching Gnu Radio via GIT... if [ $JOSHMODE = False ] then #git clone --progress http://gnuradio.org/git/gnuradio.git >>$LOGDEV 2>&1 #if [ ! -d gnuradio/gnuradio-core -a ! -d gnuradio/gnuradio-runtime ] #then # my_echo "Could not find gnuradio/gnuradio-{core,runtime} after GIT checkout" # my_echo GIT checkout of Gnu Radio failed! # doexit FETCH-GR-FAIL #fi if [ $OLD_MODE -eq 1 ] then cd gnuradio git checkout v3.6.5.1 >>$LOGDEV 2>&1 cd $CWD elif [ $MASTER_MODE -eq 0 ] then cd gnuradio git checkout maint >>$LOGDEV 2>&1 cd $CWD fi if [ $GTAG != None ] then cd gnuradio git checkout $GTAG >/dev/null 2>&1 git name-rev HEAD >tmp$$ 2>&1 if grep -q "HEAD tags/$GTAG" tmp$$ then whee=yes rm -f tmp$$ else my_echo Could not fetch Gnu Radio tagged $GTAG from GIT rm -f tmp$$ doexit FETCH-GR-FAIL-$GTAG fi cd .. fi else git clone --progress git://gnuradio.org/jblum.git >>$LOGDEV 2>&1 if [ $GTAG != "None" ] then git checkout $GTAG else git checkout next fi if [ ! -d jblum/gnuradio-core ] then my_echo GIT checkout of Gnu Radio from jblum.git failed! doexit FETCH-GR-JOSH-FAIL fi fi my_echo Done # # GIT the UHD source tree # rm -rf uhd my_echo -n Fetching UHD via GIT... git clone --progress http://github.com/EttusResearch/uhd >>$LOGDEV 2>&1 if [ ! -d uhd/host ] then my_echo GIT checkout of UHD FAILED rm -f tmp$$ doexit FETCH-UHD-FAIL fi if [ $UTAG != None ] then cd uhd git checkout $UTAG >/dev/null 2>&1 git status >tmp$$ 2>&1 if grep -q "On branch $UTAG" tmp$$ then whee=yes rm -f tmp$$ else my_echo Could not fetch UHD tagged $UTAG from GIT rm -f tmp$$ fi cd .. fi # # GIT the RTL-SDR source tree # rm -rf rtl-sdr rm -rf gr-osmosdr rm -rf gr-baz rm -rf hackrf rm -rf bladeRF my_echo Fetching rtl-sdr "(rtl-sdr, gr-osmosdr, gr-iqbal, hackrf and bladeRF)" via GIT git clone --progress git://git.osmocom.org/rtl-sdr >>$LOGDEV 2>&1 git clone --progress git://git.osmocom.org/gr-osmosdr >>$LOGDEV 2>&1 git clone --progress git://git.osmocom.org/gr-iqbal.git >>$LOGDEV 2>&1 git clone https://github.com/Nuand/bladeRF.git >>$LOGDEV 2>&1 if [ -d gr-iqbal ] then cd gr-iqbal if [ $OLD_MODE -eq 1 ] then git checkout gr3.6 fi git submodule init >>$LOGDEV 2>&1 git submodule update >>$LOGDEV 2>&1 cd .. fi git clone --progress http://github.com/mossmann/hackrf.git >>$LOGDEV 2>&1 my_echo Done } function uhd_build { # # UHD build # sudocheck if [ ! -d uhd ] then my_echo you do not appear to have the \'uhd\' directory my_echo you should probably use $0 gitfetch to fetch the appropriate my_echo files using GIT doexit BUILD-UHD-NOT-THERE fi if [ $UTAG != None ] then cd uhd git checkout $UTAG >/dev/null 2>&1 cd .. fi my_echo Building UHD... my_echo "=============> THIS WILL TAKE SOME TIME <=============" my_echo cd uhd/host if [ ! -d build ] then mkdir build fi cd build make clean >/dev/null 2>&1 cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 ../ >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make $JFLAG >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo UHD build apparently failed my_echo Exiting UHD build doexit UHD-BUILD-FAIL1 fi sudo make $JFLAG install >>$LOGDEV 2>&1 which uhd_find_devices >/dev/null 2>&1 x=$? if [ $x -ne 0 -a ! -f /usr/local/bin/uhd_find_devices -a ! -f /opt/local/bin/uhd_find_devices ] then my_echo UHD build/install apparently failed since I cannot find /usr/local/bin/uhd_find_devices my_echo after doing make and make install my_echo Exiting UHD build doexit UHD-BUILD-FAIL2 fi sudo ldconfig >>$LOGDEV 2>&1 my_echo Done building/installing UHD } function rtl_build { # # RTL build # sudocheck cd $CWD if [ ! -d rtl-sdr ] then my_echo you do not appear to have the \'rtl-sdr\' directory my_echo you should probably use $0 gitfetch to fetch the appropriate my_echo files using GIT doexit BUILD-RTL-NOT-THERE fi my_echo -n Building rtl-sdr... cd rtl-sdr cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 . >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make $JFLAG >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo rtl-sdr build apparently failed my_echo Exiting rtl-sdr build doexit RTL-BUILD-FAIL1 fi sudo make $JFLAG install >>$LOGDEV 2>&1 my_echo Done building rtl-sdr cd $CWD if [ -d hackrf ] then my_echo -n Building hackrf... cd hackrf cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 host/ >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo hackrf build failed my_echo Exiting hackrf build else sudo make install >>$LOGDEV 2>&1 fi my_echo Done building hackrf cd $CWD fi cd $CWD if [ -d gr-iqbal ] then my_echo -n Building gr-iqbal... cd gr-iqbal mkdir -p build cd build cmake .. $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo gr-iqbal build apparently failed my_echo Exiting gr-iqbal build else sudo make install >>$LOGDEV 2>&1 cd $CWD my_echo Done building gr-iqbal fi fi if [ -d bladeRF ] then my_echo -n Building bladeRF... cd bladeRF cd host cmake . $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo bladeRF build apparently failed my_echo Exiting bladeRF build else sudo make install >>$LOGDEV 2>&1 cd $CWD my_echo Done building bladeRF fi fi cd $CWD if [ ! -d gr-osmosdr ] then my_echo you do not appear to have the \'gr-osmosdr\' directory my_echo you should probably use $0 gitfetch to fetch the appropriate my_echo files using GIT doexit RTL-BUILD-FAIL2 fi cd gr-osmosdr if [ $OLD_MODE -eq 1 ] then git checkout gr3.6 >/dev/null 2>&1 fi my_echo -n Building gr-osmosdr... cmake . $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1 make clean >>$LOGDEV 2>&1 make $JFLAG >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo gr-osmosdr build apparently failed my_echo Exit rtl-sdr/gr-osmosdr build doexit OSMOSDR-BUILD-FAIL fi sudo make $JFLAG install >>$LOGDEV 2>&1 my_echo Done building gr-osmosdr sudo ldconfig >>$LOGDEV 2>&1 cd $CWD my_echo Done building/installing rtl-sdr/gr-osmosdr } function firmware { sudocheck FOUND_DOWNLOADER=False dirlist="/usr/local/share /usr/local/lib /usr/local/lib64" prog=uhd_images_downloader.py for dir in $dirlist do if [ -f $dir/uhd/utils/$prog ] then FOUND_DOWNLOADER=True DOWNLOADER=$dir/uhd/utils/$prog fi done if [ $FOUND_DOWNLOADER = True ] then sudo $DOWNLOADER else my_echo Could not find images downloader: $prog in any of $dirlist doexit UHD-FIRMWARE-FAIL fi my_echo Done downloading firmware to /usr/local/share/uhd/images } function gnuradio_build { sudocheck if [ $JOSHMODE = False ] then if [ ! -d gnuradio ] then my_echo you do not appear to have the \'gnuradio\' directory my_echo you should probably use $0 gitfetch to fetch the appropriate my_echo files using GIT doexit GNURADIO-BUILD-NOT-THERE fi if [ $GTAG != None ] then cd gnuradio git checkout $GTAG >/dev/null 2>&1 cd .. fi else if [ ! -d jblum ] then my_echo you do not appear to have the \'jblum\' directory my_echo you should probably use $0 gitfetch to fetch the appropriate my_echo files using GIT doexit GNURADIO-BUILD-NO-JOSH fi fi # # LD stuff # my_echo /usr/local/lib >tmp$$ my_echo /usr/local/lib64 >>tmp$$ if grep -q /usr/local/lib /etc/ld.so.conf.d/* then my_echo /usr/local/lib already in ld.so.conf.d else sudo cp tmp$$ /etc/ld.so.conf.d/local.conf fi rm -f tmp$$ my_echo Doing ldconfig... sudo ldconfig >/dev/null 2>&1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig if [ -d /usr/local/lib64/pkgconfig ] then PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig fi export PKG_CONFIG_PATH # # Build Gnuradio # if [ $JOSHMODE = False ] then cd gnuradio else cd jblum git checkout gr_basic >>$LOGDEV 2>&1 fi my_echo Building Gnu Radio... my_echo "=========> THIS WILL TAKE QUITE A WHILE <=============" my_echo " " my_echo ...Doing cmake if [ -d build ] then my_echo ...build directory already here else mkdir build fi cd build make clean >/dev/null 2>&1 my_echo ...Cmaking cmake -DENABLE_BAD_BOOST=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 ../ >>$LOGDEV 2>&1 my_echo ...Building make $JFLAG clean >>$LOGDEV 2>&1 make $JFLAG >>$LOGDEV 2>&1 if [ $? -ne 0 ] then my_echo make failed my_echo Exiting Gnu Radio build/install doexit GNURADIO-BUILD-FAIL fi my_echo ...Installing sudo rm -rf /usr/local/include/gnuradio/ sudo rm -f /usr/local/lib*/libgnuradio* sudo make $JFLAG install >>$LOGDEV 2>&1 sudo ldconfig >>$LOGDEV 2>&1 my_echo Done building and installing Gnu Radio my_echo -n GRC freedesktop icons install ... if [ -f /usr/local/libexec/gnuradio/grc_setup_freedesktop ] then sudo chmod 755 /usr/local/libexec/gnuradio/grc_setup_freedesktop sudo /usr/local/libexec/gnuradio/grc_setup_freedesktop install >>$LOGDEV 2>&1 fi my_echo Done } function do_an_extra { if [ -e $1 ] then my_echo Building extra module $1 cd $1 if [ -f CMakeLists.txt ] then mkdir -p build >>$LOGDEV 2>&1 cd build cmake .. $CMAKE_FLAGS1 $CMAKE_FLAGS2 $CMF1 $CMF2 >>$LOGDEV 2>&1 make >>$LOGDEV 2>&1 sudo make install >>$LOGDEV 2>&1 sudo ldconfig elif [ - bootstrap ] then chmod 755 bootstrap ./bootstrap >>$LOGDEV 2>&1 PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig ./configure >>$LOGDEV 2>&1 make >>$LOGDEV 2>&1 sudo make install >>$LOGDEV 2>&1 sudo ldconfig else my_echo Couldnt determine how to make module $1 neither bootstrap nor CmakeLists.txt present fi else my_echo Couldnt build module $1 directory not there fi } function extras { sudocheck date=`date +%Y%m%d%H%M%S` if [ ! "@$EXTRAS@" = "@@" ] then for module in $EXTRAS do cd $CWD base=`basename $module .git` case $module in git:*|*.git) mv $base $base.$date.bgmoved >>$LOGDEV 2>&1 my_echo Doing GIT checkout for extra module $base git clone $module >>$LOGDEV 2>&1 do_an_extra $base ;; htt*:*svn*) mv $base $base.$date >>$LOGDEV 2>&1 my_echo Doing SVN checkout for extra module $base svn co $module >>$LOGDEV 2>&1 if [ -e $base/trunk ] then do_an_extra $base/trunk else do_an_extra $base fi ;; *) my_echo Ignoring malformed extra module $module ;; esac done fi cd $CWD } function mod_groups { sudocheck # # Post install stuff # # USRP rules for UDEV and USRP group # # # Check for USRP group, and update if necessary if grep -q usrp /etc/group then my_echo Group \'usrp\' already in /etc/group else sudo /usr/sbin/groupadd usrp fi # # Check that our calling user is in the USRP group, update if necessary # if grep -q usrp.*${USER} /etc/group then my_echo User $USER already in group \'usrp\' else sudo /usr/sbin/usermod -a -G usrp $USER cat <<"!EOF!" ******************************************************************************** This script has just modified /etc/group to place your userid '('$USER')' into group 'usrp' In order for this change to take effect, you will need to log-out and log back in again. You will not be able to access your USRP1 device until you do this. If you wish to allow others on your system to use the USRP1 device, you will need to use: sudo usermod -a -G usrp userid For each userid you wish to allow access to the usrp ******************************************************************************** Further !EOF! fi if [ "$USERSLIST" = None ] then foo=bar else ul=`echo $USERSLIST|sed -e 's/,/ /g'` for u in $ul do sudo /usr/sbin/usermod -a -G usrp $u my_echo Added $u to group usrp done fi } function mod_udev { sudocheck # # Check for UHD UDEV rules file, update if exists # if [ -f $CWD/uhd/host/utils/uhd-usrp.rules ] then sudo cp $CWD/uhd/host/utils/uhd-usrp.rules /etc/udev/rules.d/10-usrp.rules sudo chown root /etc/udev/rules.d/10-usrp.rules sudo chgrp root /etc/udev/rules.d/10-usrp.rules fi # # Check for rtl-sdr UDEV rules file, update if exists # rm -f tmp$$ if [ -f $CWD/rtl-sdr/rtl-sdr.rules ] then sudo cp $CWD/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/15-rtl-sdr.rules sudo chown root /etc/udev/rules.d/15-rtl-sdr.rules sudo chgrp root /etc/udev/rules.d/15-rtl-sdr.rules fi sudo killall -HUP udevd sudo udevadm control --reload-rules } function mod_sysctl { sudocheck # # Modify sysctl.conf as necessary # cat >tmp$$ <<!EOF! # Updates for Gnu Radio net.core.rmem_max = 1000000 net.core.wmem_max = 1000000 kernel.shmmax = 2147483648 !EOF! if grep -q 'Updates for Gnu Radio' /etc/sysctl.conf then my_echo Required updates to /etc/sysctl.conf already in place else my_echo Applying updates to /etc/sysctl.conf cat /etc/sysctl.conf tmp$$ >tmp2$$ chmod 644 tmp2$$ sudo mv tmp2$$ /etc/sysctl.conf fi sudo sysctl -w net.core.rmem_max=1000000 >/dev/null 2>&1 sudo sysctl -w net.core.wmem_max=1000000 >/dev/null 2>&1 sudo sysctl -w kernel.shmmax=2147483648 >/dev/null 2>&1 rm -f tmp$$ rm -f tmp2$$ if grep -q usrp /etc/security/limits.conf then my_echo usrp group already has real-time scheduling privilege else cat >tmp$$ <<!EOF! @usrp - rtprio 50 !EOF! cat /etc/security/limits.conf tmp$$ >tmp2$$ sudo cp tmp2$$ /etc/security/limits.conf sudo chmod 644 /etc/security/limits.conf rm -f tmp$$ tmp2$$ my_echo Group \'usrp\' now has real-time scheduling privileges my_echo You will need to log-out and back in again for this to my_echo take effect fi } function all { my_echo Starting all functions at: `date` cd $CWD prereqs touch -d "15 minutes ago" touch$$ if [ -d uhd -a -d gnuradio ] then if [ uhd -ot touch$$ -o gnuradio -ot touch$$ ] then echo 'simpower91 modified here' echo 'Do you want to skip downloading from the internet?[yes]' read simskip if [ "$simskip"a = 'no'a ] then gitfetch fi echo 'simpower91 modified end' else my_echo Skipping git fetch, since \'uhd\' and \'gnuradio\' are new enough fi else gitfetch fi rm -f touch$$ EXTRAS=$EXTRAS" http://github.com/balint256/gr-baz.git" EXTRAS=$EXTRAS" http://github.com/guruofquality/grextras.git" for fcn in uhd_build firmware gnuradio_build rtl_build extras mod_groups mod_udev mod_sysctl pythonpath do my_echo Starting function $fcn at: `date` cd $CWD $fcn my_echo Done function $fcn at: `date` done my_echo Done all functions at: `date` } function pythonpath { for PYVER in 2.6 2.7 do for type in "" 64 do if [ -d /usr/local/lib${type}/python${PYVER}/site-packages/gnuradio ] then PYTHONPATH=/usr/local/lib${type}/python${PYVER}/site-packages fi if [ -d /usr/local/lib${type}/python${PYVER}/dist-packages/gnuradio ] then PYTHONPATH=/usr/local/lib${type}/python${PYVER}/dist-packages fi done done echo echo echo "************************************************************" echo You should probably set your PYTHONPATH to: echo " " echo " " $PYTHONPATH echo " " echo Using: echo " " echo export PYTHONPATH=$PYTHONPATH echo " " echo in your .bashrc or equivalent file prior to attempting to run echo any Gnu Radio applications or Gnu Radio Companion. echo "*************************************************************" } function sudocheck { # # Check SUDO privileges # if [ $SUDOASKED = n ] then echo SUDO privileges are required echo -n Do you have SUDO privileges'?' read ans case $ans in y|Y|YES|yes|Yes) echo Continuing with script SUDOASKED=y sudo grep timestamp_timeout /etc/sudoers >tmp$$ timeout=`cat tmp$$|awk '/./ {print $4}'` rm -f tmp$$ if [ "@@" = "@$timeout@" ] then sudo cp /etc/sudoers tmp$$ sudo chown $USER tmp$$ sudo chmod 644 tmp$$ echo "Defaults timestamp_timeout = 90" >>tmp$$ sudo cp tmp$$ /etc/sudoers sudo chown root /etc/sudoers sudo chmod 440 /etc/sudoers elif [ "$timeout" -lt 90 ] then echo You need to have a timestamp_timout in /etc/sudoers of 90 or more echo Please ensure that your timestamp_timeout is 90 or more exit fi ;; *) echo Exiting. Please ensure that you have SUDO privileges on this system! exit ;; esac fi } PATH=$PATH export PATH case $# in 0) all my_echo All Done doexit SUCCESS esac for arg in $* do cd $CWD $arg done my_echo All Done doexit SUCCESS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
#!/bin/bash
#
# Build script for UHD+GnuRadio on Fedora and Ubuntu
#
#
#
# Updates: https://github.com/guruofquality/grextras/wiki
# Updates: https://github.com/balint256/gr-baz.git
#
#
#
# Exit function--Id like to be able to upload stats to a website somewhere...
#
function doexit
{
echo - n "Send success/fail info to sbrac.org?"
read ans
case $ ans in
y | Y | YES | yes | Yes )
wget http : //www.sbrac.org/bgrstats.php?status="$1"?systype=${SYSTYPE}?sysinfo="`uname -a`" >/dev/null 2>&1
echo Thanks
; ;
esac
exit
}
function help {
cat & lt ; & lt ; ! EOF !
 
Usage : build - gnuradio [ -- help | - h ] [ - v | -- verbose ] [ - jN ] [ - ja ]
[ - l | -- logfile logfile ] [ - u | -- users ulist ] [ - m ] funcs
 
- m - Use HEAD of master branch , rather than 3.7.1. Use compatible extras as well
- o - User v3 . 6.5.1 and compatible extras .
 
- v | -- verbose - turn on verbose logging to stdout
 
- jN - have make use N concurrent jobs
 
- ja - have make use N concurrent jobs with auto setting of N
( based on number of cpu cores on build system )
 
- josh - use Josh Blums enhanced Gnu Radio GIT repo
 
- u | -- users ul - add comma - separated users to 'usrp' group in addition
to calling user ( $ USER )
 
- l | -- logfile lf - log messages to 'lf'
- ut - set tag for UHD checkout to
- gt - set tag for Gnu Radio checkout to
- e | -- extras - add an item to "extras" to be built after Gnu Radio / UHD / gs - osmosdr
available funcs are :
 
all - do all functions
prereqs - install prerequisites
gitfetch - use GIT to fetch Gnu Radio and UHD
uhd_build - build only UHD
firmware - fetch firmware / FPGA
gnuradio_build - build only Gnu Radio
mod_groups - modify the / etc / groups and add user to group 'usrp'
mod_udev - add UDEV rule for USRP1
mod_sysctl - modify SYSCTL for larger net buffers
! EOF !
 
}
 
if [ $ USER = root - o $ UID - eq 0 ]
then
echo Please run this script as an ordinary user
echo it will acquire root privileges as it needs them via \" sudo \" .
exit
fi
 
VERBOSE = No
JFLAG = ""
LOGDEV = / dev / null
USERSLIST = None
JOSHMODE = False
UTAG = None
GTAG = None
export LC_LANG = C
EXTRAS = ""
MASTER_MODE = 0
OLD_MODE = 0
PULLED_LIST = "gnuradio uhd rtl-sdr gr-osmosdr gr-iqbal hackrf gr-baz bladeRF"
which python3 & gt ; / dev / null 2 & gt ; & amp ; 1
if [ $ ? - eq 0 ]
then
CMAKE_FLAG1 = - DPythonLibs_FIND_VERSION : STRING = "2.7"
CMAKE_FLAG2 = - DPythonInterp_FIND_VERSION : STRING = "2.7"
fi
while :
do
case $ 1 in
- ja )
cnt = ` grep 'processor.*:' / proc / cpuinfo | wc - l `
cnt = ` expr $ cnt - 1 `
if [ $ cnt - lt 1 ]
then
cnt = 1
fi
JFLAG = - j $ cnt
shift
; ;
 
- j [ 123456789 ] )
JFLAG = $ 1
shift
; ;
 
- josh )
JOSHMODE = True
shift
; ;
 
- v | -- verbose )
LOGDEV = / dev / stdout
shift
; ;
 
- l | -- logfile )
case $ 2 in
/*)
LOGDEV=$2
;;
*)
LOGDEV=`pwd`/$2
;;
esac
shift
shift
rm -f $LOGDEV
echo $LOGDEV Starts at: `date` >>$LOGDEV 2>&1
;;
 
-u|--users)
USERSLIST=$2
shift
shift
;;
 
-m|--master)
MASTER_MODE=1
shift
;;
 
-o|--old)
OLD_MODE=1
shift
;;
 
-h|--help)
help
exit
;;
 
-ut)
UTAG=$2
shift
shift
;;
 
-gt)
GTAG=$2
shift
shift
;;
 
-e|--extras)
EXTRAS=$EXTRAS" "$2
shift 2
;;
 
-*)
echo Unrecognized option: $1
echo
help
exit
break
;;
*)
break
;;
esac
done
 
CWD=`pwd`
SUDOASKED=n
SYSTYPE=unknown
good_to_go=no
for files in /etc/fedora-release /etc/linuxmint/info /etc/lsb-release /etc/debian_version /etc/redhat-release
do
if [ -f $file ]
then
good_to_go=yes
fi
done
if [ $good_to_go = no ]
then
echo Supported systems: Fedora, Ubuntu, Redhat, Debian, Mint, OpenSuse
echo You appear to be running none of the above, exiting
exit
fi
 
echo This script will install Gnu Radio from current GIT sources
echo You will require Internet access from the computer on which this
echo script runs. You will also require SUDO access. You will require
echo approximately 500MB of free disk space to perform the build.
echo " "
echo This script will, as a side-effect, remove any existing Gnu Radio
echo installation that was installed from your Linux distribution packages.
echo It must do this to prevent problems due to interference between
echo a linux-distribution-installed Gnu Radio/UHD and one installed from GIT source.
echo " "
echo The whole process may take up to two hours to complete, depending on the
echo capabilities of your system.
echo
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo NOTE: if you run into problems while running this script, you can re-run it with
echo the --verbose option to produce lots of diagnostic output to help debug problems.
echo This script has been written to anticipate some of the more common problems one might
echo encounter building ANY large, complex software package. But it is not pefect, and
echo there are certainly some situations it could encounter that it cannot deal with
echo gracefully. Altering the system configuration from something reasonably standard,
echo removing parts of the filesystem, moving system libraries around arbitrarily, etc,
echo it likely cannot cope with. It is just a script. It isn\'t intuitive or artificially
echo intelligent. It tries to make life a little easier for you, but at the end of the day
echo if it runs into trouble, a certain amount of knowledge on your part about
echo system configuration and idiosyncrasies will inevitably be necessary.
echo
echo
echo -n Proceed?
 
read ans
case $ans in
y|Y|YES|yes|Yes)
PROCEED=y
;;
*)
exit
esac
 
SPACE=`df $HOME| grep -v blocks|grep '%'`
SPACE=`echo $SPACE | awk '/./ {n=NF-2; printf ("%d\n", $n/1.0e3)}'`
 
if [ $SPACE -lt 500 ]
then
echo "You don't appear to have enough free disk space on $HOME"
echo to complete this build/install
echo exiting
doexit DISKSPACE
fi
 
total=0
for file in $PULLED_LIST
do
found=0
for instance in ${file}.20*
do
if [ -d $instance ]
then
found=1
sz=`du -s $instance|awk '{print $1}'`
total=`expr $total + $sz`
fi
done
done
total=`expr $total '*' 1024`
total=`expr $total / 1000000`
if [ $total -gt 100 ]
then
echo Your old 'uhd.*' and 'gnuradio.*' etc directories are using roughly $total MB
echo of disk space:
for file in $PULLED_LIST
do
for instance in ${file}.20*
do
if [ -d $instance ]
then
ls -ld $instance
fi
done
done
echo " "
echo -n Remove them'?'
read ans
 
case $ans in
y|Y|YES|yes|Yes)
for file in $PULLED_LIST
do
for instance in ${file}.20*
do
if [ -d $instance ]
then
echo removing ${instance}
rm -rf ${instance}
fi
done
done
echo Done
;;
esac
fi
rm -rf *.20*.bgmoved
 
function my_echo {
if [ $LOGDEV = /dev/stdout ]
then
echo $*
else
echo $*
echo $* >>$LOGDEV 2>&1
fi
}
 
function checkcmd {
found=0
which $1 >/dev/null 2>&1
x=$?
if [ $x -eq 0 ]
then
found=1
fi
for place in /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin /opt/bin /opt/local/bin
do
if [ -e $place/$1 ]
then
found=1
fi
done
if [ $found -eq 0 ]
then
which $1 >/dev/null 2>&1
if [ $? -eq 0 ]
then
found=1
fi
fi
if [ $found -eq 0 ]
then
my_echo Failed to find just-installed command \'$1\' after pre-requisite installation.
my_echo This very likely indicates that the pre-requisite installation failed
my_echo to install one or more critical pre-requisites for Gnu Radio/UHD
doexit PREREQFAIL-CMD-$1
fi
}
 
function checklib {
found=0
my_echo -n Checking for library $1 ...
for dir in /lib /usr/lib /usr/lib64 /lib64 /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu \
/usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabi
do
for file in $dir/${1}*.so*
do
if [ -e "$file" ]
then
found=1
fi
done
done
if [ $found -le 0 ]
then
my_echo Failed to find libraries with prefix \'$1\' after pre-requisite installation.
my_echo This very likely indicates that the pre-requisite installation failed
my_echo to install one or more critical pre-requisites for Gnu Radio/UHD
my_echo exiting build
doexit PREREQFAIL-LIB-$1
else
my_echo Found library $1
fi
}
 
function checkpkg {
my_echo Checking for package $1
if [ `apt-cache search $1 | wc -l` -eq 0 ]
then
my_echo Failed to find package \'$1\' in known package repositories
my_echo Perhaps you need to add the Ubuntu universe or multiverse PPA?
my_echo see https://help.ubuntu.com/community/Repositories/Ubuntu
my_echo exiting build
doexit PREREQFAIL-PKG-$1
fi
}
 
function prereqs {
sudocheck
my_echo Installing prerequisites.
my_echo "====>" THIS MAY TAKE QUITE SOME TIME "<=====" # # It's a Fedora system # if [ -f /etc/fedora-release ] then SYSTYPE=Fedora case `cat /etc/fedora-release` in *12*|*13*|*14*|*15*|*16*|*17*|*18*) sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1
sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1
sudo yum -y install fftw-devel cppunit-devel wxPython-devel \
boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \
python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \
PyQt4-devel qwt-devel qwtplot3d-qt4-devel libusb-devel libusb \
libusb1 libusb1-devel cmake git wget python-docutils \
PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc \
orc-devel python-sphinx SDL-devel swig >>$LOGDEV 2>&1
;;
 
*19*|*20*)
sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1
sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1
sudo yum -y install fftw-devel cppunit-devel wxPython-devel \
boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \
python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \
PyQt4-devel qwt-devel qwtplot3d-qt4-devel \
libusbx-devel cmake git wget python-docutils \
PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc \
orc-devel python-sphinx SDL-devel swig >>$LOGDEV 2>&1
;;
*)
my_echo Only Fedora release 12 - 20 are supported by this script
doexit WRONGRELEASE
;;
esac
 
#
# It's a RedHat system
elif [ -f /etc/redhat-release ]
then
SYSTYPE=Redhat
case `cat /etc/redhat-release` in
*elease*6*)
sudo yum -y erase 'gnuradio*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel-*' >>$LOGDEV 2>&1
sudo yum -y erase 'libgruel*' >>$LOGDEV 2>&1
sudo yum -y groupinstall "Engineering and Scientific" "Development Tools" >>$LOGDEV 2>&1
sudo yum -y install fftw-devel cppunit-devel wxPython-devel libusb-devel \
boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \
python-cheetah python-lxml PyOpenGL qt-devel qt qt4 qt4-devel \
PyQt4-devel qwt-devel qwtplot3d-qt4-devel libusb libusb-devel \
libusb1 libusb1-devel cmake git wget python-docutils \
PyQwt PyQwt-devel qwt-devel gtk2-engines xmlrpc-c-"*" tkinter orc >>$LOGDEV 2>&1
;;
*)
my_echo Your Redhat system release must be release 6 to proceed
doexit WRONGRELEASE
;;
esac
 
#
# It's a Mint system
#
elif [ -f /etc/linuxmint/info ]
then
SYSTYPE=Mint
sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1
case `grep RELEASE /etc/linuxmint/info` in
*11*|*12*|*13*|*14*|*15*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk
liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2"
;;
 
*)
my_echo Your Mint release must be at least Linux Mint 11 to proceed
doexit WRONGRELEASE
;;
esac
for pkg in $PKGLIST; do checkpkg $pkg; done
sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1
 
#
# It's a Ubuntu system
#
elif [ -f /etc/lsb-release -a ! -f /etc/SuSE-release ]
then
SYSTYPE=Ubuntu
sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1
case `grep DISTRIB_RELEASE /etc/lsb-release` in
*13.*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk
liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2"
CMAKE_FLAG1=-DPythonLibs_FIND_VERSION:STRING="2.7"
CMAKE_FLAG2=-DPythonInterp_FIND_VERSION:STRING="2.7"
;;
 
*11.*|*12.10*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk
liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2"
CMAKE_FLAG1=-DPythonLibs_FIND_VERSION:STRING="2.7"
CMAKE_FLAG2=-DPythonInterp_FIND_VERSION:STRING="2.7"
;;
 
*12.04*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost1.48-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk
liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2"
;;
 
*10.04*|*10.10*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget python-docutils gtk2-engines-pixbuf python-tk libasound2-dev python-gtk2"
;;
 
*9.10*)
PKGLIST="swig g++ automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost1.38-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools
cmake git wget python-docutils python-tk libasound2-dev"
;;
 
*9.04*)
sudo apt-get purge python-wxgtk2.6
PKGLIST="swig g++ automake1.9 autoconf libtool python-dev fftw3-dev
libcppunit-dev libboost1.35-dev libusb-dev libusb-1.0-0-dev
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools
cmake git wget python-docutils python-tk libasound2-dev"
;;
 
*)
my_echo Your Ubuntu release must be at least 9.04 to proceed
doexit WRONGRELEASE
;;
esac
for pkg in $PKGLIST; do checkpkg $pkg; done
my_echo Done checking packages
sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1
#
# It's a Debian system
#
elif [ -f /etc/debian_version ]
then
SYSTYPE=Debian
sudo apt-get -y purge 'gnuradio-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel-*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgruel0*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'libgnuradio*' >>$LOGDEV 2>&1
sudo apt-get -y purge 'python-gnuradio*' >>$LOGDEV 2>&1
case `cat /etc/debian_version` in
*6.0*|*wheezy*|*sid*|*7.1*|*7.0*|*7.2*|*7.3*|*7.4*)
PKGLIST="libfontconfig1-dev libxrender-dev libpulse-dev swig g++
automake autoconf libtool python-dev libfftw3-dev
libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77
libsdl1.2-dev python-wxgtk2.8 git-core
libqt4-dev python-numpy ccache python-opengl libgsl0-dev
python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4
cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk
liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libportaudio2 portaudio19-dev
ca-certificates"
;;
*)
my_echo Unsupported Debian version `cat /etc/debian_version`
doexit WRONGRELEASE
;;
esac
for pkg in $PKGLIST; do checkpkg $pkg; done
sudo apt-get -y --ignore-missing install $PKGLIST >>$LOGDEV 2>&1
elif [ -f /etc/SuSE-release ]
then
SYSTYPE=OpenSuSE
if grep -q 12.1 /etc/SuSE-release
then
cool=1
else
my_echo Only OpenSuSE 12.1 is supported by this script
doexit WRONGRELEASE
fi
sudo zypper install cmake cppunit-devel doxygen fftw3-devel \
git gsl-devel libjack-devel libqt4-devel libqwtplot3d-devel \
libSDL-devel libusb-1_0-devel orc portaudio portaudio-devel \
python-cheetah python-devel python-lxml python-wxGTK python-wxWidgets-devel \
qwt-devel wxWidgets-devel boost-devel xmlto texlive-latex >>$LOGDEV 2>&1
 
else
my_echo This script supports only Ubuntu,Mint,Fedora, Debian and OpenSuse systems
my_echo Your Fedora system must be at least Fedora 12
my_echo Your Ubuntu system must be at least Ubuntu 9.04
my_echo Your Mint system must be at least Mint 11
my_echo Your Debian system must be release 6
doexit WRONGSYSTEM
fi
PATH=$PATH
export PATH
 
checkcmd git
checkcmd cmake
 
if [ $SYSTYPE = Fedora ]
then
checklib libusb-0 0
checklib libusb-1 0
else
checklib libusb 2
fi
 
checklib libboost 5
checklib libcppunit 0
checklib libfftw 5
checklib libgsl 0
 
my_echo Done
}
 
function gitfetch {
date=`date +%Y%m%d%H%M%S`
V=3.7/maint
if [ $MASTER_MODE -eq 1 ]
then
V=Master/HEAD
fi
if [ $OLD_MODE -eq 1 ]
then
V=3.6.5.1
fi
echo This script will fetch Gnu Radio version $V from the repositories, along with compatible
echo extras.
echo -n Is this OK?
read ans
 
case $ans in
Y|y|YES|yes|Yes)
;;
*)
exit
;;
esac
 
my_echo "Fetching various packages (Gnu Radio, UHD, gr-osmosdr, gr-iqbal, etc)"
my_echo " via the Internet"
my_echo "=======> THIS MAY TAKE QUITE SOME TIME <=========" cd $CWD for dir in ${PULLED_LIST} do if [ -d $dir ] then mv $dir ${dir}.$date fi done # # GIT the gnu radio source tree # my_echo -n Fetching Gnu Radio via GIT... if [ $JOSHMODE = False ] then #git clone --progress http://gnuradio.org/git/gnuradio.git >>$LOGDEV 2>&1
#if [ ! -d gnuradio/gnuradio-core -a ! -d gnuradio/gnuradio-runtime ]
#then
# my_echo "Could not find gnuradio/gnuradio-{core,runtime} after GIT checkout"
# my_echo GIT checkout of Gnu Radio failed!
# doexit FETCH-GR-FAIL
#fi
if [ $OLD_MODE -eq 1 ]
then
cd gnuradio
git checkout v3.6.5.1 >>$LOGDEV 2>&1
cd $CWD
elif [ $MASTER_MODE -eq 0 ]
then
cd gnuradio
git checkout maint >>$LOGDEV 2>&1
cd $CWD
fi
 
if [ $GTAG != None ]
then
cd gnuradio
git checkout $GTAG >/dev/null 2>&1
git name-rev HEAD >tmp$$ 2>&1
if grep -q "HEAD tags/$GTAG" tmp$$
then
whee=yes
rm -f tmp$$
else
my_echo Could not fetch Gnu Radio tagged $GTAG from GIT
rm -f tmp$$
doexit FETCH-GR-FAIL-$GTAG
fi
cd ..
fi
else
git clone --progress git://gnuradio.org/jblum.git >>$LOGDEV 2>&1
if [ $GTAG != "None" ]
then
git checkout $GTAG
else
git checkout next
fi
if [ ! -d jblum/gnuradio-core ]
then
my_echo GIT checkout of Gnu Radio from jblum.git failed!
doexit FETCH-GR-JOSH-FAIL
fi
fi
my_echo Done
 
#
# GIT the UHD source tree
#
rm -rf uhd
my_echo -n Fetching UHD via GIT...
git clone --progress http://github.com/EttusResearch/uhd >>$LOGDEV 2>&1
 
if [ ! -d uhd/host ]
then
my_echo GIT checkout of UHD FAILED
rm -f tmp$$
doexit FETCH-UHD-FAIL
fi
if [ $UTAG != None ]
then
cd uhd
git checkout $UTAG >/dev/null 2>&1
git status >tmp$$ 2>&1
if grep -q "On branch $UTAG" tmp$$
then
whee=yes
rm -f tmp$$
else
my_echo Could not fetch UHD tagged $UTAG from GIT
rm -f tmp$$
fi
cd ..
fi
 
#
# GIT the RTL-SDR source tree
#
rm -rf rtl-sdr
rm -rf gr-osmosdr
rm -rf gr-baz
rm -rf hackrf
rm -rf bladeRF
my_echo Fetching rtl-sdr "(rtl-sdr, gr-osmosdr, gr-iqbal, hackrf and bladeRF)" via GIT
git clone --progress git://git.osmocom.org/rtl-sdr >>$LOGDEV 2>&1
git clone --progress git://git.osmocom.org/gr-osmosdr >>$LOGDEV 2>&1
git clone --progress git://git.osmocom.org/gr-iqbal.git >>$LOGDEV 2>&1
git clone https://github.com/Nuand/bladeRF.git >>$LOGDEV 2>&1
if [ -d gr-iqbal ]
then
cd gr-iqbal
if [ $OLD_MODE -eq 1 ]
then
git checkout gr3.6
fi
git submodule init >>$LOGDEV 2>&1
git submodule update >>$LOGDEV 2>&1
cd ..
fi
git clone --progress http://github.com/mossmann/hackrf.git >>$LOGDEV 2>&1
my_echo Done
}
 
function uhd_build {
#
# UHD build
#
sudocheck
if [ ! -d uhd ]
then
my_echo you do not appear to have the \'uhd\' directory
my_echo you should probably use $0 gitfetch to fetch the appropriate
my_echo files using GIT
doexit BUILD-UHD-NOT-THERE
fi
if [ $UTAG != None ]
then
cd uhd
git checkout $UTAG >/dev/null 2>&1
cd ..
fi
my_echo Building UHD...
my_echo "=============> THIS WILL TAKE SOME TIME <=============" my_echo cd uhd/host if [ ! -d build ] then mkdir build fi cd build make clean >/dev/null 2>&1
cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 ../ >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make $JFLAG >>$LOGDEV 2>&1
if [ $? -ne 0 ]
then
my_echo UHD build apparently failed
my_echo Exiting UHD build
doexit UHD-BUILD-FAIL1
fi
sudo make $JFLAG install >>$LOGDEV 2>&1
which uhd_find_devices >/dev/null 2>&1
x=$?
if [ $x -ne 0 -a ! -f /usr/local/bin/uhd_find_devices -a ! -f /opt/local/bin/uhd_find_devices ]
then
my_echo UHD build/install apparently failed since I cannot find /usr/local/bin/uhd_find_devices
my_echo after doing make and make install
my_echo Exiting UHD build
doexit UHD-BUILD-FAIL2
fi
sudo ldconfig >>$LOGDEV 2>&1
my_echo Done building/installing UHD
}
 
function rtl_build {
#
# RTL build
#
sudocheck
cd $CWD
if [ ! -d rtl-sdr ]
then
my_echo you do not appear to have the \'rtl-sdr\' directory
my_echo you should probably use $0 gitfetch to fetch the appropriate
my_echo files using GIT
doexit BUILD-RTL-NOT-THERE
fi
 
my_echo -n Building rtl-sdr...
cd rtl-sdr
cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 . >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make $JFLAG >>$LOGDEV 2>&1
 
if [ $? -ne 0 ]
then
my_echo rtl-sdr build apparently failed
my_echo Exiting rtl-sdr build
doexit RTL-BUILD-FAIL1
fi
sudo make $JFLAG install >>$LOGDEV 2>&1
my_echo Done building rtl-sdr
 
cd $CWD
if [ -d hackrf ]
then
my_echo -n Building hackrf...
cd hackrf
cmake $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 host/ >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make >>$LOGDEV 2>&1
if [ $? -ne 0 ]
then
my_echo hackrf build failed
my_echo Exiting hackrf build
else
sudo make install >>$LOGDEV 2>&1
fi
my_echo Done building hackrf
cd $CWD
fi
cd $CWD
if [ -d gr-iqbal ]
then
my_echo -n Building gr-iqbal...
cd gr-iqbal
mkdir -p build
cd build
cmake .. $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make >>$LOGDEV 2>&1
if [ $? -ne 0 ]
then
my_echo gr-iqbal build apparently failed
my_echo Exiting gr-iqbal build
else
sudo make install >>$LOGDEV 2>&1
cd $CWD
my_echo Done building gr-iqbal
fi
fi
if [ -d bladeRF ]
then
my_echo -n Building bladeRF...
cd bladeRF
cd host
cmake . $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make >>$LOGDEV 2>&1
if [ $? -ne 0 ]
then
my_echo bladeRF build apparently failed
my_echo Exiting bladeRF build
else
sudo make install >>$LOGDEV 2>&1
cd $CWD
my_echo Done building bladeRF
fi
fi
 
cd $CWD
if [ ! -d gr-osmosdr ]
then
my_echo you do not appear to have the \'gr-osmosdr\' directory
my_echo you should probably use $0 gitfetch to fetch the appropriate
my_echo files using GIT
doexit RTL-BUILD-FAIL2
fi
cd gr-osmosdr
if [ $OLD_MODE -eq 1 ]
then
git checkout gr3.6 >/dev/null 2>&1
fi
my_echo -n Building gr-osmosdr...
cmake . $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 >>$LOGDEV 2>&1
make clean >>$LOGDEV 2>&1
make $JFLAG >>$LOGDEV 2>&1
 
if [ $? -ne 0 ]
then
my_echo gr-osmosdr build apparently failed
my_echo Exit rtl-sdr/gr-osmosdr build
doexit OSMOSDR-BUILD-FAIL
fi
sudo make $JFLAG install >>$LOGDEV 2>&1
my_echo Done building gr-osmosdr
sudo ldconfig >>$LOGDEV 2>&1
 
cd $CWD
my_echo Done building/installing rtl-sdr/gr-osmosdr
}
 
function firmware {
sudocheck
FOUND_DOWNLOADER=False
dirlist="/usr/local/share /usr/local/lib /usr/local/lib64"
prog=uhd_images_downloader.py
 
for dir in $dirlist
do
if [ -f $dir/uhd/utils/$prog ]
then
FOUND_DOWNLOADER=True
DOWNLOADER=$dir/uhd/utils/$prog
fi
done
 
if [ $FOUND_DOWNLOADER = True ]
then
sudo $DOWNLOADER
else
my_echo Could not find images downloader: $prog in any of $dirlist
doexit UHD-FIRMWARE-FAIL
fi
my_echo Done downloading firmware to /usr/local/share/uhd/images
}
 
function gnuradio_build {
sudocheck
 
if [ $JOSHMODE = False ]
then
if [ ! -d gnuradio ]
then
my_echo you do not appear to have the \'gnuradio\' directory
my_echo you should probably use $0 gitfetch to fetch the appropriate
my_echo files using GIT
doexit GNURADIO-BUILD-NOT-THERE
fi
if [ $GTAG != None ]
then
cd gnuradio
git checkout $GTAG >/dev/null 2>&1
cd ..
fi
else
if [ ! -d jblum ]
then
my_echo you do not appear to have the \'jblum\' directory
my_echo you should probably use $0 gitfetch to fetch the appropriate
my_echo files using GIT
doexit GNURADIO-BUILD-NO-JOSH
fi
fi
 
#
# LD stuff
#
my_echo /usr/local/lib >tmp$$
my_echo /usr/local/lib64 >>tmp$$
 
if grep -q /usr/local/lib /etc/ld.so.conf.d/*
then
my_echo /usr/local/lib already in ld.so.conf.d
else
sudo cp tmp$$ /etc/ld.so.conf.d/local.conf
fi
rm -f tmp$$
my_echo Doing ldconfig...
sudo ldconfig >/dev/null 2>&1
 
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 
if [ -d /usr/local/lib64/pkgconfig ]
then
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
fi
 
export PKG_CONFIG_PATH
 
#
# Build Gnuradio
#
if [ $JOSHMODE = False ]
then
cd gnuradio
else
cd jblum
git checkout gr_basic >>$LOGDEV 2>&1
fi
 
my_echo Building Gnu Radio...
my_echo "=========> THIS WILL TAKE QUITE A WHILE <=============" my_echo " " my_echo ...Doing cmake if [ -d build ] then my_echo ...build directory already here else mkdir build fi cd build make clean >/dev/null 2>&1
my_echo ...Cmaking
cmake -DENABLE_BAD_BOOST=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKE_FLAG1 $CMAKE_FLAG2 $CMF1 $CMF2 ../ >>$LOGDEV 2>&1
my_echo ...Building
make $JFLAG clean >>$LOGDEV 2>&1
make $JFLAG >>$LOGDEV 2>&1
if [ $? -ne 0 ]
then
my_echo make failed
my_echo Exiting Gnu Radio build/install
doexit GNURADIO-BUILD-FAIL
fi
my_echo ...Installing
sudo rm -rf /usr/local/include/gnuradio/
sudo rm -f /usr/local/lib*/ libgnuradio*
sudo make $ JFLAG install & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
sudo ldconfig & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
my_echo Done building and installing Gnu Radio
my_echo - n GRC freedesktop icons install . . .
if [ - f / usr / local / libexec / gnuradio / grc_setup _freedesktop ]
then
sudo chmod 755 / usr / local / libexec / gnuradio / grc_setup_freedesktop
sudo / usr / local / libexec / gnuradio / grc_setup_freedesktop install & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
fi
my_echo Done
}
 
function do_an_extra {
if [ - e $ 1 ]
then
my_echo Building extra module $ 1
cd $ 1
if [ - f CMakeLists . txt ]
then
mkdir - p build & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
cd build
cmake . . $ CMAKE _FLAGS1 $ CMAKE _FLAGS2 $ CMF1 $ CMF2 & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
make & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
sudo make install & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
sudo ldconfig
elif [ - bootstrap ]
then
chmod 755 bootstrap
. / bootstrap & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
PKG_CONFIG_PATH = / usr / local / lib / pkgconfig : / usr / local / lib64 / pkgconfig
. / configure & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
make & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
sudo make install & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
sudo ldconfig
else
my_echo Couldnt determine how to make module $ 1 neither bootstrap nor CmakeLists . txt present
fi
else
my_echo Couldnt build module $ 1 directory not there
fi
}
 
function extras {
sudocheck
date = ` date + % Y % m % d % H % M % S `
if [ ! "@$EXTRAS@" = "@@" ]
then
for module in $ EXTRAS
do
cd $ CWD
base = ` basename $ module . git `
case $ module in
git : * | * . git )
mv $ base $ base . $ date . bgmoved & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
my_echo Doing GIT checkout for extra module $ base
git clone $ module & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
do_an _extra $ base
; ;
htt* : * svn* )
mv $ base $ base . $ date & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
my_echo Doing SVN checkout for extra module $ base
svn co $ module & gt ; & gt ; $ LOGDEV 2 & gt ; & amp ; 1
if [ - e $ base / trunk ]
then
do_an _extra $ base / trunk
else
do_an _extra $ base
fi
; ;
* )
my_echo Ignoring malformed extra module $ module
; ;
esac
 
done
fi
cd $ CWD
}
 
function mod_groups {
sudocheck
#
# Post install stuff
#
# USRP rules for UDEV and USRP group
#
#
# Check for USRP group, and update if necessary
if grep - q usrp / etc / group
then
my_echo Group \' usrp \' already in / etc / group
else
sudo / usr / sbin / groupadd usrp
fi
 
#
# Check that our calling user is in the USRP group, update if necessary
#
if grep - q usrp . * $ { USER } / etc / group
then
my_echo User $ USER already in group \' usrp \'
else
sudo / usr / sbin / usermod - a - G usrp $ USER
cat & lt ; & lt ; "!EOF!" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This script has just modified / etc / group to place your userid '(' $ USER ')' into group 'usrp' In order for this change to take effect , you will need to log - out and log back in again . You will not be able to access your USRP1 device until you do this . If you wish to allow others on your system to use the USRP1 device , you will need to use : sudo usermod - a - G usrp userid For each userid you wish to allow access to the usrp * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Further ! EOF ! fi if [ "$USERSLIST" = None ] then foo = bar else ul = ` echo $ USERSLIST | sed - e 's/,/ /g' ` for u in $ ul do sudo / usr / sbin / usermod - a - G usrp $ u my_echo Added $ u to group usrp done fi } function mod_udev { sudocheck # # Check for UHD UDEV rules file, update if exists # if [ -f $CWD/uhd/host/utils/uhd-usrp.rules ] then sudo cp $CWD/uhd/host/utils/uhd-usrp.rules /etc/udev/rules.d/10-usrp.rules sudo chown root /etc/udev/rules.d/10-usrp.rules sudo chgrp root /etc/udev/rules.d/10-usrp.rules fi # # Check for rtl-sdr UDEV rules file, update if exists # rm -f tmp$$ if [ -f $CWD/rtl-sdr/rtl-sdr.rules ] then sudo cp $CWD/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/15-rtl-sdr.rules sudo chown root /etc/udev/rules.d/15-rtl-sdr.rules sudo chgrp root /etc/udev/rules.d/15-rtl-sdr.rules fi sudo killall -HUP udevd sudo udevadm control --reload-rules } function mod_sysctl { sudocheck # # Modify sysctl.conf as necessary # cat >tmp$$ <<!EOF! # Updates for Gnu Radio net.core.rmem_max = 1000000 net.core.wmem_max = 1000000 kernel.shmmax = 2147483648 !EOF! if grep -q 'Updates for Gnu Radio' /etc/sysctl.conf then my_echo Required updates to /etc/sysctl.conf already in place else my_echo Applying updates to /etc/sysctl.conf cat /etc/sysctl.conf tmp$$ >tmp2$$
chmod 644 tmp2 $ $
sudo mv tmp2 $ $ / etc / sysctl . conf
fi
 
sudo sysctl - w net . core . rmem_max = 1000000 & gt ; / dev / null 2 & gt ; & amp ; 1
sudo sysctl - w net . core . wmem_max = 1000000 & gt ; / dev / null 2 & gt ; & amp ; 1
sudo sysctl - w kernel . shmmax = 2147483648 & gt ; / dev / null 2 & gt ; & amp ; 1
 
rm - f tmp $ $
rm - f tmp2 $ $
 
if grep - q usrp / etc / security / limits . conf
then
my_echo usrp group already has real - time scheduling privilege
else
cat & gt ; tmp $ $ & lt ; & lt ; ! EOF ! @ usrp - rtprio 50 ! EOF ! cat / etc / security / limits . conf tmp $ $ & gt ; tmp2 $ $
sudo cp tmp2 $ $ / etc / security / limits . conf
sudo chmod 644 / etc / security / limits . conf
rm - f tmp $ $ tmp2 $ $
my_echo Group \' usrp \' now has real - time scheduling privileges
my_echo You will need to log - out and back in again for this to
my_echo take effect
fi
}
 
function all {
my_echo Starting all functions at : ` date `
cd $ CWD
prereqs
touch - d "15 minutes ago" touch $ $
if [ - d uhd - a - d gnuradio ]
then
if [ uhd - ot touch $ $ - o gnuradio - ot touch $ $ ]
then
echo 'simpower91 modified here'
echo 'Do you want to skip downloading from the internet?[yes]'
read simskip
if [ "$simskip" a = 'no' a ]
then
gitfetch
fi
echo 'simpower91 modified end'
else
my_echo Skipping git fetch , since \' uhd \' and \' gnuradio \' are new enough
fi
else
gitfetch
fi
rm - f touch $ $
EXTRAS = $ EXTRAS " http://github.com/balint256/gr-baz.git"
EXTRAS = $ EXTRAS " http://github.com/guruofquality/grextras.git"
for fcn in uhd_build firmware gnuradio_build rtl_build extras mod_groups mod_udev mod_sysctl pythonpath
do
my_echo Starting function $ fcn at : ` date `
cd $ CWD
$ fcn
my_echo Done function $ fcn at : ` date `
done
my_echo Done all functions at : ` date `
}
 
function pythonpath {
for PYVER in 2.6 2.7
do
for type in "" 64
do
if [ - d / usr / local / lib $ { type } / python $ { PYVER } / site - packages / gnuradio ]
then
PYTHONPATH = / usr / local / lib $ { type } / python $ { PYVER } / site - packages
fi
if [ - d / usr / local / lib $ { type } / python $ { PYVER } / dist - packages / gnuradio ]
then
PYTHONPATH = / usr / local / lib $ { type } / python $ { PYVER } / dist - packages
fi
done
done
echo
echo
echo "************************************************************"
echo You should probably set your PYTHONPATH to :
echo " "
echo " " $ PYTHONPATH
echo " "
echo Using :
echo " "
echo export PYTHONPATH = $ PYTHONPATH
echo " "
echo in your . bashrc or equivalent file prior to attempting to run
echo any Gnu Radio applications or Gnu Radio Companion .
echo "*************************************************************"
}
 
function sudocheck {
#
# Check SUDO privileges
#
if [ $ SUDOASKED = n ]
then
echo SUDO privileges are required
echo - n Do you have SUDO privileges '?'
read ans
case $ ans in
y | Y | YES | yes | Yes )
echo Continuing with script
SUDOASKED = y
sudo grep timestamp_timeout / etc / sudoers & gt ; tmp $ $
timeout = ` cat tmp $ $ | awk '/./ {print $4}' `
rm - f tmp $ $
if [ "@@" = "@$timeout@" ]
then
sudo cp / etc / sudoers tmp $ $
sudo chown $ USER tmp $ $
sudo chmod 644 tmp $ $
echo "Defaults timestamp_timeout = 90" & gt ; & gt ; tmp $ $
sudo cp tmp $ $ / etc / sudoers
sudo chown root / etc / sudoers
sudo chmod 440 / etc / sudoers
elif [ "$timeout" - lt 90 ]
then
echo You need to have a timestamp_timout in / etc / sudoers of 90 or more
echo Please ensure that your timestamp_timeout is 90 or more
exit
fi
; ;
* )
echo Exiting . Please ensure that you have SUDO privileges on this system !
exit
; ;
esac
fi
}
 
PATH = $ PATH
export PATH
case $ # in
0 )
all
my_echo All Done
doexit SUCCESS
esac
 
for arg in $ *
do
cd $ CWD
$ arg
done
my_echo All Done
doexit SUCCESS
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值