Bug 27414 - Permission error for fastboot-android - android.rules need be updated
Summary: Permission error for fastboot-android - android.rules need be updated
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: Mageia 8
Assignee: David GEIGER
QA Contact:
Depends on:
Reported: 2020-10-14 17:32 CEST by Morgan Leijström
Modified: 2020-11-25 14:53 CET (History)
3 users (show)

See Also:
Source RPM: android-tools
Status comment: We should also check cauldron


Description Morgan Leijström 2020-10-14 17:32:46 CEST
Description of problem:

1) Phone connected and i bootloader mode
2) $ fastboot-android devices
no permissions; see [http://developer.android.com/tools/device.html]    fastboot

Executed as root, it works; list my phone.

Also, adb from the same package works when launched as normal user, tested both OK:
$ adb devices
  list my phone, and
$ adb reboot bootloader
  make it reboot to boot loader

NOTE that adb works on booted phone OS, while fastboot works with the boot loader;
When boot loader is running, adb cannot list the device.
When OS is booted, fastboot do not list the phone, and interestingly do not get any permission error either.

When i plug my phone,in i see in journal kernel messages...
New USB device found, idVendor=18d1, idProduct=d00d, bcdDevice= 1.00
New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-2: Product: Android
usb 5-2: Manufacturer: Google

... and I have verified /usr/lib/udev/rules.d/51-android.rules do contain that ID:
#Google Inc. 
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", TAG+="systemd", ENV{SYSTEMD_WANTS}="adb.service"

For a shot in the dark, I made a link
/etc/udev/rules.d/51-android.rules -> /usr/lib/udev/rules.d/51-android.rules
(Because i fond that file location in a forum about permission problem)
Rebooted, but no change.
Comment 1 Morgan Leijström 2020-10-14 17:37:18 CEST
CC persons from other android-tools bugs

CC: (none) => cjw, geiger.david68210, lovaren

Morgan Leijström 2020-10-14 17:37:51 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=26180

Morgan Leijström 2020-10-14 17:38:33 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=26139

Comment 2 Morgan Leijström 2020-10-14 23:34:33 CEST

The rules need updating.

I replaced our packaged 51-android.rules with another i found recommended to solve others similar problems.  That file is much smaller and have a much more advanced structure.

The following worked for me:

__Retrieve newer
In a new temporary folder:
$ git clone https://github.com/M0Rf30/android-udev-rules.git

__Put in place
[root@svarten ~]# cp -a '/my/temporary/folder/android-udev-rules/51-android.rules' /usr/lib/udev/rules.d/51-android.rulescp: overwrite '/usr/lib/udev/rules.d/51-android.rules'? y
[root@svarten ~]# chmod a+r /usr/lib/udev/rules.d/51-android.rules
[root@svarten ~]# chown root:root /usr/lib/udev/rules.d/51-android.rules
[root@svarten ~]# ls -l /usr/lib/udev/rules.d/51-android.rules
-rw-r--r-- 1 root root 22967 okt 14 22:52 /usr/lib/udev/rules.d/51-android.rules

# systemctl restart systemd-udevd.service


_With phone in bootloader mode:
$ fastboot-android devices
A209K1NW0202    fastboot

** Hurray!!! **

_With phone booted normally:
$ adb devices
List of devices attached
A209K1NW0202    device

 - adb still works (did before also) -

   I do not know if the rules file i fetched is the optimal one.
   Or how to find the best.  Not my cup of tea.
@ Kristoffer?

Assigning to registered maintainer

Status comment: (none) => We should also check cauldron
See Also: https://bugs.mageia.org/show_bug.cgi?id=26139 => https://bugs.mageia.org/show_bug.cgi?id=24139
Assignee: bugsquad => geiger.david68210
Summary: Permission error for fastboot-android => Permission error for fastboot-android - android.rules need be updated

Comment 3 Morgan Leijström 2020-11-25 14:53:46 CET
I also had problem on cauldron, but was in a hurry so i just used root without digging into why or same fix works.  Probably.

Target Milestone: --- => Mageia 8

Note You need to log in before you can comment on or make changes to this bug.