Let you key a radio through a CM108 sound card's PTT line
Dire Wolf, Graywolf and others key a radio through a CM108-family sound card (a Digirig, an AIOC) by setting a GPIO pin through its hidraw device, which only root can open otherwise. Dire Wolf's own rule gives it to the audio group, which most Arch users aren't in, and shouldn't need to be. udev/70-hampack-cm108.rules tags those devices uaccess instead, so whoever is at the desktop can use them, as they can the sound card. It matches the devices Dire Wolf 1.8 treats as CM108-compatible, and no other C-Media devices. update.sh installs it in /etc/udev/rules.d when it changes, and reloads and re-applies udev's rules; hampackremove removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fee5ce341a
commit
5f15ff3821
@@ -65,6 +65,25 @@ setup() {
|
||||
[ ! -e "$HAMPACK_STATE/added-groups" ]
|
||||
}
|
||||
|
||||
@test "installs the CM108 udev rule once, and again when it changes" {
|
||||
run bash "$REPO/update.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
grep -qx "sudo install -m 644 $REPO/udev/70-hampack-cm108.rules $HAMPACK_UDEV_RULES_DIR/70-hampack-cm108.rules" "$STUB_LOG"
|
||||
grep -qx "udevadm control --reload-rules" "$STUB_LOG"
|
||||
grep -qx "udevadm trigger --subsystem-match=hidraw --action=change" "$STUB_LOG"
|
||||
|
||||
# Installed as it is now: nothing to do
|
||||
mkdir -p "$HAMPACK_UDEV_RULES_DIR"
|
||||
cp "$REPO/udev/70-hampack-cm108.rules" "$HAMPACK_UDEV_RULES_DIR/"
|
||||
: > "$STUB_LOG"
|
||||
run bash "$REPO/update.sh"
|
||||
! grep -q "70-hampack-cm108" "$STUB_LOG"
|
||||
|
||||
echo "# older" >> "$HAMPACK_UDEV_RULES_DIR/70-hampack-cm108.rules"
|
||||
run bash "$REPO/update.sh"
|
||||
grep -q "^sudo install -m 644 .*70-hampack-cm108.rules" "$STUB_LOG"
|
||||
}
|
||||
|
||||
@test "update leaves alone a radio command that isn't HamPack's" {
|
||||
echo "theirs" > "$HOME/.local/bin/radio"
|
||||
run bash "$REPO/update.sh"
|
||||
|
||||
Reference in New Issue
Block a user