Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udev rules do not match devices in recovery/DFU mode #230

Open
apsun opened this issue Sep 29, 2023 · 4 comments
Open

udev rules do not match devices in recovery/DFU mode #230

apsun opened this issue Sep 29, 2023 · 4 comments

Comments

@apsun
Copy link

apsun commented Sep 29, 2023

While using idevicerestore I noticed that it would fail with LIBUSB_ERROR_ACCESS unless run as root. It looks like when the device is rebooted into recovery mode, the udev rules no longer match and so the files are not owned by the usbmux user, causing the command to fail.

From lsusb:

Recovery mode:

Bus 001 Device 024: ID 05ac:1281 Apple, Inc. Apple Mobile Device [Recovery Mode]

DFU mode:

Bus 001 Device 025: ID 05ac:1227 Apple, Inc. Mobile Device (DFU Mode)

I don't have any other devices to test with, but based on a quick search I found https://devicehunt.com/view/type/usb/vendor/05AC which leads me to believe that the device IDs are the same for all devices in recovery/DFU mode. Would it make sense to add these to https://github.com/libimobiledevice/usbmuxd/blob/master/udev/39-usbmuxd.rules.in?

@nikias
Copy link
Member

nikias commented Sep 29, 2023

@apsun
Copy link
Author

apsun commented Sep 29, 2023

Oh I see, sorry I missed that. It seems like the libirecovery udev rule doesn't set OWNER="usbmux", but instead OWNER="root", GROUP="storage" - is that expected?

@nikias
Copy link
Member

nikias commented Sep 29, 2023

Yes. The device file is not supposed to be used by usbmuxd at all, so it doesn't need usbmux permissions. Instead, the current user (or the user that is supposed to use irecovery/idevicerestore) should be in the storage group. That group is default on ubuntu and debian to my knowledge.

@apsun
Copy link
Author

apsun commented Sep 29, 2023

Ah, that explains it. I'm running Arch and never added my user to that group. Although it doesn't look like Ubuntu or Debian automatically add that group either nowadays and instead use systemd + uaccess to automatically grant the current user access (that said, I don't have an install on hand to test, and this is all very new to me as well)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants