-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·703 lines (595 loc) · 20.2 KB
/
install.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
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
#!/bin/bash
# Buster Version by davecrump on 201911230
# Check current user
whoami | grep -q pi
if [ $? != 0 ]; then
echo "Install must be performed as user pi"
exit
fi
# Check which source needs to be loaded # From M0DNY 201905090
GIT_SRC="BritishAmateurTelevisionClub"
GIT_SRC_FILE=".portsdown_gitsrc"
if [ "$1" == "-d" ]; then
GIT_SRC="davecrump";
echo
echo "-----------------------------------------------------"
echo "----- Installing development version for Buster -----"
echo "-----------------------------------------------------"
elif [ "$1" == "-u" -a ! -z "$2" ]; then
GIT_SRC="$2"
echo
echo "WARNING: Installing ${GIT_SRC} development version, press enter to continue or 'q' to quit."
read -n1 -r -s key;
if [[ $key == q ]]; then
exit 1;
fi
echo "ok!";
else
echo
echo "-----------------------------------------------------------"
echo "----- Installing BATC Production Portsdown for Buster -----"
echo "-----------------------------------------------------------"
fi
# Download and install the VLC apt Preferences File 202212110
cd /home/pi
wget https://github.com/${GIT_SRC}/portsdown-buster/raw/master/scripts/configs/vlc
sudo cp vlc /etc/apt/preferences.d/vlc
# Update the package manager
echo
echo "------------------------------------"
echo "----- Updating Package Manager -----"
echo "------------------------------------"
sudo dpkg --configure -a
sudo apt-get update --allow-releaseinfo-change
# Uninstall the apt-listchanges package to allow silent install of ca certificates (201704030)
# http://unix.stackexchange.com/questions/124468/how-do-i-resolve-an-apparent-hanging-update-process
sudo apt-get -y remove apt-listchanges
# 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 git
sudo apt-get -y install cmake libusb-1.0-0-dev libx11-dev buffer libjpeg-dev indent
sudo apt-get -y install ttf-dejavu-core bc usbmount libfftw3-dev wiringpi libvncserver-dev
sudo apt-get -y install fbi netcat imagemagick
sudo apt-get -y install libvdpau-dev libva-dev libxcb-shape0 # For latest ffmpeg build
sudo apt-get -y install python-pip pandoc python-numpy pandoc python-pygame gdebi-core # 20180101 FreqShow
sudo apt-get -y install libsqlite3-dev libi2c-dev # 201811300 Lime
sudo apt-get -y install sshpass # 201905090 For Jetson Nano
sudo apt-get -y install libbsd-dev # 201910100 for raspi2raspi
sudo apt-get -y install libasound2-dev sox # 201910230 for LongMynd tone and avc2ts audio
sudo apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev # Required for ffmpegsrc.cpp
sudo apt-get -y install mplayer # 202004300 Used for video monitor and LongMynd (not libpng12-dev)
sudo apt-get -y install vlc # Latest version works for Portsdown again as of 202207140
sudo apt-get -y install libxml2 libxml2-dev bison flex libcdk5-dev # for libiio
sudo apt-get -y install libaio-dev libserialport-dev libavahi-client-dev # for libiio
sudo apt-get -y install libairspy-dev # For Airspy Bandviewer
sudo pip install pyrtlsdr #20180101 FreqShow
# Install libiio for DVB-T scripts that refer to Pluto
cd /home/pi
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
cmake ./
make all
sudo make install
cd /home/pi
# Enable USB Storage automount in Buster
echo
echo "----------------------------------"
echo "----- Enabling USB Automount -----"
echo "----------------------------------"
cd /lib/systemd/system/
if ! grep -q PrivateMounts=no systemd-udevd.service; then
sudo sed -i -e 's/PrivateMounts=yes/PrivateMounts=no/' systemd-udevd.service
fi
cd /home/pi
# Install LimeSuite 20.10 as at 25 Jan 21
# Commit be276996ec3f23b2aadc10543add867d1a55afdd
echo
echo "--------------------------------------"
echo "----- Installing LimeSuite 20.10 -----"
echo "--------------------------------------"
wget https://github.com/myriadrf/LimeSuite/archive/be276996ec3f23b2aadc10543add867d1a55afdd.zip -O master.zip
unzip -o master.zip
cp -f -r LimeSuite-be276996ec3f23b2aadc10543add867d1a55afdd LimeSuite
rm -rf LimeSuite-be276996ec3f23b2aadc10543add867d1a55afdd
rm master.zip
# Compile LimeSuite
cd LimeSuite/
mkdir dirbuild
cd dirbuild/
cmake ../
make
sudo make install
sudo ldconfig
cd /home/pi
# Install udev rules for LimeSuite
cd LimeSuite/udev-rules
chmod +x install.sh
sudo /home/pi/LimeSuite/udev-rules/install.sh
cd /home/pi
# Record the LimeSuite Version
echo "be27699" >/home/pi/LimeSuite/commit_tag.txt
# Download the LimeSDR Mini firmware/gateware versions
echo
echo "------------------------------------------------------"
echo "----- Downloading LimeSDR Mini Firmware versions -----"
echo "------------------------------------------------------"
# Current Version from LimeSuite 20.10
mkdir -p /home/pi/.local/share/LimeSuite/images/20.10/
wget https://downloads.myriadrf.org/project/limesuite/20.10/LimeSDR-Mini_HW_1.2_r1.30.rpd -O \
/home/pi/.local/share/LimeSuite/images/20.10/LimeSDR-Mini_HW_1.2_r1.30.rpd
# DVB-S/S2 Version
mkdir -p /home/pi/.local/share/LimeSuite/images/v0.3
wget https://github.com/natsfr/LimeSDR_DVBSGateware/releases/download/v0.3/LimeSDR-Mini_lms7_trx_HW_1.2_auto.rpd -O \
/home/pi/.local/share/LimeSuite/images/v0.3/LimeSDR-Mini_lms7_trx_HW_1.2_auto.rpd
# Download the previously selected version of rpidatv
echo
echo "------------------------------------------"
echo "----- Downloading Portsdown Software -----"
echo "------------------------------------------"
wget https://github.com/${GIT_SRC}/portsdown-buster/archive/master.zip
# Unzip the rpidatv software and copy to the Pi
unzip -o master.zip
mv portsdown-buster-master rpidatv
rm master.zip
cd /home/pi
echo
echo "------------------------------------------------------------"
echo "----- Downloading Portsdown version of avc2ts Software -----"
echo "------------------------------------------------------------"
# Download the previously selected version of avc2ts
wget https://github.com/${GIT_SRC}/avc2ts/archive/master.zip
# Unzip the avc2ts software and copy to the Pi
unzip -o master.zip
mv avc2ts-master avc2ts
rm master.zip
# Compile rpidatv core
echo
echo "-----------------------------"
echo "----- Compiling rpidatv -----"
echo "-----------------------------"
cd /home/pi/rpidatv/src
make
sudo make install
# Compile rpidatv gui
echo
echo "----------------------------------"
echo "----- Compiling rpidatvtouch -----"
echo "----------------------------------"
cd /home/pi/rpidatv/src/gui
make
sudo make install
# Build avc2ts and dependencies
echo
echo "--------------------------------------------"
echo "----- Building avc2ts and dependencies -----"
echo "--------------------------------------------"
# For libmpegts
cd /home/pi/avc2ts
git clone https://github.com/F5OEO/libmpegts
cd libmpegts
# Overwrite updated config version files 202307180
cp /home/pi/rpidatv/scripts/configs/config.guess config.guess
cp /home/pi/rpidatv/scripts/configs/config.sub config.sub
./configure
make
cd ../
# For libfdkaac
sudo apt-get -y install autoconf libtool
git clone https://github.com/mstorsjo/fdk-aac
cd fdk-aac
# Overwrite updated config version files 202307180
cp /home/pi/rpidatv/scripts/configs/config.guess config.guess
cp /home/pi/rpidatv/scripts/configs/config.sub config.sub
./autogen.sh
./configure
make && sudo make install
sudo ldconfig
cd ../
#libyuv should be used for fast picture transformation : not yet implemented
git clone https://chromium.googlesource.com/libyuv/libyuv
cd libyuv
#should patch linux.mk with -DHAVE_JPEG on CXX and CFLAGS
#seems to be link with libjpeg9-dev
make V=1 -f linux.mk
cd ../
# Make avc2ts
cd /home/pi/avc2ts
make
cp avc2ts ../rpidatv/bin/
cd ..
# Compile adf4351
echo
echo "----------------------------------------"
echo "----- Compiling the ADF4351 driver -----"
echo "----------------------------------------"
cd /home/pi/rpidatv/src/adf4351
make
cp adf4351 ../../bin/
# Get rtl_sdr
echo
echo "-----------------------------------------------"
echo "----- Installing RTL-SDR Drivers and Apps -----"
echo "-----------------------------------------------"
cd /home/pi
wget https://github.com/keenerd/rtl-sdr/archive/master.zip
unzip master.zip
mv rtl-sdr-master rtl-sdr
rm master.zip
# Compile and install rtl-sdr
cd rtl-sdr/ && mkdir build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make && sudo make install && sudo ldconfig
sudo bash -c 'echo -e "\n# for RTL-SDR:\nblacklist dvb_usb_rtl28xxu\n" >> /etc/modprobe.d/blacklist.conf'
cd /home/pi
# Get leandvb
cd /home/pi/rpidatv/src
wget https://github.com/pabr/leansdr/archive/master.zip
unzip master.zip
mv leansdr-master leansdr
rm master.zip
# Compile leandvb
cd leansdr/src/apps
make
cp leandvb ../../../../bin/
cd /home/pi
# Get tstools
echo
echo "-----------------------------"
echo "----- Compiling tstools -----"
echo "-----------------------------"
cd /home/pi/rpidatv/src
wget https://github.com/F5OEO/tstools/archive/master.zip
unzip master.zip
mv tstools-master tstools
rm master.zip
# Compile tstools
cd tstools
make
cp bin/ts2es ../../bin/
cd /home/pi/
#install H264 Decoder : hello_video
echo
echo "---------------------------------"
echo "----- Compiling hello_video -----"
echo "---------------------------------"
#compile ilcomponent first
cd /opt/vc/src/hello_pi/
sudo ./rebuild.sh
# Compile H264 player
cd /home/pi/rpidatv/src/hello_video
make
cp hello_video.bin ../../bin/
# Compile MPEG-2 player
cd /home/pi/rpidatv/src/hello_video2
make
cp hello_video2.bin ../../bin/
cd /home/pi/
# FBCP : Duplicate Framebuffer 0 -> 1 for 3.5 inch touchscreen
echo
echo "------------------------------------------"
echo "----- Downloading and Compiling fbcp -----"
echo "------------------------------------------"
wget https://github.com/tasanakorn/rpi-fbcp/archive/master.zip
unzip master.zip
mv rpi-fbcp-master rpi-fbcp
rm master.zip
# Compile fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
cd /home/pi/
# Install omxplayer
echo
echo "--------------------------------"
echo "----- Installing omxplayer -----"
echo "--------------------------------"
sudo apt-get -y install omxplayer
echo
echo "----------------------------------------------------"
echo "----- Setting up 3.5 inch touchscreen overlays -----"
echo "----------------------------------------------------"
# Install Waveshare 3.5A DTOVERLAY
cd /home/pi/rpidatv/scripts/
sudo cp ./waveshare35a.dtbo /boot/overlays/
# Install Waveshare 3.5B DTOVERLAY
sudo cp ./waveshare35b.dtbo /boot/overlays/
# Install the Waveshare 3.5A driver
sudo bash -c 'cat /home/pi/rpidatv/scripts/configs/waveshare_mkr.txt >> /boot/config.txt'
# Download, compile and install DATV Express-server
echo
echo "------------------------------------------"
echo "----- Installing DATV Express Server -----"
echo "------------------------------------------"
cd /home/pi
wget https://github.com/G4GUO/express_server/archive/master.zip
unzip master.zip
mv express_server-master express_server
rm master.zip
cd /home/pi/express_server
make
sudo make install
cd /home/pi
# Install limesdr_toolbox
echo
echo "--------------------------------------"
echo "----- Installing LimeSDR Toolbox -----"
echo "--------------------------------------"
cd /home/pi/rpidatv/src/limesdr_toolbox
# Install sub project dvb modulation
git clone https://github.com/F5OEO/libdvbmod
cd libdvbmod/libdvbmod
make
cd ../DvbTsToIQ/
make
cp dvb2iq /home/pi/rpidatv/bin/
cd /home/pi/rpidatv/src/limesdr_toolbox/
#Make
make
cp limesdr_send /home/pi/rpidatv/bin/
cp limesdr_dump /home/pi/rpidatv/bin/
cp limesdr_stopchannel /home/pi/rpidatv/bin/
cp limesdr_forward /home/pi/rpidatv/bin/
make dvb
cp limesdr_dvb /home/pi/rpidatv/bin/
cd /home/pi
echo
echo "----------------------------------"
echo "----- Installing dvb_t_stack -----"
echo "----------------------------------"
cd /home/pi/rpidatv/src/dvb_t_stack/Release
make clean
make
cp dvb_t_stack /home/pi/rpidatv/bin/dvb_t_stack
# Install the DATV Express firmware files
cd /home/pi/rpidatv/src/dvb_t_stack
sudo cp datvexpress16.ihx /lib/firmware/datvexpress/datvexpress16.ihx
sudo cp datvexpressraw16.rbf /lib/firmware/datvexpress/datvexpressraw16.rbf
cd /home/pi
# Install LongMynd
echo
echo "--------------------------------------------"
echo "----- Installing the LongMynd Receiver -----"
echo "--------------------------------------------"
cd /home/pi
cp -r /home/pi/rpidatv/src/longmynd/ /home/pi/
cd longmynd
make
cd /home/pi
# Enable camera
echo
echo "--------------------------------------------------"
echo "---- Enabling the Pi Cam in /boot/config.txt -----"
echo "--------------------------------------------------"
cd /home/pi/rpidatv/scripts/
sudo bash -c 'echo -e "\n##Enable Pi Camera" >> /boot/config.txt'
sudo bash -c 'echo -e "\ngpu_mem=128\nstart_x=1\n" >> /boot/config.txt'
cd /home/pi/
# Download, compile and install the executable for hardware shutdown button
echo
echo "------------------------------------------------------------"
echo "----- Installing the hardware shutdown Button software -----"
echo "------------------------------------------------------------"
git clone https://github.com/philcrump/pi-sdn /home/pi/pi-sdn-build
# Install new version that sets swapoff
cp -f /home/pi/rpidatv/src/pi-sdn/main.c /home/pi/pi-sdn-build/main.c
cd /home/pi/pi-sdn-build
make
mv pi-sdn /home/pi/
cd /home/pi
# Edit the crontab to always run boot_startup.sh on boot
echo
echo "-------------------------------------------------"
echo "----- Setting up Start behaviour in crontab -----"
echo "-------------------------------------------------"
sudo crontab /home/pi/rpidatv/scripts/configs/blankcron
# Reduce the dhcp client timeout to speed off-network startup (201704160)
sudo bash -c 'echo -e "\n# Shorten dhcpcd timeout from 30 to 5 secs" >> /etc/dhcpcd.conf'
sudo bash -c 'echo -e "\ntimeout 5\n" >> /etc/dhcpcd.conf'
echo
echo "--------------------------"
echo "----- Preparing WiFi -----"
echo "--------------------------"
sudo rm /etc/wpa_supplicant/wpa_supplicant.conf
sudo cp /home/pi/rpidatv/scripts/configs/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
sudo chown root /etc/wpa_supplicant/wpa_supplicant.conf
# Compile Band Viewer
echo
echo "---------------------------------"
echo "----- Compiling Band Viewer -----"
echo "---------------------------------"
cd /home/pi/rpidatv/src/bandview
make
cp bandview ../../bin/
# Copy the fftw wisdom file to home so that there is no start-up delay
# This file works for both BandViewer and NF Meter
cp .fftwf_wisdom /home/pi/.fftwf_wisdom
cd /home/pi
# Compile Airspy Band Viewer
echo
echo "----------------------------------------"
echo "----- Compiling Airspy Band Viewer -----"
echo "----------------------------------------"
cd /home/pi/rpidatv/src/airspyview
make
cp airspyview ../../bin/
cd /home/pi
# Compile RTL-SDR Band Viewer
echo
echo "----------------------------------------"
echo "----- Compiling RTL-SDR Band Viewer -----"
echo "----------------------------------------"
cd /home/pi/rpidatv/src/rtlsdrview
make
cp rtlsdrview ../../bin/
cd /home/pi
# Compile Power Meter
echo
echo "---------------------------------"
echo "----- Compiling Power Meter -----"
echo "---------------------------------"
cd /home/pi/rpidatv/src/power_meter
make
cp power_meter ../../bin/
cd /home/pi
# Compile NF Meter
echo
echo "----------------------------------------"
echo "----- Compiling Noise Figure Meter -----"
echo "----------------------------------------"
cd /home/pi/rpidatv/src/nf_meter
make
cp nf_meter ../../bin/
cd /home/pi
# Compile Noise Meter
echo
echo "---------------------------------"
echo "----- Compiling Noise Meter -----"
echo "---------------------------------"
cd /home/pi/rpidatv/src/noise_meter
make
cp noise_meter ../../bin/
cd /home/pi
# Compile Sweeper
echo
echo "---------------------------------------"
echo "----- Compiling Frequency Sweeper -----"
echo "---------------------------------------"
cd /home/pi/rpidatv/src/sweeper
make
cp sweeper ../../bin/
cd /home/pi
echo
echo "-----------------------------------------"
echo "----- Compiling Ancilliary programs -----"
echo "-----------------------------------------"
# Compile and install the executable for switched repeater streaming (201708150)
cd /home/pi/rpidatv/src/rptr
make
mv keyedstream /home/pi/rpidatv/bin/
cd /home/pi
# Compile and install the executable for GPIO-switched transmission (201710080)
cd /home/pi/rpidatv/src/keyedtx
make
mv keyedtx /home/pi/rpidatv/bin/
cd /home/pi
# Compile and install the executable for GPIO-switched transmission with touch (202003020)
cd /home/pi/rpidatv/src/keyedtxtouch
make
mv keyedtxtouch /home/pi/rpidatv/bin/
cd /home/pi
# Compile and install the executable for the Stream Receiver (201807290)
cd /home/pi/rpidatv/src/streamrx
make
mv streamrx /home/pi/rpidatv/bin/
cd /home/pi
# Compile the Signal Generator (201710280)
cd /home/pi/rpidatv/src/siggen
make clean
make
sudo make install
cd /home/pi
# Compile the Attenuator Driver (201801060)
cd /home/pi/rpidatv/src/atten
make
cp /home/pi/rpidatv/src/atten/set_attenuator /home/pi/rpidatv/bin/set_attenuator
cd /home/pi
echo
echo "------------------------------------------"
echo "----- Setting up for captured images -----"
echo "------------------------------------------"
# Amend /etc/fstab to create a tmpfs drive at ~/tmp for multiple images (201708150)
sudo sed -i '4itmpfs /home/pi/tmp tmpfs defaults,noatime,nosuid,size=10m 0 0' /etc/fstab
# Create a ~/snaps folder for captured images (201708150)
mkdir /home/pi/snaps
# Set the image index number to 0 (201708150)
echo "0" > /home/pi/snaps/snap_index.txt
echo
echo "--------------------------------------"
echo "----- Configure the Video Output -----"
echo "--------------------------------------"
# Enable the Video output in PAL mode (201707120)
cd /boot
sudo sed -i 's/^#sdtv_mode=2/sdtv_mode=2/' config.txt
cd /home/pi
# Download and compile the components for Comp Vid output whilst using 7 inch screen
wget https://github.com/AndrewFromMelbourne/raspi2raspi/archive/master.zip
unzip master.zip
mv raspi2raspi-master raspi2raspi
rm master.zip
cd raspi2raspi/
mkdir build
cd build
cmake ..
make
sudo make install
cd /home/pi
# Download and compile the components for LongMynd Screen Capture
wget https://github.com/AndrewFromMelbourne/raspi2png/archive/master.zip
unzip master.zip
mv raspi2png-master raspi2png
rm master.zip
cd raspi2png
make
sudo make install
cd /home/pi
echo
echo "--------------------------------------"
echo "----- Configure the Menu Aliases -----"
echo "--------------------------------------"
# Install the menu aliases
echo "alias menu='/home/pi/rpidatv/scripts/menu.sh menu'" >> /home/pi/.bash_aliases
echo "alias gui='/home/pi/rpidatv/scripts/utils/guir.sh'" >> /home/pi/.bash_aliases
echo "alias ugui='/home/pi/rpidatv/scripts/utils/uguir.sh'" >> /home/pi/.bash_aliases
# Load modified .bashrc to run startup script on ssh logon
cp /home/pi/rpidatv/scripts/configs/startup.bashrc /home/pi/.bashrc
# set the framebuffer to 32 bit depth by disabling dtoverlay=vc4-fkms-v3d
echo
echo "----------------------------------------------"
echo "---- Setting Framebuffer to 32 bit depth -----"
echo "----------------------------------------------"
sudo sed -i "/^dtoverlay=vc4-fkms-v3d/c\#dtoverlay=vc4-fkms-v3d" /boot/config.txt
# Record Version Number
cd /home/pi/rpidatv/scripts/
cp latest_version.txt installed_version.txt
cd /home/pi
# Switch to French if required
if [ "$1" == "fr" ];
then
echo "Installation de la langue française et du clavier"
cd /home/pi/rpidatv/scripts/
sudo cp configs/keyfr /etc/default/keyboard
sed -i 's/^menulanguage.*/menulanguage=fr/' portsdown_config.txt
cd /home/pi
echo "Installation française terminée"
else
echo "Completed English Install"
fi
# Save git source used
echo "${GIT_SRC}" > /home/pi/${GIT_SRC_FILE}
echo
echo "SD Card Serial:"
cat /sys/block/mmcblk0/device/cid
# Reboot
echo
echo "--------------------------------"
echo "----- Complete. Rebooting -----"
echo "--------------------------------"
sleep 1
echo
echo "---------------------------------------------------------------"
echo "----- If fitted, the touchscreen will be active on reboot -----"
echo "---------------------------------------------------------------"
sudo reboot now
exit