Skip to content

Commit a8587b7

Browse files
committed
feat: add ODrive udev rule
1 parent ac2ffda commit a8587b7

5 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
install -d -m 700 /etc/NetworkManager/system-connections
3030
install -m 600 /src/files/dpea-eth0.nmconnection \
3131
/etc/NetworkManager/system-connections/dpea-eth0.nmconnection
32+
install -D -m 644 /src/files/91-odrive.rules /etc/udev/rules.d/91-odrive.rules
3233
# Reproduce replacement conflicts with the stock avahi package.
3334
apt-get install -y avahi-daemon libnss-mdns
3435
# Reproduce the conffile prompt caused by Raspberry Pi OS's modified config.
@@ -48,6 +49,8 @@ jobs:
4849
test -L /etc/systemd/system/serial-getty@ttyAMA0.service && echo "OK serial getty masked" || { echo "FAIL serial getty not masked"; fail=1; }
4950
test -f /etc/NetworkManager/system-connections/dpea-eth0.nmconnection \
5051
&& echo "OK eth0 profile present" || { echo "FAIL eth0 profile"; fail=1; }
52+
test -f /etc/udev/rules.d/91-odrive.rules \
53+
&& echo "OK odrive udev rule present" || { echo "FAIL odrive udev rule"; fail=1; }
5154
(service dbus start >/dev/null 2>&1 || true; avahi-daemon -D >/dev/null 2>&1 || true; sleep 2)
5255
if ss -lun 2>/dev/null | grep -q ":5358"; then echo "OK avahi listening on 5358"
5356
else echo "WARN could not confirm 5358 in container (verify on hardware)"; fi

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ dependencies and installs them with `uv`.
1717
`172.17.21.2/22` for a direct laptop-to-Pi cable.
1818
- **mDNS**: the patched avahi that serves mDNS on port **5358**.
1919
- **Tooling**: `uv`, system-wide.
20+
- **ODrive USB**: a udev rule (`91-odrive.rules`) makes ODrive devices accessible
21+
to non-root users, since `uv` cannot install udev rules.
2022

2123
### Shared apt packages (`packages.txt`)
2224

‎build-image.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ install -m 644 "$HERE/packages.txt" "$MNT/tmp/packages.txt"
4141
install -d -m 700 "$MNT/etc/NetworkManager/system-connections"
4242
install -m 600 "$HERE/files/dpea-eth0.nmconnection" \
4343
"$MNT/etc/NetworkManager/system-connections/dpea-eth0.nmconnection"
44+
install -m 644 "$HERE/files/91-odrive.rules" "$MNT/etc/udev/rules.d/91-odrive.rules"
4445
install -m 755 "$HERE/customize.sh" "$MNT/tmp/customize.sh"
4546
chroot "$MNT" /bin/bash /tmp/customize.sh
4647
rm -f "$MNT/tmp/customize.sh"

‎customize.sh‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin s
4545

4646
chown root:root /etc/NetworkManager/system-connections/dpea-eth0.nmconnection
4747
chmod 600 /etc/NetworkManager/system-connections/dpea-eth0.nmconnection
48+
chown root:root /etc/udev/rules.d/91-odrive.rules
49+
chmod 644 /etc/udev/rules.d/91-odrive.rules
4850

4951
apt-get clean
5052
rm -f /tmp/packages.txt

‎files/91-odrive.rules‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="0d[0-9][0-9]", MODE="0666"

0 commit comments

Comments
 (0)