From d71cd537c83101dfbc73b918030117df58f43095 Mon Sep 17 00:00:00 2001 From: Links Date: Sat, 9 Apr 2022 16:29:05 +0200 Subject: [PATCH] use xinit for VNC to keep the session open --- userpatches/customize-image.sh | 29 +++++++++++++++---- userpatches/overlay/chroot_onboard.sh | 22 -------------- userpatches/overlay/etc/asound.conf | 8 +++-- .../lightdm/lightdm.conf.d/98-vncserver.conf | 6 ---- userpatches/overlay/etc/xinetd.d/Xvnc | 13 +++++++++ 5 files changed, 42 insertions(+), 36 deletions(-) delete mode 100755 userpatches/overlay/chroot_onboard.sh delete mode 100644 userpatches/overlay/etc/lightdm/lightdm.conf.d/98-vncserver.conf create mode 100644 userpatches/overlay/etc/xinetd.d/Xvnc diff --git a/userpatches/customize-image.sh b/userpatches/customize-image.sh index cb84c4d..9aa5a52 100644 --- a/userpatches/customize-image.sh +++ b/userpatches/customize-image.sh @@ -25,7 +25,8 @@ Main() { #touch /root/.no_rootfs_resize - apt-get install -y wsjtx tightvncserver gdb-minimal gdbserver strace e2fsprogs xfce4-battery-plugin xfce4-power-manager libqt5sql5-sqlite + apt-get install -y wsjtx quisk tigervnc-standalone-server socat ser2net gdb-minimal gdbserver strace e2fsprogs xfce4-battery-plugin xfce4-power-manager libqt5sql5-sqlite xinetd + apt-get install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-pulseaudio apt-get install -y nano htop curl ncdu gpg dtrx localepurge mtr-tiny screen iotop git wget net-tools etckeeper sudo file bash-completion psmisc dnsutils software-properties-common apt-transport-https xauth aptitude fzf cp /tmp/overlay/extracted/sun8i-r16-x6100.dtb /boot/ @@ -37,15 +38,33 @@ Main() { mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr - cp /tmp/overlay/*.sh /root/ + cp /tmp/overlay/root/* /root/ chmod +x /root/*.sh - cp /tmp/overlay/gpio_setup.service /etc/systemd/system/gpio_setup.service - systemctl enable gpio_setup.service - cp -r /tmp/overlay/extracted/modules/* /lib/modules/ cp -r /tmp/overlay/etc/* /etc/ + sudo systemctl enable gpio_setup.service + + + # pulseaudio in system mode + systemctl --global disable pulseaudio.service pulseaudio.socket + systemctl --global mask pulseaudio.socket + + systemctl enable pulseaudio_system.service + systemctl enable amixer.service + + usermod -a -G pulse-access root + usermod -a -G bluetooth pulse + + systemctl enable alsa_2_pulse.service + #systemctl enable pulse_2_alsa.service + + systemctl enable pulse_2_network_rx.service + + # startup + systemctl enable x6100_chroot.service + case $RELEASE in stretch) # your code here diff --git a/userpatches/overlay/chroot_onboard.sh b/userpatches/overlay/chroot_onboard.sh deleted file mode 100755 index d621867..0000000 --- a/userpatches/overlay/chroot_onboard.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -mkdir -p /mnt/x6100 -mount /dev/mmcblk2p2 /mnt/x6100 - -mount -t proc proc /mnt/x6100/proc -mount -t sysfs sys /mnt/x6100/sys -mount -o bind /dev /mnt/x6100/dev -mount -t devpts /dev/pts /mnt/x6100/dev/pts/ - -mkdir -p /mnt/x6100/run/udev -mount -o bind /run/udev /mnt/x6100/run/udev - - -mkdir -p /tmp/pulse -mkdir -p /mnt/x6100/tmp/pulse -mount -o bind /tmp/pulse /mnt/x6100/tmp/pulse - -mkdir -p /tmp/dbus -mkdir -p /mnt/x6100/tmp/dbus -mount -o bind /tmp/dbus /mnt/x6100/tmp/dbus - -chroot /mnt/x6100 /bin/bash diff --git a/userpatches/overlay/etc/asound.conf b/userpatches/overlay/etc/asound.conf index f6b933d..ecdc3f0 100644 --- a/userpatches/overlay/etc/asound.conf +++ b/userpatches/overlay/etc/asound.conf @@ -10,12 +10,13 @@ pcm.mixout { # PCM params format S16_LE # STR rate 16000 # INT + #rate 48000 # INT channels 2 # INT - + # stream params,buffer_size=period x period_size periods 100 # INT,when buffer_size or buffer_time is not specified period_size 1024 # INT,in frames,3 times than app need - + # optional params # period_time 0 # INT,in usec # buffer_time 0 # INT,in usec @@ -41,12 +42,13 @@ pcm.mixin { # PCM params format S16_LE # STR rate 16000 # INT + #rate 48000 # INT channels 2 # INT # stream params,buffer_size=period x period_size periods 100 # INT,when buffer_size or buffer_time is not specified period_size 1024 # INT,in frames,3 times than app need - + # optional params # period_time 0 # INT,in usec # buffer_time 0 # INT,in usec diff --git a/userpatches/overlay/etc/lightdm/lightdm.conf.d/98-vncserver.conf b/userpatches/overlay/etc/lightdm/lightdm.conf.d/98-vncserver.conf deleted file mode 100644 index 6b27985..0000000 --- a/userpatches/overlay/etc/lightdm/lightdm.conf.d/98-vncserver.conf +++ /dev/null @@ -1,6 +0,0 @@ -[VNCServer] -enabled=true -port=5900 -width=1280 -height=720 -depth=8 diff --git a/userpatches/overlay/etc/xinetd.d/Xvnc b/userpatches/overlay/etc/xinetd.d/Xvnc new file mode 100644 index 0000000..89990a3 --- /dev/null +++ b/userpatches/overlay/etc/xinetd.d/Xvnc @@ -0,0 +1,13 @@ +service xvnc_1 +{ + type = UNLISTED + disable = no + protocol = tcp + socket_type = stream +# bind = 127.0.0.1 + port = 5900 + wait = yes + user = root + server = /usr/bin/Xvnc + server_args = :1 -inetd -query localhost -geometry 1600x900 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared -SecurityTypes None +} \ No newline at end of file