Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676598 - sys-power/nut-2.7.4-r1: Clean up UPS driver build options
Summary: sys-power/nut-2.7.4-r1: Clean up UPS driver build options
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
Depends on:
Reported: 2019-01-27 20:42 UTC by Phil Stracchino (Unix Ronin)
Modified: 2023-06-17 03:17 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2019-01-27 20:42:56 UTC
The problem:

At present sys-power/nut supports 51 drivers, all of which are enabled by default.  This means either you build a lot of drivers you don't need, or you have a huge long list of drivers to turn off in /etc/portage/package.use.  It's messy and awkward, and realistically, nobody is ever going to need ALL of those drivers except for testing purposes.  Probably 99% of the time, at most two or three drivers will ever be needed in a given installation.

(Real-world example:  I've just installed it after replacing an APC core UPS with a Cyberpower; I experimented with usb_driver_snmp-ups, ups_driver_powerpanel, and ups_driver_usbhid-ups, and after testing the ONLY one I actually need is ups_driver_usbhis-ups.)

Suggested solution:

Change all of the drivers to default-disable, and add a ups_drivers_all flag to turn them all on just for the vanishingly rare case when yes, somebody REALLY DOES want ALL the drivers.  Then people can turn on just the few drivers they need instead of needing to turn everything else off in order not to build fifty drivers they don't need.
Comment 1 pogosyan 2021-10-16 07:51:57 UTC
I would add my voice to this problem.  Came here in search of easy way to build just the drivers (really, one driver) needed.
Comment 2 Michael Yagliyan 2021-12-12 03:32:47 UTC
I think this should probably be closed in favor of bug 598619, which has the more Gentoo-appropriate proposal of using USE_EXPAND variables.
Comment 3 Larry the Git Cow gentoo-dev 2023-06-17 03:15:24 UTC
The bug has been closed via the following commit(s):

commit aea0f99f970c391e3daf4f98d0b6a2dc58fc039b
Author:     Francisco Javier Félix <>
AuthorDate: 2023-06-16 16:14:55 +0000
Commit:     Sam James <>
CommitDate: 2023-06-17 03:13:49 +0000

    sys-power/nut: add 2.8.0, various enhancements
    I've recently made a comprehensive update to the ebuild of sys-power/nut:
    The way drivers are activated has been altered - instead of using a driver list, which
    can be hard to maintain when new ones are added, we now activate them based on the
    connection type (serial, USB, XML, IPMI, Modbus, etc).
    This simplification not only streamlines the installation process but also resolves
    dependency issues associated with activating a driver and its corresponding unactivated connection.
    The updates align with the latest Gentoo specifications and are summarized below:
    *    Removed unused libnsl
    *    Removed outdated hotplug
    *    Utilized EAPI=8
    *    Default use of libusb-1
    *    Added connections for GPIO, i2c, and Modbus
    *    Configuration parameters required per connection type
    *    Fixed the creation of PID in /run/nut
    *    Removed configurations no longer necessary for nut-2.8.0 or newer
    *    Creation of man pages
    *    Added a flag for documentation
    *    Utilized tmpfile for creating temporary directories
    *    Added Q5t5 monitor (nut-9999)
    *    Disabled Python2
    *    Added Python3 library
    *    Message for the optional function of sys-apps/util-linux[logger, tty-helpers]
    *    Added configuration for Avahi
    *    Added a flag for systemd (nut-9999)
    TODO: (in next version)
    *    nut-scanner is not working
    *    /etc/init.d/upslog requires parameters of SAI and log file
    Please note that I have tested different SAI drivers, but only with USB and SNMP connections.
    Any feedback or further testing on these updates would be highly appreciated.
    Package-Manager: Portage-, pkgcheck-0.10.24
    Signed-off-by: Fco Javier Felix <>
    Signed-off-by: Sam James <>

 sys-power/nut/Manifest                             |   1 +
 sys-power/nut/files/nut-2.6.5-init.d-upsmon        |   2 +-
 .../files/nut-2.8.0-fix-man-page-generation.patch  |  64 +++++
 sys-power/nut/files/nut-2.8.0-init.d-upsd          |  37 +++
 sys-power/nut/files/nut.powerfail.initd            |   1 -
 sys-power/nut/files/systemd_notify.path            |  50 ++++
 sys-power/nut/metadata.xml                         |  14 +-
 sys-power/nut/nut-2.8.0.ebuild                     | 222 +++++++++++++++++
 sys-power/nut/nut-9999.ebuild                      | 266 +++++++++++++++++++++
 9 files changed, 654 insertions(+), 3 deletions(-)