Set per battery-specific start/stop charge limits in udev as environment
variable with the option to allow a user to override the default 60%
start and 80% stop charge limit.
Signed-off-by: Kate Hsuan <hpa@redhat.com>
udev is available only on Linux, so limit their usage when the backend
is 'linux'.
This fixes the build when the backend is different than 'linux', i.e.
typically on non-Linux OSes.
This makes rule matching more efficient. We just need to copy the
variables over into the hiddev device so that there is no need to change
the C code to match the parent USB device. That said, the change in C
wouldn't be that hard either.
See https://github.com/networkupstools/nut/pull/1342