Add radio, which finds radios on USB, and put you in the uucp group
`radio` lists each radio plugged into USB: its serial ports, the sound card that came with it (the same USB device, or behind the radio's own hub), and its model and Hamlib model number. Icoms are recognised by their USB serial number. `radio detect --probe` asks the others with the CAT ID; command or Icom's CI-V transceiver ID, at the usual baud rates, on ports no other program has open; `radio probe PORT` asks one port. It drops DTR and RTS as soon as a port opens. The radios it knows are in radios.conf. update.sh links ~/.local/bin/radio to the clone, unless a different radio is already there, and adds you to uucp, which owns serial ports on Arch. hampackremove removes the link, and takes you out of uucp only if HamPack put you in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
48d94ca432
commit
6c76f94ac6
@@ -70,6 +70,24 @@ remove_stale_files() {
|
||||
install_tools() {
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
install_script "$SELF/hampackremove" "$HOME/.local/bin/hampackremove"
|
||||
# A link, so radio finds radios.conf beside it and updates with HamPack. A
|
||||
# radio that isn't HamPack's is left alone
|
||||
local radio="$HOME/.local/bin/radio"
|
||||
if [ -e "$radio" ] && [ "$(readlink -f "$radio")" != "$(readlink -f "$SELF/radio")" ]; then
|
||||
echo " Not installing HamPack's radio command: $radio is something else. Run $SELF/radio instead"
|
||||
else
|
||||
ln -sfn "$SELF/radio" "$radio"
|
||||
fi
|
||||
}
|
||||
|
||||
# Radios' CAT ports, like all serial ports on Arch, belong to the uucp group,
|
||||
# so you need to be in it to control a radio. It's recorded, so hampackremove
|
||||
# takes you out again only if HamPack put you in.
|
||||
join_serial_group() {
|
||||
id -nG "$USER" | tr ' ' '\n' | grep -qx uucp && return 0
|
||||
sudo usermod -aG uucp "$USER" || return 1
|
||||
record_installed added-groups uucp
|
||||
echo " Added you to the uucp group, so programs can control your radio. Log out and back in for it to take effect."
|
||||
}
|
||||
|
||||
# Install the packages in packages.conf, and record the ones that weren't
|
||||
@@ -145,6 +163,7 @@ fi
|
||||
|
||||
step "Removing stale HamPack files" remove_stale_files
|
||||
step "Installing HamPack tools" install_tools
|
||||
step "Adding you to the uucp group, for radios' serial ports" join_serial_group
|
||||
step "Installing HamPack packages" install_hampack_packages
|
||||
step "Installing Flatpak applications" bash "$SELF/install-flatpaks.sh"
|
||||
step "Installing pre-built binaries" bash "$SELF/install-binaries.sh"
|
||||
|
||||
Reference in New Issue
Block a user