mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
072f32fee3614c98dfa93141355155ec24a25dcc
When a USB UPS is first configured, the permissions on the device under `/dev/bus/usb` have not yet been set to allow the nut user access. This resulted in errors such as: Fri Feb 13 23:39:01 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS [eco550ups] is not currently connected, trying to reconnect Fri Feb 13 23:39:01 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS [eco550ups] is still not connected (FD -1) Fri Feb 13 23:39:03 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS [eco550ups] is not currently connected, trying to reconnect Fri Feb 13 23:39:03 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS [eco550ups] is still not connected (FD -1) or Fri Feb 13 23:38:44 2026 daemon.err usbhid-ups[3083]: No matching HID UPS found Fri Feb 13 23:38:49 2026 daemon.warn procd: failed adding instance cgroup for nut-server: No error information Fri Feb 13 23:38:49 2026 daemon.err usbhid-ups[3115]: libusb1: Could not open any HID devices: insufficient permissions on everything Fri Feb 13 23:38:49 2026 daemon.err usbhid-ups[3115]: No matching HID UPS found Fri Feb 13 23:38:54 2026 daemon.warn procd: failed adding instance cgroup for nut-server: No error information and upsd would enter a procd crashloop. We fix that by looking in `sysfs` (under `/sys/devices`) to find the correct USB device and set its ownership and permissions to allow acces to the user the driver is running under. Copilot complained about a few things * nut-server.init had potential word-splitting issues in various spots. * it also had some commands missing an argument * improved documentation was required to clarify a dependency * an incorrect sed could mangle names as well as remove the intended name Additionally, while fixing those issues the author noticed that the case of multiple UPS devices with the same vendorid:productid were not correctly handled. A check of the serial number, if provided, was added along with a fallback to allowing NUT communications with all UPS devices with a given vendorid:productid, if no serial number was given. Improve efficiency and decrease McCabe complexity of ensure_usb_ups_access, while also fixing Copilot complaints. $@ in case is a problem, and we only handle the first parameter in any event, so change $@ to "$1" Copilot caught a missing 2>&1 and we silence some shellcheck false positives Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
…
…
OpenWrt packages feed
Description
This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.
Installation of pre-built packages is handled directly by the opkg utility within your running OpenWrt system or by using the OpenWrt SDK on a build system.
Usage
This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: OpenWrt Buildroot – Installation on the OpenWrt support site.
This feed is enabled by default. To install all its package definitions, run:
./scripts/feeds update packages
./scripts/feeds install -a -p packages
License
See LICENSE file.
Package Guidelines
See CONTRIBUTING.md file.
Languages
Makefile
51.9%
Shell
32.7%
C
7.7%
UnrealScript
3%
C++
1.8%
Other
2.7%