Skip to content

Commit 1dc754b

Browse files
committed
Install overhaul
1 parent fae99ae commit 1dc754b

File tree

9 files changed

+287
-126
lines changed

9 files changed

+287
-126
lines changed

install.sh

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ if [ $pulseaudio = false ]
191191
then
192192
echo -e skipping pulseaudio '\n'
193193
else
194+
#change to project root
195+
cd $script_path
196+
194197
echo Preparing to compile and install pulseaudio
195198
echo Grabbing pulseaudio deps
196199
sudo sed -i 's/#deb-src/deb-src/g' /etc/apt/sources.list
@@ -242,6 +245,9 @@ if [ $bluez = false ]
242245
then
243246
echo -e skipping bluez '\n'
244247
else
248+
#change to project root
249+
cd $script_path
250+
245251
echo Installing bluez
246252
sudo apt-get install -y libdbus-1-dev libudev-dev libical-dev libreadline-dev libjson-c-dev
247253
wget www.kernel.org/pub/linux/bluetooth/bluez-5.63.tar.xz
@@ -258,8 +264,8 @@ fi
258264
if [ $aasdk = false ]; then
259265
echo -e Skipping aasdk '\n'
260266
else
261-
#change to parent directory
262-
cd ..
267+
#change to project root
268+
cd $script_path
263269

264270
#clone aasdk
265271
git clone $aasdkRepo
@@ -281,6 +287,10 @@ else
281287
echo -e moving to aasdk '\n'
282288
cd aasdk
283289

290+
#apply set_FIPS_mode patch
291+
echo Apply set_FIPS_mode patch
292+
git apply $script_path/patches/aasdk_openssl-fips-fix.patch
293+
284294
#create build directory
285295
echo Creating aasdk build directory
286296
mkdir build
@@ -330,10 +340,10 @@ fi
330340
if [ $h264bitstream = false ]; then
331341
echo -e Skipping h264bitstream '\n'
332342
else
333-
#change to parent directory
334-
cd ..
343+
#change to project root
344+
cd $script_path
335345

336-
#clone aasdk
346+
#clone h264bitstream
337347
git clone $h264bitstreamRepo
338348
if [[ $? -eq 0 ]]; then
339349
echo -e h264bitstream Cloned ok '\n'
@@ -402,8 +412,8 @@ fi
402412
if [ $gstreamer = true ]; then
403413
echo installing gstreamer
404414

405-
#change to parent directory
406-
cd ..
415+
#change to project root
416+
cd $script_path
407417

408418
#clone gstreamer
409419
echo Cloning Gstreamer
@@ -435,6 +445,10 @@ if [ $gstreamer = true ]; then
435445
echo Apply greenline patch
436446
git apply $script_path/patches/greenline_fix.patch
437447

448+
#apply atomic patch
449+
echo Apply atomic patch
450+
git apply $script_path/patches/qt-gstreamer_atomic-load.patch
451+
438452
#create build directory
439453
echo Creating Gstreamer build directory
440454
mkdir build
@@ -493,8 +507,11 @@ if [ $openauto = false ]; then
493507
echo -e skipping openauto'\n'
494508
else
495509
echo Installing openauto
496-
cd ..
497510

511+
#change to project root
512+
cd $script_path
513+
514+
#clone openauto
498515
echo -e cloning openauto'\n'
499516
git clone $openautoRepo
500517
if [[ $? -eq 0 ]]; then
@@ -561,6 +578,9 @@ if [ $dash = false ]; then
561578
echo -e Skipping dash'\n'
562579
else
563580

581+
#change to project root
582+
cd $script_path
583+
564584
#create build directory
565585
echo Creating dash build directory
566586
mkdir build
@@ -608,34 +628,21 @@ else
608628
echo Dash make failed with error code $?
609629
exit 1
610630
fi
631+
cd ../
611632

