diff --git a/Toolbox/GEM/mqb-vncClient.esd b/Toolbox/GEM/mqb-vncClient.esd new file mode 100644 index 0000000..3b9c67e --- /dev/null +++ b/Toolbox/GEM/mqb-vncClient.esd @@ -0,0 +1,32 @@ +########################################################################################### +# +# Custom Green Engineering Menu screen +# Author: OneB1t +# Version: 0.0.5 +# Disclaimer: THIS SCREEN WILL VOID YOUR WARRANTY +# +########################################################################################### +# +# Main -> MQBCoding -> Customization -> Virtual cockpit VNC Client +# +########################################################################################### +screen VncClient Customization + +keyValue + value String sys 0x00000000 0 + label "This script will install VNC client to your MIB unit." + poll 0 + +keyValue + value String sys 0x00000000 0 + label "Make sure you have an SD-card in slot 1 or 2." + poll 0 + +keyValue + value String sys 0x00000000 0 + label "" + poll 0 + +script + value sys 1 0x0100 "/eso/hmi/engdefs/scripts/mqb/vncclient_install.sh" + label "Install virtual cockpit VNC client" \ No newline at end of file diff --git a/Toolbox/apps/vncclient/opengl-render-qnx b/Toolbox/apps/vncclient/opengl-render-qnx new file mode 100644 index 0000000..954b950 Binary files /dev/null and b/Toolbox/apps/vncclient/opengl-render-qnx differ diff --git a/Toolbox/scripts/vncclient_install.sh b/Toolbox/scripts/vncclient_install.sh new file mode 100644 index 0000000..b5ed63d --- /dev/null +++ b/Toolbox/scripts/vncclient_install.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +export PATH=/proc/boot:/bin:/usr/bin:/usr/sbin:/sbin:/mnt/app/media/gracenote/bin:/mnt/app/armle/bin:/mnt/app/armle/sbin:/mnt/app/armle/usr/bin:/mnt/app/armle/usr/sbin:$PATH + +if [ "$_" = "/bin/on" ]; then BASE="$0"; else BASE="$_"; fi +SCRIPTDIR=$( cd -P -- "$(dirname -- "$(command -v -- "$BASE")")" && pwd -P ) + +. ${SCRIPTDIR}/util_mountsd.sh +if [[ -z "$VOLUME" ]] +then + echo "No SD-card found, quitting" + exit 0 +fi +VNC_APP="${VOLUME}/Toolbox/apps/vncclient" + +# Make it writable +mount -uw /mnt/app +mount -uw /mnt/system + +# Copy VNC binary from sd card to main unit +echo "Copying VNC client binary." +cp ${VNC_APP}/opengl-render-qnx /navigation/opengl-render-qnx + +echo "Modifying startup.sh" +# Name of the file to modify +FILE="/etc/boot/startup.sh" + +# Check if the block of code is already present +if ! grep -qF "# QNX VNC CLIENT" "$FILE"; then + # If not, append it after the specified section + sed -i '/# DCIVIDEO: Kombi Map/ { + N + N + N + N + a \ + # QNX VNC CLIENT \ + if [ -f /navigation/opengl-render-qnx ]; then \ + chmod 0777 /navigation/opengl-render-qnx \ + /navigation/opengl-render-qnx & \ + else \ + echo "File /navigation/opengl-render-qnx does not exist." \ + fi + }' "$FILE" +else + echo "Block already present. Modification of startup.sh skipped." +fi + +# Make readonly again +mount -ur /mnt/app +mount -ur /mnt/system + +echo Done. + +exit 0 \ No newline at end of file