Bug 27414 - Permission error for fastboot-android - android.rules need be updated
Summary: Permission error for fastboot-android - android.rules need be updated
Status: RESOLVED DUPLICATE of bug 28860
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: Mageia 8
Assignee: David GEIGER
QA Contact:
URL:
Whiteboard: MGA7TOO
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-14 17:32 CEST by Morgan Leijström
Modified: 2021-07-06 22:54 CEST (History)
3 users (show)

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


Attachments

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
FOUND IT!

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

__Testing:

_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) -


----------------------
NOTE:
   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

Summary: Permission error for fastboot-android => Permission error for fastboot-android - android.rules need be updated
Assignee: bugsquad => geiger.david68210
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

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

Comment 4 Aurelien Oudelet 2021-07-06 13:16:37 CEST
Mageia 7 is EOL since July 1st 2021.
There will not have any further bugfix for this release.

You are encouraged to upgrade to Mageia 8 as soon as possible.

@reporter, if this bug still apply with Mageia 8, please let us know it.

@packager, if you work on the Mageia 7 version of your package, please check the Mageia 8 package if issue is also present. In this case, please fix the Mageia 8 version instead.

This bug report will be closed OLD if there is no further notice within 1st September 2021.
Comment 5 Morgan Leijström 2021-07-06 22:54:24 CEST
Still valid, but being solved by Bug 28860
So closing this as duplicate

*** This bug has been marked as a duplicate of bug 28860 ***

Resolution: (none) => DUPLICATE
Status: NEW => RESOLVED
Version: 7 => 8
Whiteboard: (none) => MGA7TOO


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