Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KevinMX opened this issue Jan 16, 2024 · 2 comments · Fixed by #42
Open

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

KevinMX opened this issue Jan 16, 2024 · 2 comments · Fixed by #42
Labels
area: device Issues related to `ruyi device` facilities
Milestone

Comments

@KevinMX
Copy link

KevinMX commented Jan 16, 2024

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

  • Stage 1: hold "BOOT" button and plug in the USB cable, flash u-boot to RAM
  • Stage 2: After a fastboot reboot, flash all images into onboard eMMC

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 xen0n added the area: device Issues related to `ruyi device` facilities label Jan 17, 2024
@xen0n
Copy link
Collaborator

xen0n commented Jan 17, 2024

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...

@xen0n xen0n added this to the 0.4 milestone Jan 17, 2024
xen0n added a commit to xen0n/ruyi that referenced this issue Jan 17, 2024
And fix the missing check for sudo.

Fixes: ruyisdk#39
@xen0n xen0n closed this as completed in #42 Jan 17, 2024
@KevinMX
Copy link
Author

KevinMX commented May 16, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: device Issues related to `ruyi device` facilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants