FS#50056 - [usb_modeswitch] usb_modeswitch@.service is not installed
Attached to Project:
Community Packages
Opened by felix (fstirlitz) - Friday, 15 July 2016, 22:24 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 18 July 2016, 11:04 GMT
Opened by felix (fstirlitz) - Friday, 15 July 2016, 22:24 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 18 July 2016, 11:04 GMT
|
Details
The file usb_modeswitch@.service from the source package is
not installed, preventing the package from working under
systemd.
This can be fixed by setting SYSDIR= appropriately in package() after making sure the desired target directory exists. |
This task depends upon
> $ pacman -Qi usb_modeswitch
Name : usb_modeswitch
Version : 2.3.0-1
Description : Activating switchable USB devices on Linux.
Architecture : x86_64
URL : http://www.draisberghof.de/usb_modeswitch/
Licenses : GPL
Groups : None
Provides : None
Depends On : libusb tcl
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 319.00 KiB
Packager : Sergej Pupykin <pupykin.s+arch@gmail.com>
Build Date : Mon 15 Feb 2016 06:02:21 PM CET
Install Date : Sun 17 Jul 2016 03:56:30 PM CEST
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
> $ pacman -Qlk usb_modeswitch | awk '{print $2}' | grep -v "^/usr/share/usb_modeswitch/"
/etc/
/etc/usb_modeswitch.conf
/etc/usb_modeswitch.d/
/etc/usb_modeswitch.setup
/usr/
/usr/bin/
/usr/bin/usb_modeswitch
/usr/bin/usb_modeswitch_dispatcher
/usr/lib/
/usr/lib/udev/
/usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/40-usb_modeswitch.rules
/usr/lib/udev/usb_modeswitch
/usr/share/
/usr/share/man/
/usr/share/man/man1/
/usr/share/man/man1/usb_modeswitch.1.gz
/usr/share/man/man1/usb_modeswitch_dispatcher.1.gz
/var/
/var/lib/
/var/lib/usb_modeswitch/
450
systemctl --no-block start usb_modeswitch@$p1'_'$p2.service
but that line won't succeed if the service file specified in this bug report is missing. This defect can be worked around by running /usr/bin/usb_modeswitch manually.
I was not aware of the fact that udev in turn calls a systemd service. Still I don't seem to get my head around this.
* as shown above, 2.3.0 did *not* come with a service file and *did* work
* 2.4.0 does not come with a service file either and *does not* work
Moreover, neither the upstream Makefile, nor the the Arch PKGBUILD contain changes other than versions or checksums, see your commit
https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/usb_modeswitch&id=3c2885a101e93a0873e7e1e7c1f9d49f252d58fb
and
> $ wget --quiet http://www.draisberghof.de/usb_modeswitch/usb-modeswitch{2.3,2.4}.0.tar.bz2
> $ for i in {2.3,2.4}; do tar -jxvf usb-modeswitch-$i.0.tar.bz2 usb-modeswitch-$i.0/Makefile; done
usb-modeswitch-2.3.0/Makefile
usb-modeswitch-2.4.0/Makefile
tar: A lone zero block at 2616
> $ diff usb-modeswitch-{2.3,2.4}.0/Makefile
2c2
< VERS = 2.3.0
---
> VERS = 2.4.0
Accordingly, the SYSDIR variable in the Makefile is as much set (or not) as before. As a consequence, the service file should get installed in either of the two versions in question or in none. And for what I think I have found out, it gets installed in none of them, yet still works in 2.3.0.
Therefore: Are you sure, this is SYSDIR related? And why would you set it in the PKGBUILD when it is already set in the Makefile?
Sorry if I'm bothering you, just really curious to find out what's going on.
Seems like the problem with hwids or device-mapper packages
> $ pacman -Q usb_modeswitch linux device-mapper
usb_modeswitch 2.4.0-1
linux 4.6.4-1
device-mapper 2.02.160-2
My package versions correspond to yours - still not working.
Yes, I'm bloody sure.
--- usb-modeswitch-2.3.0/usb_modeswitch.sh
+++ usb-modeswitch-2.4.0/usb_modeswitch.sh
[SNIP]
- if [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then
- exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service
[SNIP]
+init_path=`readlink /sbin/init`
+if [ `basename $init_path` = "systemd" ]; then
+ systemctl --no-block start usb_modeswitch@$p1'_'$p2.service
[SNIP]
> And why would you set it in the PKGBUILD when it is already set in the Makefile?
Because it points to /usr/lib/systemd in the actual system root, and not to the mock root in $pkgdir.
But more importantly, I know this fixes the problem because I actually tested it.
If you're going to do some research, do it a little more thoroughly, will you? Maybe you wouldn't need to ask such questions.