Skip to main content
Topic: Display Link on openRC (Read 718 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Display Link on openRC

Hi,

After some research I managed to install the Display Link driver for Ubuntu on my own laptop and get it to work with 3 external displays via USB-C (tuxedo laptops with the tuxedo docking station). I was even able to repeat the recipe on the wife's laptop to verify so here goes.

We both use OpenRC but the recipe shall be possible to repeat for other init systems as well. upstart and runit are already suported by the installation script while OpenRC is not.

This is verified to work with Display Link version 5.6 as downloaded late july 2022, and with an up to date Artix with KDE and OpenRC.

NB! The recipe is what I noted down and adjusted during the process, the actual commands are the one I think is right - I never recorded them properly. Please feed back so I can adjust as needed and don't follow the command blindly. Also, I am a vim person - feel free to use nano instead if that works for you.

Step 1: Preparations as root
  • Install dkms, linux-headers using pacman.
  • Install evdi from AUR but do not yet load the module.
  • Verify that unzip is installed as it will be needed later on.

Code: [Select]
# pacman -S dkms linux-headers
# pacman -S --needed unzip

Step 2: Preparations as normal user
  • Install evdi from AUR but do not yet load the module.
    The display link installer will break and request a reboot if the evdi module is loaded

Code: [Select]
$ cd <where you collect the AUR installs>
$ git clone https://aur.archlinux.org/evdi.git
$ cd evdi
$ makepkg -si

Step 3: Install displaylink
  • Download Display Link driver for ubuntu. It will come as a zip-file.
  • Unzip the file in an empty directory.
  • There will be an installer (displaylink-driver-x.y.x-a.b.run), make it executable
  • Shift to root
  • Force the init system to be systemd: export SYSTEMINITDAEMON=systemd
  • Run the installer (displaylink-driver-x.y.x-a.b.run)

Code: [Select]
$ mkdir displaylink
$ cd displaylink
$ unzip ~/Downloads/DisplayLink\ USB\ Graphics\ Software\ for\ Ubuntu5.6-EXE.zip
$ chmod ug+x displaylink-driver-5.6.0-59.176.run
$ sudo -i
# cd <where ever the displaylink directory is located>
# export SYSTEMINITDAEMON=systemd
# ./displaylink-driver-5.6.0-59.176.run
When I did the actual installations I unpacked the run-file first using --noexec --keep command line options but I think this should work as well. If not, it will complain about no known init-system and terminate rather early in the process. Please let me know so I can update.

Step 4: Hack the world
As root, add the evdi module to be auto loaded by adding it to /etc/conf.d/modules
Code: [Select]
# vim /etc/conf.d/modules

Add the module for auto loading:
Code: [Select]
modules="evdi"
If you already have other modules, add it to the existing list.

As root, create the file /etc/init.d/displaylink
Code: [Select]
# vim /etc/init.d/displaylink

Add the following content:
Code: [Select]
#!/sbin/openrc-run

# (C) 2022, Erik Ridderby
# Distributed under the terms of the GNU General Public License v3


command="/opt/displaylink/DisplayLinkManager"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
directory="/opt/displaylink"

Make the file executable.
Code: [Select]
# chmod ugo+x

As root, edit the file /opt/displaylink/udev.sh
Code: [Select]
# vim /opt/displaylink/udev.sh

There are two changes to be made.

Find the section:

Code: [Select]
start_service()
{
  systemctl start displaylink-driver
}

stop_service()
{
  systemctl stop displaylink-driver
}

Replace "systemctl start displaylink-driver" with "rc-service displaylink start"
Replace "systemctl stop displaylink-driver" with "rc-service displaylink stop"

Code: [Select]
start_service()
{
  # systemctl start displaylink-driver
  rc-service displaylink start
}

stop_service()
{
  # systemctl stop displaylink-driver
  rc-service displaylink stop
}

Step 5: Suspend/sleep management

As root, modify the suspend script and enable it for elogin to use:

Code: [Select]
# vim /opt/displaylink/suspend.sh

Find the following piece of code at the very end of the script:
Code: [Select]
if [[ $DIR == *systemd* ]]; then
  main_systemd "$@"
elif [[ $DIR == *pm* ]]; then
  main_pm "$@"
fi

Replace systemd in the if statement to elogin:
Code: [Select]
if [[ $DIR == *elogin* ]]; then
  main_systemd "$@"
elif [[ $DIR == *pm* ]]; then
  main_pm "$@"
fi

Lastly, make the symbolic link so that elogind takes the script into consideration:
Code: [Select]
# ln -sf /opt/displaylink/suspend.sh /lib64/elogind/system-sleep/displaylink.sh

Finally reboot

Reboot to make sure the evdi module is loaded with the configuration parameters and enjoy the many monitors for the docking station.

Troubles I have had
I spent some time searching for problems when before I realized that the evdi module was not loaded. I had forgot to actual make the directory mentioned above as missing, the script was unable to add evdi for automatic loading and the driver failed to work properly.

Verify that evdi is loaded, as root run:

Code: [Select]
lsmod | grep evdi

If not, load it and retry the docking station:
Code: [Select]
# modprob evdi


If I ever manage to get an account on the Wiki I might make a Wiki post out of it.  ;)

Hope this comes in handy,
// Erik

Edited 2022-08-03;
  • Added part 5 regarding sleep/suspend script for elogin
  • Changed instruction for module autoloading, OpenRC are using /etc/conf.d/modules instead of /etc/modules-load.d
  • Changed the GPL reference in the open-rc script

I take full responsibility of my Linux systems - I just need some help from time to time.