ruyisdk / ruyi

RuyiSDK Package Manager
Apache License 2.0
12 stars 5 forks source link

Device provision: warn users about adding udev rules for LPi4A #39

Open KevinMX opened 5 months ago

KevinMX commented 5 months ago

TL;DR: We should probably put a note somewhere; or just use sudo for fastboot, like what we did for dd, which should avoid the hassle:)

In the flashing process of LPi4A, there are two stages (or as I would probably call it):

Since ruyi does not run as root (as said by the RuyiSDK Device Provisioning Wizard & by design), and LPi4A's VID/PID is very unlikely to be there by default: udev rules (which, at least AFAIK, Debian & Arch are using this one)

# In stage 1
Bus 001 Device 012: ID 2345:7654 T-HEAD USB download gadget

# In stage 2
Bus 001 Device 011: ID 1234:8888 Brain Actuated Technologies USB download gadget

There's a change in the board's VID/PID between two stages, and this must be configured before we start the flashing process, since we're not running fastboot as root.

udev rules like this will be needed:

SUBSYSTEM=="usb", ATTR{idVendor}=="1234", MODE="0660", GROUP="adbusers", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="1234", ATTR{idProduct}=="8888", SYMLINK+="android_fastboot"
SUBSYSTEM=="usb", ATTR{idVendor}=="2345", MODE="0660", GROUP="adbusers", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="2345", ATTR{idProduct}=="7654", SYMLINK+="android_fastboot"
xen0n commented 5 months ago

Okay so I've checked last time I've flashed my LicheePi 4A I used sudo too. It's simplest to just call sudo fastboot and never worry again...

KevinMX commented 1 month ago

This issue comes back to us since ruyi 0.8.0+ changed the logic of invoking sudo, ruyi will wait for fastboot infinitely for a device which will never show up due to lack of udev rules...