Skip to content

Commit

Permalink
Merge branch 'devel' of http://github.com/guysoft/FullPageOS into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Nov 6, 2024
2 parents df70984 + 7a8f438 commit 1a174ee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[Unit]
Description=VNC Server for X11
ConditionPathExists=/home/pi/.vnc/passwd
ConditionPathExists=/opt/custompios/vnc/passwd
Requires=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -display :0 -auth guess -many -noxdamage -rfbauth /home/pi/.vnc/passwd -rfbport 5900 -shared
ExecStart=/usr/bin/x11vnc -display :0 -auth guess -many -noxdamage -rfbauth /opt/custompios/vnc/passwd -rfbport 5900 -shared
ExecStop=/usr/bin/x11vnc -R stop
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
25 changes: 15 additions & 10 deletions src/modules/fullpageos/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ apt-get update
if [ "$FULLPAGEOS_CUSTOM_SPLASHSCREEN" == "yes" ]
then
apt-get install -y fbi
sed -i 's/$/ logo.nologo consoleblank=0 loglevel=0 quiet/' /"${BASE_BOOT_MOUNT_PATH}"/cmdline.txt
if [ "${BASE_BOARD}" == raspberrypi* ]; then
sed -i 's/$/ logo.nologo consoleblank=0 loglevel=0 quiet/' /"${BASE_BOOT_MOUNT_PATH}"/cmdline.txt
fi
echo "disable_splash=1" >> /"${BASE_BOOT_MOUNT_PATH}"/config.txt
systemctl enable splashscreen.service
systemctl disable getty@tty1
Expand Down Expand Up @@ -121,36 +123,39 @@ if [ "$FULLPAGEOS_INCLUDE_X11VNC" == "yes" ]
then
apt-get install -y --force-yes x11vnc

mkdir -p /opt/custompios/vnc
chown "${BASE_USER}":"${BASE_USER}"

# Set x11vnc password
if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" != "default" ]
then
sudo -u pi /opt/custompios/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD"
sync
if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then
echo "/home/pi/.vnc/passwd was not created. Trying again."
if [ ! -f /opt/custompios/vnc/passwd ] || [ ! -s /opt/custompios/vnc/passwd ]; then
echo "/opt/custompios/vnc/passwd was not created. Trying again."
sudo -u pi /opt/custompios/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD"
sync
if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then
echo "/home/pi/.vnc/passwd was not created again. Giving up."
if [ ! -f /opt/custompios/vnc/passwd ] || [ ! -s /opt/custompios/vnc/passwd ]; then
echo "/opt/custompios/vnc/passwd was not created again. Giving up."
echo "Failed to set a VNC password. Aborting build."
exit 1
fi
fi
else
sudo -u pi /opt/custompios/scripts/setX11vncPass raspberry
sync
if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then
echo "/home/pi/.vnc/passwd was not created. Trying again."
if [ ! -f /opt/custompios/vnc/passwd ] || [ ! -s /opt/custompios/vnc/passwd ]; then
echo "/opt/custompios/vnc/passwd was not created. Trying again."
sudo -u pi /opt/custompios/scripts/setX11vncPass raspberry
sync
if [ ! -f /home/pi/.vnc/passwd ] || [ ! -s /home/pi/.vnc/passwd ]; then
echo "/home/pi/.vnc/passwd was not created again. Giving up."
if [ ! -f /opt/custompios/vnc/passwd ] || [ ! -s /opt/custompios/vnc/passwd ]; then
echo "/opt/custompios/vnc/passwd was not created again. Giving up."
echo "Failed to set a VNC password. Aborting build."
exit 1
fi
fi
fi
ls -l /home/pi/.vnc/passwd
ls -l /opt/custompios/vnc/passwd

#Enable x11vnc service
systemctl enable x11vnc.service
Expand Down

0 comments on commit 1a174ee

Please sign in to comment.