forked from davecrump/portsdown4
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall_for_nano.sh
executable file
·163 lines (133 loc) · 4.45 KB
/
install_for_nano.sh
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
#!/bin/bash
# Jetson Nano dvbsdr installer by davecrump on 20230129
cd /home/nano
# Check current user
whoami | grep -q nano
if [ $? != 0 ]; then
echo "Install must be performed as user nano"
exit
fi
# Check platform
grep -E -q "jetson-nano|Jetson" /proc/device-tree/model
if [ $? != 0 ]; then ## Not being run on a Nano
echo "This script must be run on the Nano, not on a Raspberry Pi."
exit
fi
echo
echo "---------------------------------------------------------------------------"
echo "----- Installing dvbsdr applications on Nano for use with Portsdown 4 -----"
echo "---------------------------------------------------------------------------"
# Update the package manager and pass the sudo password so that all subsequent commands run
echo
echo "------------------------------------"
echo "----- Updating Package Manager -----"
echo "------------------------------------"
echo jetson | sudo -S apt-get update --allow-releaseinfo-change
echo
echo "--------------------------------------------"
echo "----- Extending sudo timeout to 60 min -----"
echo "--------------------------------------------"
sudo sh -c 'echo "Defaults env_reset, timestamp_timeout=60" > /etc/sudoers.d/timeout'
sudo chmod 0440 /etc/sudoers.d/timeout
# Upgrade the distribution
echo
echo "-----------------------------------"
echo "----- Performing dist-upgrade -----"
echo "-----------------------------------"
sudo apt-get -y dist-upgrade
# Install the packages that we need
echo
echo "-------------------------------"
echo "----- Installing Packages -----"
echo "-------------------------------"
sudo apt-get -y install htop
sudo apt-get -y install nano
sudo apt-get -y install vlc
sudo apt-get -y install v4l-utils
sudo apt-get -y install libsqlite3-dev
sudo apt-get -y install libi2c-dev
sudo apt-get -y install buffer
sudo apt-get -y install libfftw3-dev
# Install LimeSuite 22.09.1 as at 29 Jan 23
# Install in /home/nano
# Commit 70e3859a55d8d5353963a5318013c8454594769f
echo
echo "----------------------------------------"
echo "----- Installing LimeSuite 22.09.1 -----"
echo "----------------------------------------"
wget https://github.com/myriadrf/LimeSuite/archive/70e3859a55d8d5353963a5318013c8454594769f.zip -O master.zip
unzip -o master.zip
cp -f -r LimeSuite-70e3859a55d8d5353963a5318013c8454594769f LimeSuite
rm -rf LimeSuite-70e3859a55d8d5353963a5318013c8454594769f
rm master.zip
# Record the LimeSuite Version
echo "70e3859" >/home/nano/LimeSuite/commit_tag.txt
# Compile LimeSuite
cd LimeSuite/
mkdir dirbuild
cd dirbuild/
cmake ../
make
sudo make install
sudo ldconfig
cd /home/nano
# Install udev rules for LimeSuite
cd LimeSuite/udev-rules
chmod +x install.sh
sudo /home/nano/LimeSuite/udev-rules/install.sh
cd /home/nano
# Install DVB Encoding Tools
echo
echo "----------------------------------"
echo "----- Installing DVB Encoder -----"
echo "----------------------------------"
mkdir dvbsdr
cd /home/nano/dvbsdr
mkdir build
mkdir bin
mkdir scripts
git clone https://github.com/F5OEO/limesdr_toolbox
cd /home/nano/dvbsdr/limesdr_toolbox
# Install sub project dvb modulation
git clone https://github.com/F5OEO/libdvbmod
cd libdvbmod/libdvbmod
make
cd ../DvbTsToIQ/
make
cp dvb2iq /home/nano/dvbsdr/bin/dvb2iq
# Make the limesdr toolbox apps
cd /home/nano/dvbsdr/limesdr_toolbox
make
cp limesdr_send /home/nano/dvbsdr/bin/limesdr_send
cp limesdr_stopchannel /home/nano/dvbsdr/bin/limesdr_stopchannel
make dvb
cp limesdr_dvb /home/nano/dvbsdr/bin/limesdr_dvb
cd /home/nano
# Install the test card file
echo
echo "-------------------------------------"
echo "----- Installing Test Card file -----"
echo "-------------------------------------"
cd /home/nano/dvbsdr/scripts
wget https://github.com/BritishAmateurTelevisionClub/portsdown4/raw/master/scripts/images/tcfw.jpg
# Install Test script
wget https://github.com/BritishAmateurTelevisionClub/portsdown4/raw/master/scripts/utils/nano_test.sh
chmod +x nano_test.sh
# Add other scripts here!
# Record Version Number
wget https://github.com/BritishAmateurTelevisionClub/portsdown4/raw/master/scripts/latest_version.txt
cd /home/nano
echo
echo "--------------------------------------"
echo "----- Configure the Menu Aliases -----"
echo "--------------------------------------"
# Install the menu aliases
echo "alias test='/home/nano/dvbsdr/scripts/nano_test.sh'" >> /home/nano/.bash_aliases
# Reboot
echo
echo "--------------------------------"
echo "----- Complete. Rebooting -----"
echo "--------------------------------"
sleep 1
sudo reboot now
exit