containers/toolbox

Avrdude can not access JTAG debugger over USB

Jacalz opened this issue · 2 comments

Describe the bug
A clear and concise description of what the bug is. If possible, re-run the command(s) with --log-level debug and put the output here.

Steps how to reproduce the behaviour

  1. Try to flash an AVR chip using avrdude and a USB-connected Atmel ICE JTAG module.
  2. See error about not being able to access the

Expected behaviour
A clear and concise description of what you expected to happen.

Running with sudo should allow access to USB devices.

Actual behaviour
A clear and concise description of what actually happened.

$ sudo avrdude -p m1284p -c atmelice -e -U build/control.elf 
avrdude: usbhid_open(): No device found
avrdude: usbdev_open(): cannot open device: Permission denied
avrdude: jtag3_open_common(): Did not find any device matching VID 0x03eb and PID list: 0x2141

avrdude done.  Thank you.

Output of toolbox --version (v0.0.90+)

toolbox version 0.0.99.4

Toolbox package info (rpm -q toolbox)
e.g., toolbox-0.0.18-2.fc32.noarch

Output of podman version

Client:       Podman Engine
Version:      4.7.2
API Version:  4.7.2
Go Version:   go1.21.1
Built:        Tue Oct 31 15:32:01 2023
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)

podman-4.7.2-1.fc39.x86_64

Info about your OS

Fedora Silverblue 39

Additional context

I suppose thet the container does not have access to the USB devices because sudo within the container isn't the same as outside?

You could try to run toolbox(1) as root:

# toolbox create
...
# toolbox enter
⬢# avrdude -p m1284p -c atmelice -e -U build/control.elf
...

I suppose thet the container does not have access to the USB devices because sudo within the container isn't the same as outside?

Yes. When toolbox(1) is run rootless, the root inside the container isn't the same as root on the host, because there's a user namespace at play.

That seems to fix things. Thanks.