avrdude-6.4-3: Explain USB device permission setup
- Add README.fedora explaining USB device permission setup
This commit is contained in:
parent
ce496de81b
commit
21248622d7
2 changed files with 78 additions and 1 deletions
70
README.fedora
Normal file
70
README.fedora
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
On the avrdude Fedora package
|
||||
=============================
|
||||
|
||||
This file contains remarks for users of the avrdude Fedora package.
|
||||
|
||||
|
||||
Programmer Device Permission Setup
|
||||
==================================
|
||||
|
||||
When you run `avrdude`, the avrdude process must be allowed to access
|
||||
the device special file somewhere in `/dev/` which corresponds to the
|
||||
programmer to be used.
|
||||
|
||||
`avrdude` support many different programmer types (run `avrdude -c
|
||||
list` to see a list of them).
|
||||
|
||||
Many of these programmer types are USB devices which appear as a
|
||||
device `/dev/bus/usb/<NNN>/<MMM>` with `<NNN>` and `<MMM>` being 3
|
||||
digit decimal numbers padded with `0`. Those devices can be easily
|
||||
matched in a udev rule looking for the USB idVendor and idProduct, and
|
||||
be made writable for the local user (`TAG+="uaccess"`).
|
||||
|
||||
See `/usr/lib/udev/rules.d/70-avrdude_usbprog.rules` for how that
|
||||
works.
|
||||
|
||||
Unfortunately, some programmers present as generic USB to serial
|
||||
converters (device file name `/dev/ttyUSB<N>`) or as generic USB
|
||||
AT-command devices (device file name `/dev/ttyACM<N>`).
|
||||
|
||||
While it is technically possible to make all `/dev/ttyUSB<N>` and/or
|
||||
`/dev/ttyACM<N>` devices writable for whichever Linux user happens to
|
||||
be the local user, some of those devices can be devices for which it
|
||||
is better if they are not being writable by anyone.
|
||||
|
||||
Therefore, the avrdude Fedora does *not* make all `/dev/ttyUSB<N>`
|
||||
and/or `/dev/ttyACM<N>` writable for the local user just by install
|
||||
the package.
|
||||
|
||||
If you *do* want to make these devices writable for any local user,
|
||||
you can configure your system yourself by dropping a udev rules file
|
||||
into `/etc/udev/rules.d/`. But while you are at it, you can as well
|
||||
examine your programmer close (`lsusb` and `lsusb -v` can be helpful
|
||||
here) and narrow down the udev rule matching to match only your
|
||||
programmer, not each and every `ttyUSB<N>` or `ttyACM<N>` device.
|
||||
|
||||
``` /etc/udev/rules.d/99-my-avrdude-programmers.rules
|
||||
ACTION!="add|change", GOTO="my_avrdude_programmers_end"
|
||||
|
||||
# Recommended: /dev/ttyUSB<N> devices matching specific idVendor/idProduct tuple
|
||||
SUBSYSTEM=="usb-serial", ATTR{idVendor}=="0123", ATTR{idProduct}=="4567", TAG+="uaccess"
|
||||
|
||||
# Recommended: /dev/ttyACM<N> devices matching specific idVendor/idProduct tuple
|
||||
SUBSYSTEM=="usb", DRIVERS=="cdc_acm", ATTR{idVendor}=="0123", ATTR{idProduct}=="4567", TAG+="uaccess"
|
||||
|
||||
# Discouraged: *ALL* /dev/ttyUSB<N> devices
|
||||
SUBSYSTEM=="usb-serial", TAG+="uaccess"
|
||||
|
||||
# Discouraged: *ALL* /dev/ttyACM<N> devices
|
||||
SUBSYSTEM=="usb", DRIVERS=="cdc_acm", TAG+="uaccess"
|
||||
|
||||
LABEL="my_avrdude_programmers_end"
|
||||
```
|
||||
|
||||
Unfortunately, the existing avrdude Fedora package udev rules do not
|
||||
support setting up permissions for non-local users, like e.g. users
|
||||
logged in via ssh. If you need such a setup, you will need also to
|
||||
write your own udev rules file for `/etc/udev/rules.d/`, and set
|
||||
`OWNER=`, `GROUP=`, `MODE=`, or change the device ACL with something
|
||||
like `RUN+="/usr/bin/setfacl -m g:avrdude-programmers:rw
|
||||
'$env{DEVNAME}'"`.
|
||||
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
Name: avrdude
|
||||
Version: 6.4
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Summary: Software for programming Atmel AVR Microcontroller
|
||||
|
||||
License: GPLv2+
|
||||
URL: https://www.nongnu.org/avrdude
|
||||
Source0: https://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.gz
|
||||
Source1: https://salsa.debian.org/debian/avrdude/-/raw/master/debian/avrdude.udev
|
||||
Source2: README.fedora
|
||||
# From: https://savannah.nongnu.org/bugs/?42517
|
||||
Patch0: avrdude-6.1_includes.patch
|
||||
# Stop granting blanket access to all /dev/tty{ACM,USB}* devices
|
||||
|
|
@ -79,10 +80,13 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libavrdude.so.1
|
|||
rm -f $RPM_BUILD_ROOT%{_libdir}/libavrdude.so.1.0.0
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_udevrulesdir}
|
||||
install -p -m 644 avrdude.udev $RPM_BUILD_ROOT%{_udevrulesdir}/%{udev_rules}
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_pkgdocdir}
|
||||
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_pkgdocdir}/README.fedora
|
||||
|
||||
|
||||
%files
|
||||
%doc README AUTHORS ChangeLog* COPYING NEWS doc/TODO
|
||||
%doc %{_pkgdocdir}/README.fedora
|
||||
%doc %{_pkgdocdir}/avrdude-html/
|
||||
%doc %{_pkgdocdir}/avrdude.pdf
|
||||
%doc %{_pkgdocdir}/avrdude.ps
|
||||
|
|
@ -94,6 +98,9 @@ install -p -m 644 avrdude.udev $RPM_BUILD_ROOT%{_udevrulesdir}/%{udev_rules}
|
|||
|
||||
|
||||
%changelog
|
||||
* Wed Apr 20 2022 Hans Ulrich Niedermann <hun@n-dimensional.de> - 6.4-3
|
||||
- Add README.fedora explaining USB device permission setup
|
||||
|
||||
* Wed Apr 20 2022 Hans Ulrich Niedermann <hun@n-dimensional.de> - 6.4-2
|
||||
- Install built documentation directly to %{_pkgdocdir}
|
||||
- Fix file locations in man page, texinfo docs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue