-
-
Notifications
You must be signed in to change notification settings - Fork 419
Add UPower support to nut-scanner #3293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UPower support to nut-scanner #3293
Conversation
a9ec08b to
addcd76
Compare
|
✅ Build nut 2.8.4.4136-master completed (commit 69d9fbe737 by @timn) |
acec0b3 to
90aea6e
Compare
|
Thanks, looks quite comprehensive! I hope the CI nits will not pester you for too many cycles :) I think the library version in |
|
I think the |
…er (and hack) the variables for libglib and for libgio [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…pstools#3293] +1 for "current" (added interfaces) and "+1" for age (only added, not removed) Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
11e899f to
010a0e1
Compare
|
I think in your last round of commits, the I appreciate the pedantic hardening about If this PR change is nearing the end (after fixing the m4 to what allegedly worked 3 commits ago), I don't require to cut it apart just for the sake of that (hey, less load on CI farm to hunt for two birds at once), but consider this in future ones. UPDATE: Sorry I didn't before, but now read into your commit comments and why those clean-ups appeared. Thanks in fact for building and testing on the bleeding edge :) Still, maybe if that imperfection was found earlier, the clean-up could be a prerequisite PR :D |
Earlier commits separated LIBGIO* from LIBGLIB* variables, but a parallel-developed fix happened to conflate them back. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…S first [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
Hopefully this step-back, step-forth will cover the |
|
Thanks. I wanted to see if the closer alignment to the other change would still be sufficient on the build farm (regarding If you want I can still pull out the other changes. It's just that without those I couldn't test my actual changes on my target system, as they would consistently fail. I read your update as "leave them in this time", if that assumption is wrong let me know and I'll split it up. I'll look into the remaining build fails now. |
|
I guess can let it be a big commit so far. For GHA, one nit popped up: Not sure right now (at a conf and batteries dying) if these are due to CFLAGS changes or refinements. |
Ok.
Na, I just picked the wrong enum to cast to in that instance. Fixed in the last commit. |
|
✅ Build nut 2.8.4.4148-master completed (commit bb661c82b9 by @jimklimov) |
|
❌ Build nut 2.8.4.4149-master failed (commit 943c323d27 by @timn) |
|
I guess Also going over the tons of small changes, see some good catches there (even an occasional This one seems fun: ...but gets one thinking: what if someone redefines the macro values of It also struggled with indentations (adding spaces instead of tabs sometimes, usually with two or more layers deep, but not consistently). It is interesting to take apart the workings of an alien mind ;-) |
…elinux1-dev (which provides libselinux-dev) and requested libselinux-dev (as dependency of libgio/libmount) so need a nudge [#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…" (we may have some defined but zeroed, so not active for a build) [#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ULLness at the beginning of main() [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ng of xmalloc() [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Bonus question: what could Gemini mean by "FTS"?.. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…mge_model_names[] [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
- Added support for scanning UPower devices via GDBus/libgio. - Implemented dynamic loading of libgio/libglib to avoid hard dependencies. - Added --upower_scan (-J) option to nut-scanner. - Added m4/nut_check_libglib.m4 to detect GLib/GIO. - Updated configure.ac to check for UPower support requirements. - Updated nut-scanner build system and initialization. - Updated nut-scanner man page Signed-off-by: Tim Niemueller <tim@niemueller.de>
Signed-off-by: Tim Niemueller <tim@niemueller.de>
Pretend it's 1999 and put declaration of the variable further up. Signed-off-by: Tim Niemueller <tim@niemueller.de>
…er (and hack) the variables for libglib and for libgio [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…pstools#3293] +1 for "current" (added interfaces) and "+1" for age (only added, not removed) Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Tim Niemueller <tim@niemueller.de>
Earlier commits separated LIBGIO* from LIBGLIB* variables, but a parallel-developed fix happened to conflate them back. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…S first [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…" (we may have some defined but zeroed, so not active for a build) [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…er` tool section [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…bs related to UPower where we only load one for scanning [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…le)1` instead of `(void *)1` [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…stools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
8a8a307 to
c21dd68
Compare
|
❌ Build nut 2.8.4.4160-master failed (commit 5eea31a877 by @jimklimov) |
…rt [networkupstools#3293] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…selves [networkupstools#2431] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ker or compiler with the library paths and link name, to derive the path from error messages [networkupstools#2431] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
3c62a90 to
36828db
Compare
|
❌ Build nut 2.8.4.4176-master failed (commit 33596189eb by @jimklimov) |
|
✅ Build nut 2.8.4.4177-master completed (commit df197a1977 by @jimklimov) |
|
Thanks for putting in the effort! It seems now it's waiting to see if the CI is happy. This week is packed so I can join in only on the weekend if more work is necessary. |
That was my "alien mind" 😅 The thing is it's not "true" and "false" but custom enums, so technically it's a wrong assignment. |
|
Oh, thanks for clearing that up (facepalm) :) BTW, which system offers clang-21 now? Might want one in the build matrix... |
Tested locally with nut-upower driver on Fedora 43 (direct scanning with -J).
General points
Described the changes in the PR submission or a separate issue, e.g.
known published or discovered protocols, applicable hardware (expected
compatible and actually tested/developed against), limitations, etc.
There may be multiple commits in the PR, aligned and commented with
a functional change. Notably, coding style changes better belong in a
separate PR, but certainly in a dedicated commit to simplify reviews
of "real" changes in the other commits. Similarly for typo fixes in
comments or text documents.
Please star NUT on GitHub, this helps with sponsorships! ;)
Frequent "underwater rocks" for driver addition/update PRs
Revised existing driver families and added a sub-driver if applicable
(
nutdrv_qx,usbhid-ups...) or added a brand new driver in the othercase.
Did not extend obsoleted drivers with new hardware support features
(notably
blazerand other single-device family drivers for Qx protocols,except the new
nutdrv_qxwhich should cover them all).For updated existing device drivers, bumped the
DRIVER_VERSIONmacroor its equivalent.
For USB devices (HID or not), revised that the driver uses unique
VID/PID combinations, or raised discussions when this is not the case
(several vendors do use same interface chips for unrelated protocols).
For new USB devices, built and committed the changes for the
scripts/upower/95-upower-hid.hwdbfileProposed NUT data mapping is aligned with existing
docs/nut-names.txtfile. If the device exposes useful data points not listed in the file, the
experimental.*namespace can be used as documented there, and discussionshould be raised on the NUT Developers mailing list to standardize the new
concept.
Updated
data/driver.list.inif applicable (new tested device info)Frequent "underwater rocks" for general C code PRs
Did not "blindly assume" default integer type sizes and value ranges,
structure layout and alignment in memory, endianness (layout of bytes and
bits in memory for multi-byte numeric types), or use of generic
intwherelanguage or libraries dictate the use of
size_t(orssize_tsometimes).Progress and errors are handled with
upsdebugx(),upslogx(),fatalx()and related methods, not with directprintf()orexit().Similarly, NUT helpers are used for error-checked memory allocation and
string operations (except where customized error handling is needed,
such as unlocking device ports, etc.)
Coding style (including whitespace for indentations) follows precedent
in the code of the file, and examples/guide in
docs/developers.txtfile.For newly added files, the
Makefile.amrecipes were updated and themake distchecktarget passes.Caveat: I do not have powerman libs available and distcheck fails without them (I think I didn't have this with the earlier PR, not sure if behavior changed or if I missed it). But I can build nut-scanner and use when running autogen/configure myself.
General documentation updates
Updated
docs/acknowledgements.txt(for vendor-backed device support)Added or updated manual page information in
docs/man/*.txtfilesand corresponding recipe lists in
docs/man/Makefile.amfor new pagesPassed
make spellcheck, updated spell-checking dictionary in thedocs/nut.dictfile if needed (did not remove any words -- themakerule printout in case of changes suggests how to maintain it).
Additional work may be needed after posting this PR
Propose a PR for NUT DDL with detailed device data dumps from tests
against real hardware (the more models, the better).
Address NUT CI farm build failures for the PR: testing on numerous
platforms and toolkits can expose issues not seen on just one system.
Revise suggestions from LGTM.COM analysis about "new issues" with
the changed codebase.