Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix x11vnc #171

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
#
# kuiper2.0 - Embedded Linux for Analog Devices Products
#
# Copyright (c) 2024 Analog Devices, Inc.
# Author: Larisa Radu <[email protected]>

# Check if the system has a display output
if dmesg | grep -q "\[drm\]"; then
# Remove dummy display
rm -f /usr/share/X11/xorg.conf.d/xorg.conf
else
# Enable dummy display
enable_dummy_display.sh

# Start an X server as user 'analog'
sudo -u analog startx -- :0

# Export the display port
export DISPLAY=:0
fi
21 changes: 0 additions & 21 deletions stages/04.configure-desktop-env/02.vnc-server/files/xorg.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=ADI X Server
Wants=display-manager.service
After=display-manager.service

[Service]
Type=oneshot
ExecStart=/usr/bin/adi-xserver.sh

[Install]
WantedBy=multi-user.target
21 changes: 10 additions & 11 deletions stages/04.configure-desktop-env/02.vnc-server/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@
# Copyright (c) 2024 Analog Devices, Inc.
# Author: Larisa Radu <[email protected]>

HELP="To enable VNC on a board that has a display port, you only need to install the service. This is the default approach in the script. \
\nTo enable VNC on a board that doesn't have a display port, you need to install the xorg.conf file that contains a dummy display. \
\nYou can do this by uncommenting line 21. \
\nOnce you have installed the dummy display, your desktop environment might not start if you switch to a board that has a display port. \
\nIn order to go back to the initial configuration, you only need to delete /usr/share/X11/xorg.conf.d/xorg.conf file and reboot. \
\n \
\nThe VNC password is: analog"

if [ "${CONFIG_DESKTOP}" = y ]; then

# Add x11vnc service
install -m 644 "${BASH_SOURCE%%/run.sh}"/files/x11vnc.service "${BUILD_DIR}/lib/systemd/system/"

# Add dummy display
#install -m 644 "${BASH_SOURCE%%/run.sh}"/files/xorg.conf "${BUILD_DIR}/usr/share/X11/xorg.conf.d/"
# Add xserver service
install -m 644 "${BASH_SOURCE%%/run.sh}"/files/xserver.service "${BUILD_DIR}/lib/systemd/system/"

# Add xserver script
install -m 755 "${BASH_SOURCE%%/run.sh}"/files/adi-xserver.sh "${BUILD_DIR}/usr/bin/"

install -d "${BUILD_DIR}/home/analog/.vnc"

Expand All @@ -29,8 +24,12 @@ chroot "${BUILD_DIR}" << EOF
x11vnc -storepasswd analog /home/analog/.vnc/passwd
chmod 644 /home/analog/.vnc/passwd

# Enable VNC service to run automatically at every boot
# Allow anybody to start the X server
sed -i "s/allowed_users=console/allowed_users=anybody/g" /etc/X11/Xwrapper.config

# Enable VNC and xserver services to run automatically at every boot
systemctl enable x11vnc
systemctl enable xserver
EOF

else
Expand Down
Loading