From c6b746e6fcb385eb3ea75250673c3cf6f3743538 Mon Sep 17 00:00:00 2001 From: Sol Bekic Date: Sat, 14 May 2022 16:26:59 +0200 Subject: [PATCH] package/usb_modeswitch: fix installation of systemd unit file The upstream Makefile failed to detect systemd being present in some (maybe all) builds, resulting in the unit file not being installed. Without the unit file, the udev rules in usb_modeswitch-data don't work as expected (no modeswitch is performed). This commit adds a patch that modifies the Makefile to include '$(PREFIX)/bin/systemctl' in the list of paths checked, which makes the installation phase work as intended. I will also submit this patch upstream. Signed-off-by: Sol Bekic Signed-off-by: Yann E. MORIN --- .../0001-fix-systemd-detection.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package/usb_modeswitch/0001-fix-systemd-detection.patch diff --git a/package/usb_modeswitch/0001-fix-systemd-detection.patch b/package/usb_modeswitch/0001-fix-systemd-detection.patch new file mode 100644 index 0000000000..d0b3e80aeb --- /dev/null +++ b/package/usb_modeswitch/0001-fix-systemd-detection.patch @@ -0,0 +1,18 @@ +Modify the Makefile to include '$(PREFIX)/bin/systemctl' in the list of paths. +This makes the udev intgeration work as intended when using systemd. + +Signed-off-by: Sol Bekic + +diff --git a/Makefile b/Makefile +index 22bd0e0..72321a4 100755 +--- a/Makefile ++++ b/Makefile +@@ -62,7 +62,7 @@ + install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher + install -d $(DESTDIR)/var/lib/usb_modeswitch + test -d $(UPSDIR) -a -e /sbin/initctl && install --mode=644 usb-modeswitch-upstart.conf $(UPSDIR) || test 1 +- test -d $(SYSDIR) -a \( -e /usr/bin/systemctl -o -e /bin/systemctl \) && install --mode=644 usb_modeswitch@.service $(SYSDIR) || test 1 ++ test -d $(SYSDIR) -a \( -e /usr/bin/systemctl -o -e /bin/systemctl -o -e $(PREFIX)/bin/systemctl \) && install --mode=644 usb_modeswitch@.service $(SYSDIR) || test 1 + + install: install-script +