diff --git a/src/displaylink/.SRCINFO b/src/displaylink/.SRCINFO new file mode 100644 index 0000000..d2a9901 --- /dev/null +++ b/src/displaylink/.SRCINFO @@ -0,0 +1,30 @@ +# Generated by mksrcinfo v8 +# Thu Oct 13 12:11:17 UTC 2016 +pkgbase = displaylink + pkgdesc = Linux driver for DL-5xxx, DL-41xx and DL-3x00 + pkgver = 1.2.65 + pkgrel = 1 + url = http://www.displaylink.com/downloads/ubuntu.php + changelog = release-note.txt + arch = i686 + arch = x86_64 + license = custom + license = GPL2 + license = LGPL2.1 + makedepends = grep + makedepends = gawk + depends = evdi + depends = libusb>=1.0.0 + source = displaylink-driver-1.2.65.zip::http://www.displaylink.com/downloads/file?id=708 + source = udev.sh + source = 99-displaylink.rules + source = displaylink.service + source = displaylink-sleep.sh + md5sums = 6de248995d5f9b08fa2aca2acf8cd368 + md5sums = d5de775e41af06edbd8073adc490139d + md5sums = 20495d81c7d2540910ef86dc437b7fac + md5sums = c141a15e973481c7d961f8e135627ca4 + md5sums = 7cbd9ab2ac79ba66e8297689c6e5483e + +pkgname = displaylink + diff --git a/src/displaylink/.gitignore b/src/displaylink/.gitignore new file mode 100644 index 0000000..ed7b9c3 --- /dev/null +++ b/src/displaylink/.gitignore @@ -0,0 +1,6 @@ +*.swp +*.tar.gz +*.tar.xz +*.zip +pkg/ +src/ diff --git a/src/displaylink/99-displaylink.rules b/src/displaylink/99-displaylink.rules new file mode 100644 index 0000000..3d2cc07 --- /dev/null +++ b/src/displaylink/99-displaylink.rules @@ -0,0 +1,5 @@ +# Copyright (c) 2016 DisplayLink (UK) Ltd. +# File autogenerated by udev-installer.sh script + +ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="17e9", ATTR{bInterfaceClass}=="ff", ATTR{bInterfaceProtocol}=="03", ENV{ID_DISPLAYLINK_DEVICE}="1", RUN+="/opt/displaylink/udev.sh START" +ACTION=="remove", ENV{ID_DISPLAYLINK_DEVICE}=="1", RUN+="/opt/displaylink/udev.sh STOP $env{DEVPATH}" diff --git a/src/displaylink/PKGBUILD b/src/displaylink/PKGBUILD new file mode 100644 index 0000000..65d1537 --- /dev/null +++ b/src/displaylink/PKGBUILD @@ -0,0 +1,71 @@ +# Maintainer: PlusMinus +# Contributor: rhabbachi + +pkgname=displaylink +pkgver=1.2.65 +pkgrel=1 +pkgdesc="Linux driver for DL-5xxx, DL-41xx and DL-3x00" +arch=('i686' 'x86_64') +url="http://www.displaylink.com/downloads/ubuntu.php" +license=('custom' 'GPL2' 'LGPL2.1') +depends=('evdi' 'libusb>=1.0.0') +makedepends=('grep' 'gawk') +install= +changelog="release-note.txt" +source=(displaylink-driver-$pkgver.zip::http://www.displaylink.com/downloads/file\?id\=708 + udev.sh + 99-displaylink.rules + displaylink.service + displaylink-sleep.sh) + +# Update with > updpkgsums +md5sums=('6de248995d5f9b08fa2aca2acf8cd368' + 'd5de775e41af06edbd8073adc490139d' + '20495d81c7d2540910ef86dc437b7fac' + 'c141a15e973481c7d961f8e135627ca4' + '7cbd9ab2ac79ba66e8297689c6e5483e') + +package() { + echo "Adding udev rule for DisplayLink DL-3xxx/5xxx devices" + install -D -m644 99-displaylink.rules "$pkgdir/etc/udev/rules.d/99-displaylink.rules" + install -D -m755 udev.sh "$pkgdir/opt/displaylink/udev.sh" + + echo "Installing DLM systemd service" + install -D -m644 displaylink.service "$pkgdir/usr/lib/systemd/system/displaylink.service" + install -D -m755 displaylink-sleep.sh "$pkgdir/usr/lib/systemd/system-sleep/displaylink.sh" + + COREDIR="$pkgdir/usr/lib/displaylink" + install -d -m755 $COREDIR + install -d -m755 "$pkgdir/var/log/displaylink" + + echo "Extracting DisplayLink Driver Package" + cd $srcdir + chmod +x displaylink-driver-$pkgver.run + ./displaylink-driver-$pkgver.run --target $pkgname-$pkgver --noexec + cd "$pkgname-$pkgver" + + if [ "$CARCH" == "i686" ]; then + ARCH="x86" + elif [ "$CARCH" == "x86_64" ]; then + ARCH="x64" + fi + + ARCH+="-ubuntu-1604" + + echo "Installing DisplayLink Manager $ARCH" + install -D -m755 $ARCH/DisplayLinkManager $COREDIR/DisplayLinkManager + + # I wonder if this is even necessary but I'm too lazy to find out + echo "Creating symlinks for evdi and libusb" + ln -s $(ldconfig -p | grep libevdi | awk 'NR==1{print $4}') $COREDIR/libevdi.so + + ln -s $(ldconfig -p | grep libusb- | awk 'NR==1{print $4}') $COREDIR/libusb-1.0.so.0.1.0 + ln -s $(ldconfig -p | grep libusb- | awk 'NR==1{print $4}') $COREDIR/libusb-1.0.so.0 + ln -s $(ldconfig -p | grep libusb- | awk 'NR==1{print $4}') $COREDIR/libusb-1.0.so + + echo "Installing firmware packages" + install -D -m644 *.spkg $COREDIR + + echo "Installing license file" + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/src/displaylink/displaylink-sleep.sh b/src/displaylink/displaylink-sleep.sh new file mode 100644 index 0000000..b47d5fd --- /dev/null +++ b/src/displaylink/displaylink-sleep.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright (c) 2015 - 2016 DisplayLink (UK) Ltd. + +suspend_dlm() +{ + #flush any bytes in pipe + while read -n 1 -t 1 SUSPEND_RESULT < /tmp/PmMessagesPort_out; do : ; done; + + #suspend DisplayLinkManager + echo "S" > /tmp/PmMessagesPort_in + + if [ -f /tmp/PmMessagesPort_out ]; then + #wait until suspend of DisplayLinkManager finish + read -n 1 -t 10 SUSPEND_RESULT < /tmp/PmMessagesPort_out + fi +} + +resume_dlm() +{ + #resume DisplayLinkManager + echo "R" > /tmp/PmMessagesPort_in +} + +case "\$1/\$2" in + pre/*) + suspend_dlm + ;; + post/*) + resume_dlm + ;; +esac + diff --git a/src/displaylink/displaylink.service b/src/displaylink/displaylink.service new file mode 100644 index 0000000..a67491f --- /dev/null +++ b/src/displaylink/displaylink.service @@ -0,0 +1,14 @@ +[Unit] +Description=DisplayLink Manager Service +After=display-manager.service +Conflicts=getty@tty7.service + +[Service] +ExecStartPre=/sbin/modprobe evdi +ExecStart=/usr/lib/displaylink/DisplayLinkManager +Restart=always +WorkingDirectory=/usr/lib/displaylink +RestartSec=5 + +[Install] +WantedBy=graphical.target diff --git a/src/displaylink/release-note.txt b/src/displaylink/release-note.txt new file mode 100644 index 0000000..9344d95 --- /dev/null +++ b/src/displaylink/release-note.txt @@ -0,0 +1,124 @@ +============================================================================= +============================================================================= + +DisplayLink Ubuntu Software Release Note + +Version: 1.2.65 +Date: 5th October 2016 + +DisplayLink DL-5xxx, DL-3x00 Firmware Version: 9.0.37.80577 +DisplayLink DL-41xx Firmware Version: 9.0.37.80577 +Extensible Virtual Display Interface version included: 1.2.64 + +============================================================================= +============================================================================= + + +A. Introduction +=============== + +This is DisplayLink Driver Software v1.2.1 for Ubuntu. It provides initial, production quality support for DisplayLink USB 3.0 devices on specific variants of desktop Ubuntu Linux. + +The driver enables video support for products using DisplayLink USB 3.0 technology. Standard native Ubuntu drivers provide support for DisplayLink audio and Ethernet interfaces. + + +A1. Important notes about DL5xxx, DL-3x00 and DL-41xx Firmware +======================================================================= + +This software release contains an embedded firmware image. DL-5xxx, DL-3xxx and DL-41xx devices will be automatically upgraded with this firmware upon connection if required. + +The upgrade is silent, therefore screens connected to DL-5xxx, DL-3xxx or DL-41xx devices may require a few seconds to appear when devices are connected for the first time, or after devices have been used on other platforms and OSes. + +B. Contents +=========== + +A. Introduction +A1. Important notes about DL-5xxx, DL-3xxx and DL-41xx Firmware +B. Contents +C. Issues fixed +D. Supported O/S variants +E. Release components +F. How to Install +G. Supported Features & Hardware +H. Limitations & Known issues +I. Future Development + +C. Issues fixed +=============== + +Issues fixed since DisplayLink Driver Software v1.2 for Ubuntu (1.2.58) +----------------------------------------------------------------------- + +Extensible Virtual Display Interface module is not compatible with Linux kernel 4.8. (23848) + + +Issues fixed since DisplayLink Driver Software v1.1 for Ubuntu (1.1.62) +----------------------------------------------------------------------- + +High CPU usage with no activity on DisplayLink monitor. (22444) + +Kernel warning in dmesg after connecting DisplayLink monitor. (22530) + +Segmentation fault could occur while stopping DisplayLink daemon. (22536) + +DisplayLink systemd/upstart service is only loaded when a DisplayLink device is connected. (23187) + + +D. Supported O/S variants +========================= + +This release has been prepared to be compatible with Ubuntu 16.04 and Ubuntu 14.04. Other variants and editions may be compatible if they meet minimum O/S requirements, but are not supported by DisplayLink. + +The Software contains binaries which work on Intel x86 platform (32 bit and 64 bit). +Minimum supported Linux Kernel version is 3.16. +Minimum supported Xorg version is 1.16. + +E. Release components +===================== +The Software consists of an open-source kernel mode driver (EVDI) with an accompanying library (libevdi), and a supporting binary application compatible with Intel x86 platform. +Source code for the open-source components can be found at DisplayLink's GitHub, https://github.com/DisplayLink + +F. How to Install +================= + +To install the release, from a terminal window, with root permissions use the command: + +sudo ./displaylink-driver-XXXX.run + +Where displaylink-driver-XXXX.run is the name of the extracted DisplayLink driver. + +The dkms framework is required for installation of DisplayLink. This can be installed with the command: sudo apt-get install dkms + +More detailed information on installation can be found at http://support.displaylink.com/knowledgebase/articles/615714#ubuntu + +G. Supported Features & Hardware +================================ + +This driver will support up to 2 displays connected to DisplayLink devices. More than 2 DisplayLink displays may work, but not supported or tested by DisplayLink. + +Resolutions up to 4K are supported on the appropriate DisplayLink hardware. + +Device families supported: +- DL-5xxx +- DL-41xx +- DL-3xxx + +Support for DL-1x5 and DL-1x0 devices is provided by the open source udl driver. + +H. Limitations & Known issues +============================= + +A list of limitations and known issues can be found here: +http://support.displaylink.com/knowledgebase/articles/641668 + +I. Future Development +====================== + +DisplayLink are open to suggestions and feedback on improving the proposed architecture and will gladly review patches or proposals from the developer community. Please find a current list of areas we identify as requiring attention below. + +- In this release, the user mode driver service is running with root permissions. In future versions, we would like to reduce the privilege level required for this process – e.g. by using a separate low-privileged user and a separate group, to ensure the permissions needed for driving DisplayLink screens are as low as possible. + +- The communication between the EVDI kernel module and the wrapper libevdi library is not access-controlled or authenticated. This could be improved in future releases, making it harder to compromise the data EVDI is sending and receiving. + +- EVDI kernel module driver is currently a platform_driver, for multiple reasons; most importantly because virtual displays are not discoverable, i.e. cannot be enumerated at the hardware level. EVDI is also a generic device, not tied to any particular kind of device, transport layer or a bus. + diff --git a/src/displaylink/udev.sh b/src/displaylink/udev.sh new file mode 100644 index 0000000..41869be --- /dev/null +++ b/src/displaylink/udev.sh @@ -0,0 +1,79 @@ +#!/bin/sh +# Copyright (c) 2016 DisplayLink (UK) Ltd. +# File autogenerated by udev-installer.sh script + +get_evdi_dev_count() +{ + if [ "$(ls -l /sys/devices/platform/* | grep evdi | wc -l)" = "0" ]; then + echo "0" + return + fi + + cat /sys/devices/platform/evdi.*/drm/card*/card*/status | grep "^connected$" | wc -l +} + +get_displaylink_dev_count() +{ + cat /sys/bus/usb/devices/*/idVendor | grep 17e9 | wc -l +} + +start_displaylink() +{ + if [ "$(get_displaylink_dev_count)" != "0" ]; then + start_service + fi +} + +try_stop_displaylink() +{ + if [ "$(get_evdi_dev_count)" = "0" ]; then + parent_dev_path="$1" + if [ -d "$parent_dev_path" ]; then + echo "1" + return + fi + + if [ "$(get_displaylink_dev_count)" = "0" ]; then + stop_service + echo "0" + return + fi + fi + echo "1" +} + +stop_displaylink() +{ + parent_devpath=$(dirname /sys$1) + retry_num="50" # 5s + while [ "$(try_stop_displaylink $parent_devpath)" != "0" ] && [ "$retry_num" != "0" ]; + do + sleep 0.1 + retry_num=$((retry_num-1)) + done +} + +main() +{ + op=$1 + devpath=$2 + if [ "$op" = "START" ]; then + start_displaylink + elif [ "$op" = "STOP" ]; then + stop_displaylink $devpath + fi +} + +start_service() +{ + systemctl start displaylink.service +} + +stop_service() +{ + systemctl stop displaylink.service +} + + +main $1 $2 + diff --git a/src/evdi/.SRCINFO b/src/evdi/.SRCINFO new file mode 100644 index 0000000..5479ae3 --- /dev/null +++ b/src/evdi/.SRCINFO @@ -0,0 +1,18 @@ +# Generated by mksrcinfo v8 +# Thu Oct 13 12:14:59 UTC 2016 +pkgbase = evdi + pkgdesc = A Linux® kernel module that enables management of multiple screens. + pkgver = 1.2.64 + pkgrel = 1 + url = https://github.com/DisplayLink/evdi + install = evdi.install + changelog = evdi.Changelog + arch = i686 + arch = x86_64 + license = GPL + depends = dkms + source = evdi-1.2.64.tar.gz::https://github.com/DisplayLink/evdi/archive/v1.2.64.tar.gz + md5sums = 5616e0c8f57e4d10de5e7f2a85d919d6 + +pkgname = evdi + diff --git a/src/evdi/.gitignore b/src/evdi/.gitignore new file mode 100644 index 0000000..b20752a --- /dev/null +++ b/src/evdi/.gitignore @@ -0,0 +1,4 @@ +*.tar.gz +*.tar.xz +pkg/ +src/ diff --git a/src/evdi/PKGBUILD b/src/evdi/PKGBUILD new file mode 100644 index 0000000..58a0dc4 --- /dev/null +++ b/src/evdi/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: PlusMinus + +pkgname=evdi +pkgver=1.2.64 +pkgrel=1 +pkgdesc="A Linux® kernel module that enables management of multiple screens." +arch=('i686' 'x86_64') +url="https://github.com/DisplayLink/evdi" +license=('GPL') +groups=() +depends=(dkms) +makedepends=() +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install=$pkgname.install +changelog=$pkgname.Changelog +source=($pkgname-$pkgver.tar.gz::https://github.com/DisplayLink/evdi/archive/v$pkgver.tar.gz) +noextract=() +md5sums=('5616e0c8f57e4d10de5e7f2a85d919d6') + +build() { + # We only need to build the library in this step, dmks will build the module + cd "$pkgname-$pkgver/library" + + make +} + +package() { + # Predfine some target folders + SRCDIR="$pkgdir/usr/src/$pkgname-$pkgver" # This one is needed for dkms + LIBNAME=lib$pkgname + + cd "$pkgname-$pkgver" + + install -D -m 755 library/$LIBNAME.so $pkgdir/usr/lib/$LIBNAME.so + + install -d $SRCDIR + install -D -m 755 module/* $SRCDIR +} diff --git a/src/evdi/evdi.Changelog b/src/evdi/evdi.Changelog new file mode 100644 index 0000000..224841c --- /dev/null +++ b/src/evdi/evdi.Changelog @@ -0,0 +1,5 @@ +v1.2.64 +Highlights: fixes for kernel 4.8. + +v1.2.55 +Module and library code to be included in DisplayLink USB Graphics Software for Ubuntu, version 1.2. diff --git a/src/evdi/evdi.install b/src/evdi/evdi.install new file mode 100644 index 0000000..89a7655 --- /dev/null +++ b/src/evdi/evdi.install @@ -0,0 +1,20 @@ +# old version (without -$pkgrel): ${1%%-*} +# new version (without -$pkgrel): ${2%%-*} + +post_install() { + echo 'DKMS install...' + dkms install evdi/${1%%-*} +} + +pre_upgrade() { + pre_remove ${2%%-*} +} + +post_upgrade() { + post_install ${1%%-*} +} + +pre_remove() { + echo 'DKMS remove...' + dkms remove evdi/${1%%-*} --all +}