Skip to content

Commit

Permalink
v6.31
Browse files Browse the repository at this point in the history
+ DietPi-Software | TigerVNC: Workaround external bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499
+ DietPi-Software | TigerVNC: Missing netbase dependency has been resolved since Bullseye
+ DietPi-Software | VNC Server: Check for RealVNC/TigerVNC binaries explicitly, else exit with error
+ DietPi-Software | XRDP: Do not apply backports rules on Raspbian
+ DietPi-Software | QuiteRSS: Re-add install code, which was (accidentally?) removed/left commented with DietPi v127 commit: 7cb41f3
  • Loading branch information
MichaIng authored Jun 25, 2020
1 parent 3d3dcfd commit 49f960a
Showing 1 changed file with 67 additions and 41 deletions.
108 changes: 67 additions & 41 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it

aSOFTWARE_NAME[$software_id]='TigerVNC Server'
aSOFTWARE_DESC[$software_id]='desktop for remote connection'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408'
#------------------
software_id=29

aSOFTWARE_NAME[$software_id]='XRDP'
aSOFTWARE_DESC[$software_id]='remote desktop protocol (rdp) server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074'
#------------------
Expand Down Expand Up @@ -2117,8 +2117,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it

aSOFTWARE_NAME[$software_id]='QuiteRSS'
aSOFTWARE_DESC[$software_id]='cross-platform, free rss reader'
aSOFTWARE_CATEGORY_INDEX[$software_id]=8
aSOFTWARE_TYPE[$software_id]=1
aSOFTWARE_CATEGORY_INDEX[$software_id]=8
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2075#p2075'
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1

#--------------------------------------------------------------------------------
Expand Down Expand Up @@ -2993,6 +2994,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it

fi

software_id=22 # QuiteRSS
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Banner_Installing
G_AGI quiterss

fi

software_id=174 # GIMP
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Expand All @@ -3014,7 +3023,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it

Banner_Installing
# On Stretch, use backports, which resolves missing /etc/profile (e.g. $PATH) load and failing install+service if IPv6 is disabled: https://github.com/MichaIng/DietPi/issues/3017
(( $G_DISTRO == 4 )) && cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp
(( $G_DISTRO == 4 )) && [[ $G_RASPBIAN != 1 ]] && cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp
Package: xrdp
Pin: release n=stretch-backports
Pin-Priority: 500
Expand Down Expand Up @@ -4373,9 +4382,11 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf
Banner_Installing
# TigerVNC allows connecting to a virtual desktop
# X11VNC allows connecting to a real desktop session, thus shared desktop sessions as well
# netbase is required to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver"
# netbase is required until Bullseye to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver"
# - It is a recommendation and no dependency of perl, but expected by some packages depending on perl only: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939055
G_AGI tigervnc-standalone-server tigervnc-common x11vnc netbase
local netbase=
(( $G_DISTRO < 6 )) && netbase='netbase'
G_AGI tigervnc-standalone-server tigervnc-common x11vnc $netbase

fi

Expand Down Expand Up @@ -9124,64 +9135,79 @@ _EOF_
systemctl daemon-reload
systemctl enable vncserver

# Workaround external bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932499
local ld_preload=
# - Be failsafe on Raspbian (armhf!) if 64-bit kernel mode has been enabled.
if (( $G_HW_ARCH < 3 )) || [[ $G_RASPBIAN == 1 ]]; then

ld_preload='LD_PRELOAD=/lib/arm-linux-gnueabihf/libgcc_s.so.1 '

elif (( $G_HW_ARCH == 3 )); then

ld_preload='LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 '

fi

cat << _EOF_ > /usr/local/bin/vncserver
#!/bin/bash

# Check shared mode
# Shared or virtual desktop?
SHARED_MODE=\$(grep -cm1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /boot/dietpi.txt)

# RealVNC | Slightly different launch method to TigerVNC
REALVNC=0
if dpkg-query -s realvnc-vnc-server &> /dev/null; then
# RealVNC or TigerVNC?
if [[ -f '/usr/bin/vncserver-virtual' ]]; then

REALVNC=1
FP_BINARY='/usr/bin/vncserver-virtual'
# Set shared desktop mode if autostart is enabled for desktops. This prevents another VNC server being launched on :1.
[[ -f '/boot/dietpi/.dietpi-autostart_index' && \$(</boot/dietpi/.dietpi-autostart_index) == 2 ]] && SHARED_MODE=1

fi

# Find binary FP to use
BINARY_FP='/usr/bin/vncserver'
[[ -f '/usr/bin/tigervncserver' ]] && BINARY_FP='/usr/bin/tigervncserver'
elif [[ -f '/usr/bin/tigervncserver' ]]; then

case "\$1" in
REALVNC=0
FP_BINARY='$ld_preload/usr/bin/tigervncserver'

start)
# Shared mode: x11vnc, excluding RealVNC as it has its own services
if (( \$SHARED_MODE )); then
else

if (( ! \$REALVNC )); then
echo '[FAILED] No supported VNC server installed'
exit 1

# Wait for X to start
while ! pgrep Xorg
do

echo 'Waiting for X11 to start'
sleep 2

done

sleep 5 # Give system some time to finish setting up X11 + desktop
xset dpms force on # Disable screen blanking
x11vnc -display :0 -usepw -forever || exit 1

fi
fi

case "\$1" in

start)
# Virtual desktop mode
else
if (( ! \$SHARED_MODE )); then

WIDTH=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
HEIGHT=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
DEPTH=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
\$BINARY_FP :\${DISPLAY:-1} -geometry \${WIDTH:-1280}'x'\${HEIGHT:-720} -depth \${DEPTH:-16} || exit 1
\$FP_BINARY :\${DISPLAY:-1} -geometry \${WIDTH:-1280}'x'\${HEIGHT:-720} -depth \${DEPTH:-16} || exit 1

# Shared mode: x11vnc, excluding RealVNC as it has its own services
elif (( ! \$REALVNC )); then

# Wait for X to start
while ! pgrep Xorg
do

echo 'Waiting for X11 to start'
sleep 2

done

sleep 5 # Give system some time to finish setting up X11 + desktop
xset dpms force on # Disable screen blanking
x11vnc -display :0 -usepw -forever || exit 1

fi
;;

stop)
DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
\$BINARY_FP -kill :\${DISPLAY:-1} &> /dev/null
\$FP_BINARY -kill :\${DISPLAY:-1} &> /dev/null
killall -qw x11vnc Xtigervnc
;;

Expand All @@ -9191,15 +9217,15 @@ exit 0
_EOF_
chmod +x /usr/local/bin/vncserver

# + RealVNC | enable services
# RealVNC: Enable services
if (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then

systemctl enable vncserver-x11-serviced
systemctl enable vncserver-virtuald

fi

# - Stretch + TigerVNC: Disable Localhost only by default
# Stretch + TigerVNC: Disable Localhost only by default
[[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf

local cmd_launch_desktop=
Expand Down Expand Up @@ -12399,7 +12425,7 @@ _EOF_

fi

software_id=22
software_id=22 # QuiteRSS
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
Expand All @@ -12415,7 +12441,7 @@ _EOF_

fi

software_id=29
software_id=29 # XRDP
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
Expand Down

0 comments on commit 49f960a

Please sign in to comment.