1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

comms/usbmuxd: Workaround devd(8) race condition

When connecting an Apple device via USB, the device connects, usbmuxd is
started, then for reasons yet unknown, the device instantly disconnects,
and reconnects.

From dmesg when plugging in, for example:
ugen0.5: <Apple Inc. iPhone> at usbus0
<usbmuxd starts here>
ugen0.5: <Apple Inc. iPhone> at usbus0 (disconnected)
ugen0.5: <Apple Inc. iPhone> at usbus0

Due to the disconnect, the instance of usbmuxd that is spawned when the
device is first attached is subsequently killed by the unexplained
detach because the cdce(4) devices have not yet been created, but not
before the second instance of usbmuxd is started by the reattach. The
second instance automatically exits because two instances cannot run
simultaneously. The first instance then exits leaving no running
instances.

Adding a short sleep after the first instance is called to shutdown
gives it enough time to completely exit before the second instance is
spawned. Unfortunately, only one device is supported at a time until
I can figure out why the hotplugging isn't working.

While here, cleanup whitespace.

PR:		280014
Reported by:	<fabio.comolli@gmail.com>
This commit is contained in:
Jason E. Hale 2024-07-11 18:36:26 -04:00
parent 7f33849511
commit f4bd2eeb66
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,6 @@
PORTNAME= usbmuxd
DISTVERSION= 1.1.1-58
PORTREVISION= 1
DISTVERSIONSUFFIX= -gbc0b91c
CATEGORIES= comms
#MASTER_SITES= https://github.com/libimobiledevice/${PORTNAME}/releases/download/${DISTVERSION}/

View File

@ -16,11 +16,11 @@ notify 100 {
};
notify 100 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "DETACH";
match "vendor" "0x05ac";
match "product" "(0x12[9a][0-9a-f]|0x8600)";
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "DETACH";
match "vendor" "0x05ac";
match "product" "(0x12[9a][0-9a-f]|0x8600)";
action "%%PREFIX%%/sbin/usbmuxd -x";
action "sleep 5";
};