displaylink: changed systemd start to not block (#51760)

Previously during boot, displaylink would hang during boot for the 2
minutes timeout.
This commit is contained in:
eyJhb 2018-12-09 12:48:15 +01:00 committed by Jörg Thalheim
parent f350904688
commit f0f36737e2
2 changed files with 28 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, lib, unzip, utillinux,
libusb1, evdi, systemd, makeWrapper, requireFile }:
libusb1, evdi, systemd, makeWrapper, requireFile, substituteAll }:
let
arch =
@ -33,17 +33,23 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ unzip makeWrapper ];
buildCommand = ''
unpackPhase = ''
unzip $src
chmod +x displaylink-driver-${version}.run
./displaylink-driver-${version}.run --target . --noexec
'';
patches = [ (substituteAll {
src = ./udev-installer.patch;
inherit systemd;
})];
installPhase = ''
sed -i "s,/opt/displaylink/udev.sh,$out/lib/udev/displaylink.sh,g" udev-installer.sh
( source udev-installer.sh
mkdir -p $out/lib/udev/rules.d
main systemd "$out/lib/udev/rules.d/99-displaylink.rules" "$out/lib/udev/displaylink.sh"
)
sed -i '2iPATH=${systemd}/bin:$PATH' $out/lib/udev/displaylink.sh
install -Dt $out/lib/displaylink *.spkg
install -Dm755 ${bins}/DisplayLinkManager $out/bin/DisplayLinkManager
@ -53,13 +59,12 @@ in stdenv.mkDerivation rec {
$out/bin/DisplayLinkManager
wrapProgram $out/bin/DisplayLinkManager \
--run "cd $out/lib/displaylink"
fixupPhase
'';
dontStrip = true;
dontPatchELF = true;
meta = with stdenv.lib; {
description = "DisplayLink DL-5xxx, DL-41xx and DL-3x00 Driver for Linux";
platforms = [ "x86_64-linux" "i686-linux" ];

View File

@ -0,0 +1,18 @@
--- a/udev-installer.sh 2018-12-09 12:05:53.772318942 +0100
+++ b/udev-installer.sh 2018-12-09 12:06:19.939947629 +0100
@@ -21,12 +21,12 @@
cat <<'EOF'
start_service()
{
- systemctl start dlm
+ @systemd@/bin/systemctl start --no-block dlm
}
stop_service()
{
- systemctl stop dlm
+ @systemd@/bin/systemctl stop dlm
}
EOF