This file is indexed.

/usr/bin/bladeRF-install-firmware is in bladerf 0.2016.06-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
#!/bin/sh
#
# Title      :	bladeRF-install-firmware
# Purpose    :  fetch non-free BladeRF firmware
# Author     :	A. Maitland Bottoms <bottoms@debian.org>
# Date       :	2013-10-10
# Update     :	2016-01-12
#
# Copyright 2013-2015 A. Maitland Bottoms <bottoms@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

set -e

show_usage()
{
    echo "Usage: $0 [-i imagedir] [imagetarball]" >&2
    exit 1
}

FX3UPSTREAM='https://www.nuand.com/fx3/bladeRF_fw_v1.9.0.img'
FX3CHECKSUM='9fd35cdced2a33a08a724ee5162ee6b9'
FX3IMGFILE=/usr/share/Nuand/bladeRF/bladeRF_fw.img

FPGA115UPSTREAM='https://www.nuand.com/fpga/v0.5.0/hostedx115.rbf'
FPGA115CHECKSUM='8af6607afdcf9b00ddae8fbd2cf2eafa'
FPGA115RBFFILE=/usr/share/Nuand/bladeRF/hostedx115.rbf

FPGA40UPSTREAM='https://www.nuand.com/fpga/v0.5.0/hostedx40.rbf'
FPGA40CHECKSUM='af8ea27b4f545113db3d9b6d986f6525'
FPGA40RBFFILE=/usr/share/Nuand/bladeRF/hostedx40.rbf

# Default values:
# The imagedir is the path bladerf-host and libbladerf packages
# use to find firmware.
imagedir="/usr/share/Nuand/bladeRF"
# The imagetarball is the source of firmware built with matching
# source code.
fpgaimageurl=""
usbimageurl=""
while [ "$1" != "" ]; do
    case $1 in
        -h | --help )           show_usage
                                exit 0
                                ;;
        -i | --imagedir )       shift
	                        imagedir=$1
                                ;;
        -f | --fpgafile )       shift
                                fpgaimageurl=$1
                                ;;
        -u | --usbfile )        shift
                                usbimageurl=$1
                                ;;
        * )                     fpgaimageurl=$1
                                ;;
    esac
    shift
done

if mkdir -p $imagedir ; then
    if [ -w $imagedir ] ;then
	echo Using imagedir: $imagedir
    else
	echo You need to run this script as a user who can write to $imagedir
	exit 1
    fi
else
    echo You need to run this script as a user who can create $imagedir
    exit 1
fi

tdir=`mktemp -d`
fetchlist=""
echo "Using tempdir:" $tdir
if [ "x$fpgaimageurl" = "x" ] && [ "x$usbimageurl" = "x" ] ; then
    fetchlist="$FX3UPSTREAM $FPGA40UPSTREAM $FPGA115UPSTREAM"
else
    if [ "x$fpgaimageurl" != "x" ] ; then
	fetchlist="$fetchlist $fpgaimageurl"
    fi
    if [ "x$usbimageurl" != "x" ] ; then
	fetchlist="$fetchlist $usbimageurl"
    fi
fi

for item in $fetchlist; do
echo "Using: " $item

# if URL, fetch it first
    if echo $item | grep -q :// ; then
	echo Fetching $item ;
	if [ -x /usr/bin/wget ] ; then
	    /usr/bin/wget --user-agent="Debian BladeRF image installer" -O $tdir/`basename $item` $item
	else
	    curl --user-agent "Debian BladeRF image installer" -o $tdir/`basename $item` $item
	fi
    else
	if [ -f $item ] ; then
	    echo Copying $item
	    cp -p $item $tdir/
	else
	    echo "Cannot find" $item;
	    show_usage
	    exit 1
	fi
    fi;
    if [ `basename $item` = "bladeRF_fw_v1.8.0.img" ] ; then	
	md5sum --check - <<- EOF
$FX3CHECKSUM  $tdir/`basename $item`
EOF
	cp -p $tdir/`basename $item` $imagedir/bladeRF_fw.img ;
    fi
    if [ `basename $item` = "hostedx40.rbf" ] ; then
	md5sum --check - <<- EOF
$FPGA40CHECKSUM  $tdir/`basename $item`
EOF
    fi
    if [ `basename $item` = "hostedx115.rbf" ] ; then
	md5sum --check - <<- EOF
$FPGA115CHECKSUM  $tdir/`basename $item`
EOF
    fi
    cp -p $tdir/`basename $item` $imagedir/`basename $item`
done

for file in `ls $imagedir`; do md5sum $imagedir/$file ; done
rm -i -rf $tdir

exit 0