612-
#Setting openGL driver and GPU memory to 128mb
633+
#Raspberry Pi addons
613634
if $isRpi; then
614-
sudo raspi-config nonint do_memory_split 128
615-
if [[ $? -eq 0 ]]; then
616-
echo -e Memory set to 128mb'\n'
617-
else
618-
echo Setting memory failed with error code $? please set manually
619-
exit 1
620-
fi
621-
622-
sudo raspi-config nonint do_gldriver G2
623-
if [[ $? -eq 0 ]]; then
624-
echo -e OpenGL set ok'\n'
635+
read -p "Configure select Raspberry Pi enhancements? (y/N) " choice
636+
if [[ $choice == "y" || $choice == "Y" ]]; then
637+
./rpi.sh
638+
exit 0
625639
else
626-
echo Setting openGL failed with error code $? please set manually
627-
exit 1
640+
echo "Continuing"
628641
fi
629-
630-
echo enabling krnbt to speed up boot and improve stability
631-
cat <<EOT >> /boot/config.txt
632-
dtparam=krnbt
633-
EOT
634642
fi
635643

636644

637645
#Start app
638646
echo Starting app
639-
cd ../bin
640-
./dash
647+
./bin/dash
641648
fi

patches/aasdk_openssl-fips-fix.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 885a8c83ef4f813205fa21cd9e96228db94bcdd2 Mon Sep 17 00:00:00 2001
2+
From: "John EVANS (eva0034)" <[email protected]>
3+
Date: Sat, 6 Jan 2024 16:58:01 +1100
4+
Subject: [PATCH] Update SSLWrapper.cpp:
5+
6+
fix sslwrapper.cpp for newer openssl compilation.
7+
---
8+
src/Transport/SSLWrapper.cpp | 14 ++++++++++++++
9+
1 file changed, 14 insertions(+)
10+
11+
diff --git a/src/Transport/SSLWrapper.cpp b/src/Transport/SSLWrapper.cpp
12+
index 6aca9b44..1c770bf8 100644
13+
--- a/src/Transport/SSLWrapper.cpp
14+
+++ b/src/Transport/SSLWrapper.cpp
15+
@@ -33,13 +33,27 @@ SSLWrapper::SSLWrapper()
16+
{
17+
SSL_library_init();
18+
SSL_load_error_strings();
19+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
20+
+ /*
21+
+ * ERR_load_*(), ERR_func_error_string(), ERR_get_error_line(), ERR_get_error_line_data(), ERR_get_state()
22+
+ * OpenSSL now loads error strings automatically so these functions are not needed.
23+
+ * SEE FOR MORE:
24+
+ * https://www.openssl.org/docs/manmaster/man7/migration_guide.html
25+
+ *
26+
+ */
27+
+#else
28+
ERR_load_BIO_strings();
29+
+#endif
30+
OpenSSL_add_all_algorithms();
31+
}
32+
33+
SSLWrapper::~SSLWrapper()
34+
{
35+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
36+
+ EVP_default_properties_enable_fips(nullptr, 0);
37+
+#else
38+
FIPS_mode_set(0);
39+
+#endif
40+
ENGINE_cleanup();
41+
CONF_modules_unload(1);
42+
EVP_cleanup();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/elements/gstqtvideosink/gstqtvideosinkplugin.h b/elements/gstqtvideosink/gstqtvideosinkplugin.h
2+
index dc04671..a72c572 100644
3+
--- a/elements/gstqtvideosink/gstqtvideosinkplugin.h
4+
+++ b/elements/gstqtvideosink/gstqtvideosinkplugin.h
5+
@@ -27,7 +27,7 @@ GST_DEBUG_CATEGORY_EXTERN(gst_qt_video_sink_debug);
6+
#define DEFINE_TYPE_FULL(cpp_type, type_name, parent_type, additional_initializations) \
7+
GType cpp_type::get_type() \
8+
{ \
9+
- static volatile gsize gonce_data = 0; \
10+
+ static gsize gonce_data = 0; \
11+
if (g_once_init_enter(&gonce_data)) { \
12+
GType type = 0; \
13+
GTypeInfo info; \

rpi.sh

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/bin/bash
22

33
#check if Raspian OS is active, otherwise kill script
4-
if [ -f /etc/rpi-issue ];
4+
if [ ! -f /etc/rpi-issue ]
55
then
6-
echo "Great this script works for RaspberryPI OS"
7-
else
8-
echo "This script works only for an RaspberryPI OS"
6+
echo "This script works only for Raspberry Pi OS"
97
exit 1;
108
fi
119

1210
display_version(){
13-
echo "Version 0.2 RaspberryPI Dash additional install helpers"
11+
echo "Version 0.3 Raspberry Pi Dash additional install helpers"
1412
}
1513

1614
#########################
@@ -22,6 +20,9 @@ display_help() {
2220
echo " -arb, --addrulebrightness Add udev rules for brightness"
2321
echo " -adi, --adddesktopicon Add desktop icon"
2422
echo " -asd, --autostartdaemon Add autostart daemon"
23+
echo " -mem, --memorysplit Set memory split"
24+
echo " -gl, --gldriver Set GL driver"
25+
echo " -krn, --krnbt Set krnbt flag"
2526
echo " -v, --version Show version of script"
2627
echo " -h, --help Show help of script"
2728
echo
@@ -35,6 +36,16 @@ display_help() {
3536
echo "Example: Add autostart daemon on your RPI."
3637
echo " rpi -asd"
3738
echo
39+
echo "Example: Set memory split on your RPI."
40+
echo " rpi -mem 128"
41+
echo
42+
echo "Example: Set GL driver on your RPI."
43+
echo " rpi -gl [G2|G1]"
44+
echo " KMS (G2) / Fake KMS (G1)"
45+
echo
46+
echo "Example: Set krnbt flag on your RPI."
47+
echo " rpi -krn"
48+
echo
3849
exit 1
3950
}
4051

@@ -47,19 +58,35 @@ do
4758
#echo "$1"
4859
case "$1" in
4960
-arb | --addrulebrightness)
50-
/bin/bash src/bash/brightness.sh
61+
/bin/bash src/bash/rpi_helpers.sh setup_brightness_udev_rule
5162
exit 0
5263
;;
5364
-adi | --adddesktopicon)
54-
/bin/bash src/bash/desktop.sh
65+
/bin/bash src/bash/rpi_helpers.sh add_desktop_icon
5566
exit 0
5667
;;
5768
-asd | --autostartdaemon)
5869
if [ $# -ne 0 ]; then
59-
/bin/bash src/bash/autostartdaemon.sh $2
70+
/bin/bash src/bash/rpi_helpers.sh create_autostart_daemon $2
71+
exit 0
72+
fi
73+
;;
74+
-mem | --memorysplit)
75+
if [ $# -ne 0 ]; then
76+
/bin/bash src/bash/rpi_helpers.sh set_memory_split $2
6077
exit 0
6178
fi
6279
;;
80+
-gl | --gldriver)
81+
if [ $# -ne 0 ]; then
82+
/bin/bash src/bash/rpi_helpers.sh set_opengl $2
83+
exit 0
84+
fi
85+
;;
86+
-krn | --krnbt)
87+
/bin/bash src/bash/rpi_helpers.sh enable_krnbt
88+
exit 0
89+
;;
6390
-h | --help)
6491
display_help # Call your function
6592
exit 0
@@ -68,7 +95,10 @@ do
6895
display_version # Call your function
6996
exit 0
7097
;;
71-
98+
"") # If $1 is blank, run display_help
99+
display_help
100+
exit 0
101+
;;
72102
--) # End of all options
73103
shift
74104
break

src/bash/autostartdaemon.sh

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/bash/brightness.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/bash/desktop.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)