diff --git a/README.md b/README.md index e7abd1d..975f70c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ currently the buttons under the screen are used. - no Button: Boot internal storage (X6100 orginal OS) - 1 Button: stock Kernel + Armbian with X6100 APP on screen -- 2 Button: stock Kernel + Armbian with xfce on screen + X6100 APP hidden but running for CAT +- 2 Button: stock Kernel + Armbian with xfce on screen + X6100 APP hidden but running for CAT and VNC on port 5901 - 3 Button: Armbian Kernel + boot to console Notes: @@ -69,7 +69,9 @@ on the command line use `nmtui` or use the Network Manager UI after login. | TCP 9090 | RAW CAT | | TCP 7000 | RF RX (audio/x-raw,rate=16000,channels=2,format=S16LE) | | TCP 6080 | noVNC | +| TCP 6081 | noVNC APP (Only running when Button 2 where pressed) | | TCP 5900 | VNC (xfce) | +| TCP 5901 | VNC APP (Only running when Button 2 where pressed) | | TCP 4532 | rigctld | | TCP 3389 | xrdp (untested) | | TCP 22 | SSH | diff --git a/userpatches/customize-image.sh b/userpatches/customize-image.sh index 617b834..6da4430 100644 --- a/userpatches/customize-image.sh +++ b/userpatches/customize-image.sh @@ -27,7 +27,7 @@ Main() { #touch /root/.no_rootfs_resize - apt-get install -y quisk tigervnc-standalone-server socat ser2net gdb-minimal gdbserver strace e2fsprogs xfce4-battery-plugin xfce4-power-manager xfce4-systemload-plugin libqt5sql5-sqlite xinetd + apt-get install -y quisk tigervnc-standalone-server tigervnc-viewer socat ser2net gdb-minimal gdbserver strace e2fsprogs xfce4-battery-plugin xfce4-power-manager xfce4-systemload-plugin libqt5sql5-sqlite xinetd apt-get install -y gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-pulseaudio gstreamer1.0-alsa apt-get install -y nano htop curl ncdu gpg dtrx localepurge mtr-tiny screen iotop git wget net-tools sudo file bash-completion psmisc dnsutils software-properties-common apt-transport-https xauth aptitude fzf tcpdump apt-get install -y bluez-alsa-utils bluez bluez-tools diff --git a/userpatches/overlay/etc/systemd/system/x6100_app_novnc.service b/userpatches/overlay/etc/systemd/system/x6100_app_novnc.service new file mode 100644 index 0000000..f788620 --- /dev/null +++ b/userpatches/overlay/etc/systemd/system/x6100_app_novnc.service @@ -0,0 +1,12 @@ +[Unit] +Description=noVNC for APP +Requires=x6100_app.service +ConditionKernelCommandLine=x6100_app_hide=1 + +[Service] +Type=simple +ExecStart=/usr/bin/websockify --web=/usr/share/novnc/ 6081 localhost:5901 +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/userpatches/overlay/root/run_x6100_app.sh b/userpatches/overlay/root/run_x6100_app.sh index 7a4845d..2e462fc 100755 --- a/userpatches/overlay/root/run_x6100_app.sh +++ b/userpatches/overlay/root/run_x6100_app.sh @@ -6,6 +6,7 @@ CAT_DEV_NEW=/dev/ttyS2_VIRT function cleanup() { + echo "cleanup" echo 0 > /sys/class/gpio/gpio138/value if [ -e "/mnt/x6100/${CAT_DEV}" ] ; then @@ -19,29 +20,6 @@ function cleanup() trap cleanup EXIT trap cleanup SIGINT -if grep -r "x6100_app_hide=1" /proc/cmdline > /dev/null ; then - cat > /root/qtkmsconfig.json < /root/qtkmsconfig.json < /sys/class/gpio/gpio138/value TZ=$(cat /etc/timezone) +APP_ARGS="" +APP_VNC=0 -chroot /mnt/x6100 /bin/bash -c "source /etc/profile && export TZ=${TZ} && nice --5 /usr/app_qt/x6100_ui_v100" +if grep -r "x6100_app_hide=1" /proc/cmdline > /dev/null ; then + APP_VNC=1 +fi + +if [ "$1" == "vnc" ] ; then + APP_VNC=1 +fi + +if [ "${APP_VNC}" == "1" ] ; then + echo "Starting in VNC mode" + # Note: the APP is not happy to run in VNC mode (no egl) + # but its runnimg so we hode all the error messages to not spam the log. + APP_ARGS="--platform vnc:port=5901:size=800x480 >/dev/null 2>&1" + + cat > /root/qtkmsconfig.json < /root/qtkmsconfig.json <