Bug 2356537

Summary: Need udev rules for fastboot/adb to work as unpriv users.
Product: [Fedora] Fedora Reporter: Maciej Żenczykowski <zenczykowski>
Component: android-toolsAssignee: Ivan Afonichev <ivan.afonichev>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: 7d28c752, 8ru2u4gz, admiller, epel-packagers-sig, fedoraaccounts, go-sig, ivan.afonichev, jeroen, priv.luk
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://gitlab.com/CalyxOS/calyxos/-/issues/3055
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-05-10 07:52:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maciej Żenczykowski 2025-04-01 11:05:26 UTC
There's a lot more info at https://gitlab.com/CalyxOS/calyxos/-/issues/3055 but basically need udev rules to grant 'uaccess' to fastboot/adb devices.

Reproducible: Always

Comment 1 Maciej Żenczykowski 2025-04-01 11:07:27 UTC
Simplest fix might be to just add /usr/lib/udev/rules.d/60_adb.rules:

# Google Nexus/Pixel Device (fastboot or adb, Android Debug Bridge)
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee0", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee4", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee6", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee7", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee9", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4eec", TAG+="uaccess"
ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4eee", TAG+="uaccess"

to the package, but that's Google Pixel centric.
See also https://raw.githubusercontent.com/M0Rf30/android-udev-rules/refs/heads/main/51-android.rules

Comment 2 Łukasz Patron 2025-04-01 11:46:58 UTC
@van would it be ok to ship https://github.com/M0Rf30/android-udev-rules just like Debian and the like?

I uploaded changes for that to https://src.fedoraproject.org/fork/luk1337/rpms/android-tools, additionally maybe it'd make sense to get rid of GROUP="adbusers" in 51-android.rules.

Comment 3 Maciej Żenczykowski 2025-04-01 19:31:45 UTC
A few comments:

(a) I'm not a huge fan of the 'code style' of android-udev-rules, furthermore:
- the 'adbusers' group is perhaps unneeded? or maybe useful for something? not sure
- the symlinks it creates - is there a use for them? not aware of any, but not sure
I don't think 'adb' or 'webusb' actually need either of those features...

(b) it's not clear whether this should live in android-tools rpm package or elsewhere, it *is* a dependency of both adb/fastboot (which is in the package) but also and any WebUsb capable browsers (incl. Chrome from G, but also presumably Chromium & maybe others) when you visit a website like https://flash.android.com/ or https://install.calyxos.org/ because of this, possibly the udev rules should like in some more 'central' 'core' udev rule package, so that you wouldn't need to install android-tools to make things work in the browser...

(c) I think webusb browser support on fedora likely suffers the same issue for webserial and webusb serial dongles... [though probably outside the scope of this bug??]

