Comments (6)
The lines that udev is complaining about look to me like no-op lines that were meant to effectively just serve as comments.
# Sony Ericsson
ATTR{idVendor}!="0fce", GOTO="not_Sony_Ericsson"
ENV{adb_user}="yes"
# Xperia X10 mini
ATTR{idProduct}=="3137"
ATTR{idProduct}=="2137", SYMLINK+="android_adb"
# Xperia X10 mini pro
ATTR{idProduct}=="3138"
ATTR{idProduct}=="2138", SYMLINK+="android_adb"
# Xperia X8
ATTR{idProduct}=="3149"
ATTR{idProduct}=="2149", SYMLINK+="android_adb"
# Xperia X12
ATTR{idProduct}=="e14f"
ATTR{idProduct}=="614f", SYMLINK+="android_adb"
This snippet is a good example. What's happening here is that the author of this portion of the file has decided to document both the normal and debug mode USB product ID's for each of these devices. But then they only actually do anything to the latter type. (So, in effect, the function of the non-debug-mode PID lines, e.g. ATTR{idProduct}=="3137"
, is simply to say "3137 is the PID the X10 mini would have when NOT in debug mode", and to then explicitly show that nothing should be done in that case, as a contrast to PID 2137.)
Prior to systemd/udev v243, these lines would just silently be ignored. But in v243 (which, not coincidentally, was released on Sep 3 2019), a warning was added for cases where a line in a udev rules file has at least one syntactically valid match key, but then lacks any assignment/action keys that would do anything based on the matches.
So, as of udev v243 and later, this weird quirky pseudo-comment syntax used multiple times in this file is no longer a valid thing and generates annoying warnings.
There are a few ways the rules file could be modified to fix this and get rid of the warnings:
- (Best) Rather than having rule lines that match but then do nothing, just use the comment syntax to document what the non-debug USB PID is for each device instead. There is literally no point to a rule that matches a USB PID and then takes no actions based on that match.
- (Dumb) Make these lines technically correct by adding a
GOTO
after the matching part. (Probably toandroid_usb_rule_match
, I would assume?) This approach works because doing aGOTO
is technically an action. It's a pretty stupid fix though. - (Dumb) Make these lines technically correct by having them define an unused
LABEL
after the matching part. This approach works because defining aLABEL
is technically an action. As with the previous idea, this one is also stupid.
This is mainly due to the weird setup here with the conditionals. As per specification udev rules are not meant to be dynamic. What's being done here with the conditionals and then if checks makes it more readable, but is inherently out of spec imo. This will be resolved if all rules include both idVendor and idProduct checks instead of checking once per vendor.
Nah, the LABEL
/GOTO
stuff is technically fine, really; it arguably does make things more readable. The problem here has strictly to do with rules that match but don't act; those are certainly out of spec.
from android-udev-rules.
This is mainly due to the weird setup here with the conditionals. As per specification udev rules are not meant to be dynamic. What's being done here with the conditionals and then if checks makes it more readable, but is inherently out of spec imo. This will be resolved if all rules include both idVendor and idProduct checks instead of checking once per vendor.
from android-udev-rules.
There are a few ways the rules file could be modified to fix this and get rid of the warnings:
I would love to see this fixed. (It's pretty annoying in the systemd journal.)
from android-udev-rules.
Here are my error messages:
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:89 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:226 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:237 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:319 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:367 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:369 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:371 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:540 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:543 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:546 The line takes no effect, ignoring.
systemd-udevd[PID]: /usr/lib/udev/rules.d/51-android.rules:549 The line takes no effect, ignoring.
This is my file: 51-android.rules
So the problematic lines are:
89: ATTR{idProduct}=="7030"
226: ATTR{idProduct}=="0c93"
237: ATTR{idProduct}=="0c01"
319: ATTR{idProduct}=="618f"
367: ATTR{idProduct}=="2d66"
369: ATTR{idProduct}=="428c"
371: ATTR{idProduct}=="41db"
540: ATTR{idProduct}=="3137"
543: ATTR{idProduct}=="3138"
546: ATTR{idProduct}=="3149"
549: ATTR{idProduct}=="e14f"
from android-udev-rules.
Closed with commit 8a21289 and released with 20200410. Thanks!
from android-udev-rules.
Thanks for your cooperation :D
from android-udev-rules.
Related Issues (20)
- New Kindle 10 HD HOT 13
- Motorola Moto E22i HOT 8
- Does not work on fedora HOT 2
- Meizu M6T HOT 2
- Motorola Moto Z3 Play HOT 2
- Samsung Galaxy A5 (2016)
- 51-android.rules breaks some compatibility after upgrading HOT 1
- add a gh/action for rudimentary tests HOT 5
- No fastboot permissions on Motorola phones HOT 5
- updating from 20230614 to 20231030 breaks udev rule for pixel 6a HOT 5
- "no permissions" for fastboot on Debian 12.2 HOT 8
- OnePlus 6T - No sideload and fastboot permissions HOT 5
- ADB no longer works on Quest hardware HOT 3
- Samsung Galaxy s24 not detected HOT 6
- unauthorized device (Android Recovery) even after updating the rules and replugging the USB cable HOT 4
- udev rules for Poco F4 5g? HOT 1
- Please add udev for Moto G54 HOT 1
- Fastboot doesn't work, but ADB does (Fedora 40) HOT 1
- Support ADB Webcam devices
- install.sh does not work on fedora HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-udev-rules.