Comment 4 Łukasz Patron 2025-04-01 19:39:26 UTC
(In reply to Maciej Żenczykowski from comment #3)
> A few comments:
> 
> (a) I'm not a huge fan of the 'code style' of android-udev-rules,
> furthermore:
> - the 'adbusers' group is perhaps unneeded? or maybe useful for something?
> not sure
> - the symlinks it creates - is there a use for them? not aware of any, but
> not sure
> I don't think 'adb' or 'webusb' actually need either of those features...
> 
> (b) it's not clear whether this should live in android-tools rpm package or
> elsewhere, it *is* a dependency of both adb/fastboot (which is in the
> package) but also and any WebUsb capable browsers (incl. Chrome from G, but
> also presumably Chromium & maybe others) when you visit a website like
> https://flash.android.com/ or https://install.calyxos.org/ because of this,
> possibly the udev rules should like in some more 'central' 'core' udev rule
> package, so that you wouldn't need to install android-tools to make things
> work in the browser...
> 
> (c) I think webusb browser support on fedora likely suffers the same issue
> for webserial and webusb serial dongles... [though probably outside the
> scope of this bug??]

In case we aren't supposed to deliver udev rules here, it'd likely make sense to do it here https://github.com/systemd/systemd/blob/main/rules.d/70-uaccess.rules.in and wait for next systemd release.

Comment 5 Łukasz Patron 2025-04-01 19:40:23 UTC
(In reply to Łukasz Patron from comment #4)
> (In reply to Maciej Żenczykowski from comment #3)
> > A few comments:
> > 
> > (a) I'm not a huge fan of the 'code style' of android-udev-rules,
> > furthermore:
> > - the 'adbusers' group is perhaps unneeded? or maybe useful for something?
> > not sure
> > - the symlinks it creates - is there a use for them? not aware of any, but
> > not sure
> > I don't think 'adb' or 'webusb' actually need either of those features...
> > 
> > (b) it's not clear whether this should live in android-tools rpm package or
> > elsewhere, it *is* a dependency of both adb/fastboot (which is in the
> > package) but also and any WebUsb capable browsers (incl. Chrome from G, but
> > also presumably Chromium & maybe others) when you visit a website like
> > https://flash.android.com/ or https://install.calyxos.org/ because of this,
> > possibly the udev rules should like in some more 'central' 'core' udev rule
> > package, so that you wouldn't need to install android-tools to make things
> > work in the browser...
> > 
> > (c) I think webusb browser support on fedora likely suffers the same issue
> > for webserial and webusb serial dongles... [though probably outside the
> > scope of this bug??]
> 
> In case we aren't supposed to deliver udev rules here, it'd likely make
> sense to do it here
> https://github.com/systemd/systemd/blob/main/rules.d/70-uaccess.rules.in and
> wait for next systemd release.

Also, it seems like there's an open issue for that https://github.com/systemd/systemd/issues/23468

Comment 6 Łukasz Patron 2025-04-01 20:25:50 UTC
(In reply to Łukasz Patron from comment #5)
> (In reply to Łukasz Patron from comment #4)
> > (In reply to Maciej Żenczykowski from comment #3)
> > > A few comments:
> > > 
> > > (a) I'm not a huge fan of the 'code style' of android-udev-rules,
> > > furthermore:
> > > - the 'adbusers' group is perhaps unneeded? or maybe useful for something?
> > > not sure
> > > - the symlinks it creates - is there a use for them? not aware of any, but
> > > not sure
> > > I don't think 'adb' or 'webusb' actually need either of those features...
> > > 
> > > (b) it's not clear whether this should live in android-tools rpm package or
> > > elsewhere, it *is* a dependency of both adb/fastboot (which is in the
> > > package) but also and any WebUsb capable browsers (incl. Chrome from G, but
> > > also presumably Chromium & maybe others) when you visit a website like
> > > https://flash.android.com/ or https://install.calyxos.org/ because of this,
> > > possibly the udev rules should like in some more 'central' 'core' udev rule
> > > package, so that you wouldn't need to install android-tools to make things
> > > work in the browser...
> > > 
> > > (c) I think webusb browser support on fedora likely suffers the same issue
> > > for webserial and webusb serial dongles... [though probably outside the
> > > scope of this bug??]
> > 
> > In case we aren't supposed to deliver udev rules here, it'd likely make
> > sense to do it here
> > https://github.com/systemd/systemd/blob/main/rules.d/70-uaccess.rules.in and
> > wait for next systemd release.
> 
> Also, it seems like there's an open issue for that
> https://github.com/systemd/systemd/issues/23468

https://github.com/systemd/systemd/pull/36939

Comment 7 Łukasz Patron 2025-04-18 09:05:23 UTC
With https://src.fedoraproject.org/rpms/systemd/pull-request/205 merged, the fix will eventually reach rawhide and others.

Comment 8 Maciej Żenczykowski 2025-04-18 09:21:13 UTC
Could/should we cherrypick the fix into fedora?

Comment 9 Maciej Żenczykowski 2025-04-18 09:22:03 UTC
Oh, that is what you did.  Cool!

Comment 10 Fedora Update System 2025-05-08 17:42:03 UTC
FEDORA-2025-47eaba5cb6 (systemd-257.5-6.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-47eaba5cb6

Comment 11 Fedora Update System 2025-05-09 01:51:15 UTC
FEDORA-2025-47eaba5cb6 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-47eaba5cb6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-47eaba5cb6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Łukasz Patron 2025-05-09 06:10:53 UTC
*** Bug 1560662 has been marked as a duplicate of this bug. ***

Comment 13 Łukasz Patron 2025-05-09 06:10:57 UTC
*** Bug 2298299 has been marked as a duplicate of this bug. ***

Comment 14 Fedora Update System 2025-05-10 01:17:49 UTC
FEDORA-2025-47eaba5cb6 (systemd-257.5-6.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.