nut: Update to version 2.8.5

Message ID 20260915134055.3522913-1-adolf.belka@ipfire.org
State New
Headers
Series nut: Update to version 2.8.5 |

Commit Message

Adolf Belka 15 Sep 2026, 1:40 p.m. UTC
- Update from version 2.8.4 to 2.8.5
- Update of rootfile
- The first build of nut-2.8.5 failed due to the code not recognising that --with-group
   had been set as nut as this is the default and it therefore did not recognise as
   having been defined.
- This was raised as an issue in the nut github and a fix patch was created by the
   developer and merged into the nut master branch.
- This patch submission implemets that patch fix. It will be able to be removed when
   the next version of nut is released as that will include it into the tarball.
- Changelog
2.8.5
common code:
    Introduced setproctag() and getproctag() (see examples in upsmon) to help track
	the log messages from massively-forking NUT daemons. [#3084]
    Introduced NUT_DEBUG_PROCNAME environment variable support to optionally log also
	the process name (or however the program chose to identify itself). This may
	be useful when multiple NUT daemons log into the same file or console,
	without syslog to prefix the name into each line (e.g. in tests, single init
	script systems like Home Assistant, etc.) [PR 3368]
    Extended with plural checkprocnames() and compareprocnames(), as well as
	sendsignalpidaliases() and sendsignalfnaliases(), for binaries that expect to
	have one of several names at the moment (e.g. when renaming a program to
	"-old" or promoting a "-new" into the stable name as a default
	implementation). Drivers united by main.c framework introduced a
	upsdrv_tweak_prognames() hook method to let them manipulate the array of
	prognames[] aliases. [PR #3101]
    USB drivers could truncate strings received from devices as a fallout of
	PR #2604 merged in NUT v2.8.3; this should now be fixed. [PR #3211, issue #3201]
    libusb0 and libusb1 integrations now try both "Resource Descriptor Length" values
	they could identify on some devices: sometimes the first (or otherwise
	preferred) option may be not the correct one, so try the other too. [issue #3136]
    Improved high-verbosity debug tracing of NUT libhid and usbhid-ups to help make
	sense of data processing issues (HID paths, strings). [#3201]
    Further removal of unbounded strcpy() and sprintf() usage. [#3253]
    For state tree methods, introduced difftime_st_tree_timespec() to abstract
	platform-dependent definitions of st_tree_timespec_t. [PR #3156]
    Introduced global variables for last changed timestamp and value of
	battery.charge, integrated with status_commit(), so all drivers should now
	report a CHRG or DISCHRG status, and verify whether reality agrees with a
	status reported by device/protocol (if any). This is also a step in direction
	of eventually providing a common runtimecal style fallback to all drivers.
	[issue #3146, PR #3156]
    Generalize elapsed_since_timeval() code, originally repeated in several modbus
	drivers. [issue #1938, PR #3321]
    Introduced NOTIFY_STATE_EXTEND_TIMEOUT option and relevant variables for
	upsnotify() method, so we can tell systemd to not kill the service unit if
	its shutdown takes long (see also the SHUTDOWNEXIT option in the upsmon
	client). [issue #3003, PR #3151]
    Daemons running with systemd integration tended to report "logged the systemd
	watchdog situation once, will not spam more about it" even if those "logged"
	messages were at an invisible verbosity level. [issue #3157, PR #3151]
    Systemd units for some daemons were revised to honour the MODE setting from
	nut.conf, if available, to gracefully not-start when explicitly
	not-requested (e.g. do not start upsd in MODE=netclient), even though the
	unit is nominally enabled; this should make packaging and providing service
	pre-sets more simple. [issue #837, PR #3233]
    In a way, this should also fix fallout of a change delivered in NUT v2.8.4
	release, where upsmon could have started with MODE=none in nut.conf, but the
	nutshutdown script would bail out quickly and quietly. [PR #3008]
    Fixed thread-safety of IP address printout in libupsclient method
	upscli_tryconnect() (practical bug seen in nut-scanner parallel scans).
	[issue #3234]
    The upsdrvquery code base was revised to handle SIGPIPE without crashing (if the
	consumers did not neuter the signal themselves), although this behavior is
	optional by upsdrvquery_NOSIGPIPE. Separated an upsdrvquery_ping() operation
	from earlier code, so it can be directly used by consumers (in-tree this is
	drivers and upsdrvctl). [issue #3276, PR #3277]
    Revised void* pointer casting into specific types for values returned by
	xmalloc() and friends, or iterated in loops via something→next, as clang-21
	now warns about not-casting void pointers (formally valid, practically
	uncertain if that code matches the developer’s intention), and (better safe
	than sorry) added NULL-return checks although we should not normally get into
	those code paths with the x*() methods which should bail out and abort the
	program with a common error message when an allocation fails. [#3293]
    We have long abstracted (s)size_t value printing in debug logs etc. using
	PRIuSIZE and similar macros. They fell back to "%zu" when not provided
	otherwise, but not all platforms actually deliver these format characters.
	Now it is evaluated at configure time (to check that the characters may be
	used), and if not — during nut_stdint.h parsing to fit known int/long/long
	long types. [#3300]
    Added new API methods and defined bitmap values for libupsclient C binding to
	query and report SSL capabilities of the current library build (none,
	OpenSSL, Mozilla NSS): upscli_ssl_caps_descr() and upscli_ssl_caps(). Updated
	common NUT clients to report this info in their detailed help banners. Done
	similarly for upsd. The NIT (NUT Integration Test) suite piggy-backs on this
	to add run-time dependent tests of SSL capability. Added
	upscli_set_debug_level() and upscli_set_debug_level() methods to facilitate
	NUT debugging for clients built with shared NUT private libraries.
	[issues #3328, #1771, #2800, PR #3330]
    Revised OpenSSL handshake to support retries requested by the library, so it at
	least works reliably on different platforms within the scope it has now.
	[issue #3331, PR #3344]
    Extended PyNUTClient to support STARTTLS and optional server/self identification,
	added NIT tests for that ability. [issues #1711, #3329, #1600, PR #3352].
    Ported C client library libupsclient support logic for SSL connections into C++
	client library libnutclient and added tests for it. [issues #1599, #1711,
	PR #3353]
    Added support for command-line debugging with -D option into upsc, upscmd and
	upsrw command-line clients, and the nutconf tool. Revised handling of -D
	and/or NUT_DEBUG_LEVEL environment variable in other programs. Extended
	public API of libupsclient and libnutscan to diligently arrange debug-logging
	when at run-time those libraries actually have different copies of the
	methods and data involved. [#3378]
NUT for Windows specific updates:
    Revised detection of (relative) paths to program and configuration files near the
	currently running program in NUT for Windows builds, including limited
	support for UNC paths (ignoring a localhost \\?\ prefix).
	[issues #3207, #3063, #3065, #3219]
    Augmented WIN32 nut.exe launcher with status and restart actions, and general
	ability to debug-log the activities during service management operations.
	(Re-)registration of the "Network UPS Tools" service should now populate a
	nice description of it. The -U (uninstall) action should now also try to stop
	the service first. [PR #3235]
    Using nut.exe -N for testing and pressing 'Ctrl+C' should now cause the started
	daemons to be killed off. Previously they would linger and e.g. preclude
	subsequent experiments with the service wrapper. Console close events are
	ignored, so there is a way to indefinitely keep the daemons started by
	test-mode wrapper running (kill via Task Manager). [#3312]
    Revised WIN32 WSAStartup() and registration of atexit(WSACleanup) to only be done
	once per program (and cleanups to be always registered); this impacts the C
	libupsclient and C++ libnutclient libraries (and so most NUT clients and
	tools which use the former, and nutconf which uses the latter), the apcupsd
	driver, upsd data server, and nut-scanner tool. [PR #3237]
    Documented setup of Microsoft IIS to host the NUT CGI programs. [#3207]
asem, bestfortress, bestuferrups, bicker_ser, everups, metasys, masterguard,
 mge-utalk, oneac, phoenixcontact_modbus, pijuice, powercom, powervar_cx_ser,
 usbhid-ups, victronups driver updates:
    Moved code to align with NUT driver architecture, so upsdrv_initups() would focus
	on preparing communications, and upsdrv_initinfo() would actually talk to the
	device and set initial critical data values. [#1962]
apcsmart driver updates:
    Add support for dual-byte command for APC SPM series (and potentially SPRM SRVS
	series). [PR #3327]
apcupsd-ups driver updates:
    Abandoned use of obsolete gethostbyname() in favour of getaddrinfo(). Extended to
	be IPv6-capable along the way. [#1209]
apc_modbus driver updates:
    Fixed register range in a logging string.
    Add outlet group timers.
    Fixed outlet group command handling to dynamically detect available groups (MOG,
	SOG0 - SOG2) in the device. Commands and variables are now only exposed for
	outlet groups actually present on the UPS. Global load. and shutdown.
	commands now correctly target all available outlet groups. [PR #3395]
Introduced a new NUT driver named meanwell_ntu which provides support for the Mean
	Well NTU series hybrid inverter and UPS units. [PR #3206]
Introduced a new NUT driver named must_ep2000pro which provides support for the MUST
	EP2000Pro compatible, line-interactive UPS models which talk serial-protocol
	modbus protocol. [PR #3228]
nhs_ser driver updates:
    Driver source code includes a table to map baud rates (defined by the OS as C
	macros) to numbers and strings more useful to the driver program. It was
	discovered that not all operating systems define all the baud rates
	referenced by this table, so now several higher speeds would be compiled
	conditionally. [issue #3163]
nut-ipmipsu driver updates:
    Fixed an issue where multiple calls to clean-up crashed the program. Special
	thanks to maintainer of libfreeipmi for helping catch it. [#3193]
nutdrv_qx driver updates:
    Define an internal QX_FLAG_MAPPING_HANDLED to check if the subdriver code
	(mapping table) and the data found from device walk sit together well —
	namely, that we successfully use reasonably many of the existing mappings.
	Suggest how user can help improve the driver if too few data points were
	seen. [PR #3095]
    The qx_process_answer() method was extended to raise errno=ETIMEDOUT (rather than
	EINVAL) for short reads that are zero length (and/or that errno value was set
	in caller’s context already). This was used to make Voltronic protocol
	initial connections more reliable when the device controller lags upon first
	contact (is booting itself?) [issue #3276, PR #3283]
    New nutdrv_qx_innovatae adds support for Ippon INNOVA TAE series which are
	similar to Q1 except in reporting of nominal voltage, current, frequency data
	(that along with battery_voltage_reports_one_pack and
	override.battery.packs=12 settings yields reasonable battery.voltage.* data
	points). [issue #3137, PR #3139]
    nutdrv_qx_masterguard sub-driver adds a way to call battery test until the
	battery charge is low, using a new test.battery.start.low instant command
	name (registered in docs/nut-names.txt). The difference between the "battery
	test until battery low" and "deep battery test" is that the latter is
	actually a battery calibration test and needs some preconditions to be met,
	i.e. the load must be between 30% and 100% and the starting battery capacity
	is greater than 99%. The "Battery test until battery low" can be started
	anytime. Tested on Masterguard A1000 and A2000 units. [#3135]
    nutdrv_qx_masterguard sub-driver fix masterguard_add_slaveaddr to return the
	correct command length, resolving a bug for all commands using the ,XX slave
	address placeholder. This also enables support for the
	test.battery.start.deep (TUD) command. [#3141]
    nutdrv_qx_masterguard sub-driver adds a clear.fault.record instant command to
	clear the fault record. Also adds two experimental variables:
	battery.ageing.factor (Battery ageing factor in promille) and
	battery.calibration.factor (Battery calibration factor in percent). Tested on
	A1000 and A2000 units. [#3181]
    Hides QX_FLAG_NONUT variables from syslog unless the debug level is raised.
	[issue #3190, PR #3198]
    Added support for battery.charge in hunnox subdriver. [#3254]
powerp-bin and powerp-txt driver updates:
    Their upsdrv_initinfo() methods did not explicitly reference the INSTCMD and
	SETVAR handler methods (it is unknown whether this actually broke anything,
	or the needed values were deduced from subdriver definition then). For
	consistency, these pointers are now assigned. [#1962]
riello_ser and riello_usb driver updates:
    Since the beginning, these drivers fenced availability of either load. *or
	shutdown.return instant commands based on current power situation (which was
	also unknown when the drivername -k mode was used to shut down the system).
	There seems to be little reason for such separation, so it is now avoided and
	the current device status is queried when starting to handle the UPS
	poweroff, as a means to verify communication ability. [#1962]
snmp-ups driver updates:
    Define an internal SU_FLAG_MAPPING_HANDLED to check if the subdriver code
	(mapping table) and the data found from device walk sit together well —
	namely, that we successfully use reasonably many of the existing mappings.
	Suggest how user can help improve the driver if too few data points were
	seen, or if the mibs=auto detection only found the fallback IETF mapping.
	[PR #3095]
    Quiesced "unhandled ASN 0x80 received from …​" messages when we fall back to using
	the numeric value from last OID section. [issue #1358, PE #3337]
    Added new vendor extension mappings for Vertiv Liebert UPS, tested with
	PSI5-750MT120 UPS model and IS-UNITY-DP (Firmware 8.4.7.0) SNMP card.
	[issue #3296, PR #3299]
tripplite_usb driver updates:
    Added support for Tripplite protocol 3017 (mostly ASCII). [issue #2258, PR #3093]
    Fixed default unit_id, apparently broken by changes in NUT v2.8.1. [issue #3191,
	PR #3192]
tripplitesu driver updates:
    Added configurable command delay to prevent read timeouts. [PR #3273]
Introduced a new NUT driver named nut-upower which provides support for monitoring
	UPS and battery devices managed by the UPower daemon via D-Bus. This also
	introduces a new category of drivers that talk to operating system services
	to obtain power state information. [PR #3279]
usbhid-ups driver updates:
    Declared support for APC with USB ID 051d:0005 (details may evolve as the devices
	become better known). [issue #3047, PR #3081]
    Extended iDowell subdriver with data points for GoldenMate UPS using LiFePO4
	batteries (tested with GoldenMate LIPO 1500VA/1000W). [issue #3015, PR #3265]
    Improved support for Eaton 5S1500LCD and 5S1600LCD (US version). [#2380]
    The driver used to report CHRG status if the device was not "fully charged",
	however the latter status was only queried and reported by some (not all)
	subdrivers and probably not by all devices out in the field. Now we fall back
	to check that if the "fully charged" status is not defined at all, consider
	the battery.charge value (100 or not). [issue #3146]
    For ups.status processing, do not assume that !online==offline, it may well be
	that the device just did not report anything (e.g. if it does not really talk
	USB HID). [#3080]
    Suggest iterative testing with explicit subdrivers if collected data looks wrong.
	[#2058, #3061 et al]
    Check if the subdriver code (mapping table) and the device report descriptor sit
	together well — namely, that we do not unwittingly ignore any useful reports,
	and that we successfully use reasonably many of the existing mappings.
	Suggest how user can help improve the driver if too few data points were
	seen. [#3082, #3095]
    Default to usb_hid_rep_index=1 for Liebert PSI5 and PowerSure PST devices with
	ID 10af:0002. [#3345, #1028, #1252 etc.]
    cps-hid updated with Replace Battery information. [PR #3268]
    openups-hid had nobattery definition inverted, causing alarms — now fixed to use
	the same mapping helper as other subdrivers. [issue #3246]
    powercom-hid subdriver improved with a powercom_hack_voltage_lkp to query
	battery.voltage. [issue #2766]
    powercom-hid subdriver now honours configured offdelay and ondelay driver options
	in ups.conf, and prefers them (if present) over the values received from the
	UPS itself (like ups.delay.shutdown and ups.delay.start), to fix
	implementations of shutdown/stayoff/startup instant commands. [PR #3288]
    Improved handling of transient LIBUSB_ERROR_IO failures during polling. Some
	devices (CyberPower, etc.) have firmware bugs causing random I/O errors on
	certain HID reports. The driver now skips failing reports and continues
	polling rather than triggering expensive reconnection attempts. True
	disconnections are still detected via other error codes or when all polls
	fail. [issue #3116]
    arduino-hid subdriver enhanced with ups.load, input.voltage and output.voltage
	readings where supported (e.g. Ugreen US3000). [#3281]
    Introduced a winhid extension in NUT for Windows builds, to directly work with
	Windows HID API so that extra driver like WinUSB or Zadig is not needed. Note
	that currently this backend follows a read-focused scope: it supports device
	discovery and matching by identifiers such as vendorid and productid,
	input/feature reads, and interrupt-report fallback handling. Feature-report
	writes are not implemented in this phase, so setvar/instcmd operations may be
	unavailable. [PR #3335]
nut-scanner tool updates:
    Fixed nut-scanner search for "simulation devices" to not use only the built-in
	NUT configuration path on all platforms, but to also consider NUT_CONFPATH
	and other fallback locations, like other code does. [PR #3249]
    Enhance debug-logging of dynamic library loading with information about any
	missing method in the library discovered at run-time, if lack of such
	prevents us from using that library, and blocks scanning of corresponding
	protocol and/or media to discover possibly supported devices. [PR #3310]
    Introduced nut-scanner support for new nut-upower driver. [PR #3293]
upsd data server updates:
    Sometimes "Data for UPS [X] is stale" and "UPS [X] data is no longer stale"
	messages were logged in the same second, especially on busy systems. Now we
	allow one more second on top of MAXAGE setting to declare the device dead,
	just in case fractional/whole second rounding comes into play and breaks
	things. [issue #661]
    Fixed LISTEN * handling for upsd.exe in NUT for Windows builds. [PR #3237]
    Extended processing of MAXCONN setting to allow larger values than the operating
     system allows, by only waiting for that amount of Unix sockets or Windows
     HANDLE’s at a time, and moving on to another chunk.
     The system-provided value can be further limited by `NUT_SYSMAXCONN_LIMIT
	environment variable (e.g. in tests). For the other side of the coin, the NIT
	script now supports an optional DUMMY_UPS_SWARM_COUNT environment variable
	which can specify the amount of additional drivers to spawn for the sake of
	stress-testing, and UPSLOG_SWARM_COUNT for clients. [#3302]
    Extended processing of CERTREQUEST setting to handle numeric or specific string
	values, to match both ways of reading ambiguous documentation. Added
	configure --with-ssl-client-validation toggle to expose the macro previously
	meant to be passed via make command line. [PR #3330, but beware issue #3329]
upsdrvctl tool updates:
    Make use of setproctag() and getproctag() to report parent/child process names.
	[#3084]
    The global-level debug_min setting in ups.conf now also applies to bumping the
	debug verbosity of upsdrvctl tool. [#3276]
    If we fail to stop a driver by signal (e.g. PID file was not saved), retry to
	INSTCMD driver.exit it by socket protocol. [#3277]
    The NUT Integration Testing suite now also involves upsdrvctl to run one driver
	instance indirectly, helping make check-NIT` catch portability issues with
	different builds of the tool. [#2800, #3292]
upslog tool updates:
    Updated help() and failure messages to suggest -m '*,-' for logging of all known
	local devices to stdout. [#3083, #2756]
upsmon client updates:
    The SHUTDOWNEXIT option was not handled properly, and the requested long delays
	did not happen in practice. [issues #2133 and #3084, PR #3086]
    Make use of setproctag() and getproctag() to report parent/child process names.
	[#3084]
    Clarify the warning about lack of POWERDOWNFLAG in configuration. [#3391]
    Introduced a SHUTDOWN_HOSTSYNC notification message, to report that the primary
	upsmon initiated the shutdown and has some secondaries to wait for first. [#3084]
    Make sure an FSD notification is issued for each UPS when this primary upsmon
	instance sets it (and does not return to usual data processing loop to see
	and report it like secondaries do). This allows a NOTIFYCMD such as upssched
	on the primary to handle the pending power outage (e.g. begin stopping heavy
	services) even while upsmon waits for the secondaries to complete their
	shutdowns and log out of the upsd data server. [issue #3003, PR #3110]
    Tickle service watchdog timer (if any) so the nut-monitor.service or equivalent
	unit is not killed off due to quietness during shutdown. [#3003]
    Note
	If using upssched and monitoring multiple UPSes, consider setting up a
	 START-TIMER-SHARED rule with a short (approx. 1 second) timeout to group
	 several FSD notifications into one executed action. [PR #3097]
upsc has now optional JSON output [issue #3172, PR #3178]
upscmd and upsrw clients would now report that the "OK" response only means that the
	server accepted the query, if wait mode ("TRACKING") was not specified, and
	what users could do about it (e.g. use the -w option or export
	NUT_QUIET_OK_NOTRACKING=true to hide the warning). [issue #3383]
upsset CGI tool should now recognize RANGE NUMBER and NUMBER types. [#3164]
upsstats CGI tool updates:
    Now has JSON output mode via ?json (or &json) CGI query parameter. New
	@TREELINK_JSON@ keyword added and HTML templates updated to expose these JSON
	documents when browsing. [issue #2524, PRs #3171, #3249]
    The @STATUS@ directive now optionally supports separators (not only the
	hard-coded <br/> of the older versions. [issue #2525, PR #3318]
    Handle device.model in addition to ups.model in upsstats HTML templates. [#3180]
    Introduced a @NUT_UPSSTATS_TEMPLATE@ command which the HTML template files now
	MUST start with (safety check that we are reading a template). [issue #3252,
	PR #3249]
    (Experimental) Custom templates other than upsstats{,-single}.html can now be
	specified as CGI parameters, if locally permitted via hosts.conf.
	Modern-looking templates were provided. [issues #2524, #3316, PR #3304]
upssched tool updates:
    Previously in PR #2896 (NUT releases v2.8.3 and v2.8.4) the UPSNAME and
	NOTIFYTYPE environment variables were neutered for the timer daemon, since
	their values at the moment it first started were irrelevant when actual
	timers fired. Lack of those values was however also against the documented
	expectations. Now the values set when the upssched client is called and ends
	up updating the timer daemon would be passed into the timer. Also a
	START-TIMER-SHARED operation was added, to track a single named timer for
	possibly many devices and/or event types — in this case they would be
	comma-separated in the environment variable values. [issue #3092, PR #3097]
    The CANCEL-TIMER action no longer stops at first hit for the timer name, but goes
	on (in case there are duplicates). A new CANCEL-TIMER-MATCHED was added,
	which also cares to match UPSNAME and NOTIFYTYPE values (if passed). [#3097]
    Introduced support for DEBUG_MIN setting via upssched.conf. [#3097]
    Introduced upssched -l mode to list currently tracked timers. [#3097]
    Make use of setproctag() and getproctag() to report parent/child process names.
	[#3084]
    Introduced optional passing of NOTIFYMSG text (normally originating from upsmon
	which calls upssched) as an environment variable into the ultimately executed
	CMDSCRIPT processes. [#3105]
The nut-driver-enumerator.sh script (NDE) updates:
    Revised info/error/warning/debug message emission so they go to stderr and have a
	consistent look. Revised some typos along the way. [issue #3194]
configure script updates:
    Added an option to --enable-shared-private-libs to deliver NUT common libraries
	as shared objects used by different NUT binaries, rather than linking just
	the used bits into each binary. This has some potential both for mayhem (so
	disabled by default) and for significant reduction of installation footprint.
	[issue #2800]
    For ages, most recipes for building NUT had customized the sysconfdir to be
	/etc/nut, which is not exactly the system configuration directory. This is
	finally deprecated, with new --with-confdir configuration option taking over
	the role of a full path to configuration files (by default
	${sysconfdir}${confdir_suffix}), and new --with-confdir-suffix allowing to
	specify just /nut or /ups that would be tacked onto the default ${sysconfdir}
	to resolve the ${confdir}. Default behavior should be same as with previous
	builds: if sysconfdir is customized (or prefix is kept at built-in default),
	the confdir_suffix will default to empty; otherwise it assumes the value of
	/${PACKAGE_NAME} to become /nut in most cases. A --with-confdir-examples
	option was also introduced, to help distributions that place *.conf.sample
	files into docs or other locations. [#3131]
    The configure script would now probe (if it can) the operating systems for more
	user and group account names, such as upsmon, nutmon, ups, nut (last hit
	wins, separately for user and groups accounts) settling on one of those if
	detected instead of nobody (and optionally nogroup). It would also warn if
	nobody or nogroup end up being used for a build. [#3173]
    Default PIDPATH is now more strictly /var/run, unless building on a system
	conforming to FHS-3.0 standard where that location is absent or is a symlink,
	while /run exists and is a true directory. [#3099]
    Made default NUT CGI URI (used in HTML templates, which may be edited later on a
	NUT deployment to customize for specific web server setup) configurable
	--with-cgi-uri. [#3207]
    Introduced --with-python{,2,3}-modules-dir to specify PyNUT(Client) module
	installation location (for module-named dir to be created under it), if not
	bundling with NUT-Monitor UI app. By default the respective interpreter’s
	'site-packages' or 'dist-packages' location will be used, so you may have to
	adjust search paths for any other values. [#3062]
    The script would now warn the caller if several different Python program paths or
	module locations were discovered (at least one automatically), in case this
	was not something the callers wanted — just so they know. [#1792]
    New supported values were introduced for --with-python{,2,3}=auto-prio=NUM: this
	allows to auto-prioritize some one available Python interpreter. Default
	settings were changed from plain auto (allowing for multiple python*
	interpreters and site-package locations to be used), to prefer a python3 if
	available, else python2, else python. [#1792]
    The configure script should now try harder to report specifically the "purelib"
	location as PYTHON*_SITE_PACKAGES. [#1209]
    Added a --with-systemdsysusersdir=PATH option to have systemd pre-create the user
	and group accounts for NUT, before packaging or manually executed commands
	do (this is particularly important for immutable-image operating
	environments). [PR #3262]
    Streamlined handling of --with- and --enable- options using NUT 'm4' macros;
	fixed reporting help for options whose defaults are evaluated. [issue #3049,
	PR #3140]
    Automatic --with-devd could not detect the need to install a FreeBSD devd
	configuration snippet file, because it expected a source that should not have
	been there (probably a copy-paste typo in NUT v2.8.0). Also fixed a missed
	compiler family dependency when handling --enable-strip, a few logical
	mismatches of Solaris/illumos packaging options, and default report vs.
	setting of --enable-force-nut-version-header. Rephrased and updated many help
	messages. The configure script logs should now clarify where
	CFLAGS/LIBS/LDFLAGS values come from ('pkg-config', 'default', user provided
	'confargs' etc.) [#3140]
    Added configure script options for 'libregex' tuning, just so that one is on par
	with our other optional dependencies. [#3140]
    Changed --enable-extapi-enphase to not default to auto and then get installed on
	every system capable of using it; this is a niche capability for users of
	specific devices via a cloud portal. [follow-up to PR #2813 for issue #2807]
    Fixed m4/ax_realpath_lib.m4 up with more ways to try and gauge the build-time
	library name from linker/compiler, to improve the chances that nut-scanner
	would find them. [#3293]
    Added an option to (primarily) --disable-threading for systems with detected but
	broken libpthread support, or to test alternate code paths during development
	or in CI. [#3300]
    Adjusted C++ header search path on Termux when -isystem is involved, as noted
	with NSS builds. [issues #1599, #1711, PR #3353]
Recipes, CI and helper script updates not classified above:
    Fixed CI recipes for PyPI publication of PyNUT(Client) module to also include the
	source distribution (was posted for NUT v2.8.1 and v2.8.2 tagged releases,
	but absent for v2.8.3 and v2.8.4). [#3056]
    A new version of BSD make in NetBSD 11 (Beta) aka bmake in some other operating
	systems, complains about some of our sub-$(MAKE) calls despite the explicit
	+ prefix in corresponding lines, possibly because that call happens not
	directly in a rule definition, but in a substituted shell code snippet. The
	recommended workaround was to add a "Special Source" called .MAKE to let the
	tool know that we expect sub-makes in that recipe. However, other make
	implementations do not know about this token, so its support is tried and
	detected at configure time. [PR #3300]
    Updated make spellcheck to help avoid asciidoc admonition blocks with visually
	invalid sentences (after rendering as a box in HTML or PDF). [#3077]
    Added a make dist-docs goal to generate, collect and tarball all document types
	(man, html-single, html-chunked, pdf) that we may have enabled for the
	current build configuration and available tooling. [#1400]
    Further developer workflow speedup with make spellcheck-interactive-quick which
	should now not re-check source texts that were okay with the previous
	dictionary contents, in case some new terms have to be added. [PRs #3186, #2871]
    Added make .libs-dev-PATH recipe to generate a file which developers or CI
	scripts can source to prefer freshly built NUT libraries and some tools in
	their LD_LIBRARY_PATH and PATH. [#3379]
    Introduced make distcheck-completeness goal to verify that our distribution
	archives can exactly reproduce themselves. [#2829]
    Added a GitHub Actions CI job to generate, upload and recycle make dist and make
	dist-docs tarballs so they are easier to obtain for people and other CI
	systems (which might not want to follow a Git repository). Links to these
	artifacts can be seen in workflow page (or its logs), and added as a line in
	GitHub Checks list associated with a commit. Note that the GitHub Action
	storage keeps artifacts for at most 90 days. [#1400, #2829]
    Revised CI and deliverable scripts, and Makefile recipes, to not use the verbatim
	grep -E (loudly preferred by newer systems, but may be absent on older ones)
	after all, nor use egrep (loudly disliked by newer systems). Instead, use
	what configure script detected for the generated files (or ones made from
	templates), and use a similar detection in standalone scripts. Also revised
	the use of grep -q, id -u, diff -u, etc. which are not ubiquitous, and of
	test -e which is not only absent in some older shells, but can cause them to
	abort processing the script immediately. Also the if ! condition syntax is
	not supported everywhere (or the ! operator generally). [#3099, #1660]
    Generally improved shell script portability (including Makefile.am embedded
	recipes) when mixing back-quotes and double-quotes. Namely, the classic
	Solaris ksh implementation (also used in current versions of Solaris and
	illumos based distributions) was strict about following (an older revision
	of) the POSIX standard here, and some use-cases misbehaved with our older
	script spelling. [issue #3196]
    Revised drivers/Makefile.am to not always build libdummy_serial.la, but only if
	it is needed by serial-only or modbus drivers. Introduced a libdummy_usb.la
	to only build USB layer sources once and share the results between several
	USB-capable drivers. [#2800]
    Revised tools/gitlog2version.sh helper script (logic added into a new
	tools/semver-compare.sh) with a mode to expand NUT SEMVER components into
	wide zero-padded numbers, so it is easier to alphanumerically compare
	different releases regardless of version component lengths in digits (and
	differences in their amounts). You can request an inverse operation with
	NUT_VERSION_STRIP_LEADING_ZEROES=true. Added tests to cover different shell
	interpreter platforms (piggy-back on the tests/nut-driver-enumerator-test.sh
	script), and made sure that outputs of legacy-mode processing (with
	NUT_VERSION_DEFAULT string provided by caller or saved in a tarball) are
	consistent with git-mode. The new tools/semver-compare.sh helper can be used
	directly to expand and strip version strings, sort and compare multiple
	versions as one simple operation. [issue #3055, PRs #3213, #3217]
    Dropped the compile script from Git sources. It originates from automake and is
	added to work area (if missing) during autogen.sh rituals anyway. It is still
	distributed as part of make dist tarball. [#1209]
    Extended ci_build.sh and build-mingw-nut.sh so that certain values of
	NUT_SSL_VARIANTS=[yes, no, auto, ssl, nss, openssl] can be used with generic
	builds to test a specific code path and not only the auto-detected one. [#1711]
Upstreamed reference packaging recipes (DEB, RPM) from the 42ITy project which can be
	used with OBS (Open Build Service by SUSE), both to support end-user testing
	of NUT development, and to have a yet another NUT CI farm player with a
	distinct opinion on code quality. Many of the changes listed above happened
	thanks to this effort, and due to concerns raised by OBS build agents with
	various Linux distributions. [#1209, #1316, #3144]
Updated docs/*.txt: add asciidoc comments with links to nut-website rendered contents
	of most interesting pages. [#3095]
HTML renditions of NUT man pages and books (or chunked chapters thereof) now include
	the AnchorJS script to provide permalinks to sections. [#3185]
Source directory data/html was renamed to data/htmlcgi in order to better reflect its
	contents and purpose, compared to documentation-oriented html* directories
	(and recipe variable names). The static HTML pages now also suggest a NUT
	icon (installed from docs/images). This may impact some packaging recipes
	which do not rely on make install alone. [#3049, #3249]
Fixed man page naming for nutdrv_siemens-sitop(.8) (dash vs. underscore) to match the
	driver program name. Follow-up from slightly botched renaming in original
	contribution. [PR #545]
The NUT Integration Testing suite (NIT) script, if started as root, can now consult
	its run-time situation vs. BUILTIN_RUN_AS_USER and BUILTIN_RUN_AS_GROUP
	environment variables, and if those accounts do not exist (e.g. running in a
	packaging build root), a different value like "nobody" or "nogroup" would be
	defaulted for tests. [#1209]
Revised use of NUT macros for USB Vendor IDs listed in different drivers, so the
	names would be better exposed in generated udev.rules and similar files.
	[PR #3139]

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 config/rootfiles/packages/nut                |  12 +-
 lfs/nut                                      |   8 +-
 src/patches/nut-2.8.5-configure.ac_fix.patch | 119 +++++++++++++++++++
 3 files changed, 129 insertions(+), 10 deletions(-)
 create mode 100644 src/patches/nut-2.8.5-configure.ac_fix.patch
  

Patch

diff --git a/config/rootfiles/packages/nut b/config/rootfiles/packages/nut
index 6bcd2a553..2296ac9b5 100644
--- a/config/rootfiles/packages/nut
+++ b/config/rootfiles/packages/nut
@@ -36,6 +36,7 @@  usr/bin/liebert
 usr/bin/liebert-esp2
 usr/bin/liebert-gxe
 usr/bin/masterguard
+usr/bin/meanwell_ntu
 usr/bin/metasys
 usr/bin/mge-shut
 usr/bin/mge-utalk
@@ -43,6 +44,7 @@  usr/bin/microdowell
 usr/bin/microsol-apc
 usr/bin/nhs_ser
 usr/bin/nut-scanner
+usr/bin/nut-upower
 usr/bin/nutconf
 usr/bin/nutdrv_atcl_usb
 usr/bin/nutdrv_hashx
@@ -87,7 +89,7 @@  usr/bin/victronups
 #usr/lib/libnutclient.la
 #usr/lib/libnutclient.so
 usr/lib/libnutclient.so.2
-usr/lib/libnutclient.so.2.0.2
+usr/lib/libnutclient.so.2.1.0
 #usr/lib/libnutclientstub.la
 #usr/lib/libnutclientstub.so
 usr/lib/libnutclientstub.so.1
@@ -95,18 +97,17 @@  usr/lib/libnutclientstub.so.1.0.1
 #usr/lib/libnutscan.la
 #usr/lib/libnutscan.so
 usr/lib/libnutscan.so.4
-usr/lib/libnutscan.so.4.0.0
+usr/lib/libnutscan.so.4.1.0
 #usr/lib/libupsclient.la
 #usr/lib/libupsclient.so
 usr/lib/libupsclient.so.7
-usr/lib/libupsclient.so.7.0.0
+usr/lib/libupsclient.so.7.1.0
 #usr/lib/pkgconfig/libnutclient.pc
 #usr/lib/pkgconfig/libnutclientstub.pc
 #usr/lib/pkgconfig/libnutscan.pc
 #usr/lib/pkgconfig/libupsclient.pc
 #usr/lib/python3.10/site-packages/PyNUT.py
 #usr/lib/python3.10/site-packages/test_nutclient.py
-#usr/libexec/enphase-monitor
 #usr/libexec/sockdebug
 usr/sbin/upsd
 usr/sbin/upsdrvctl
@@ -116,8 +117,5 @@  usr/share/cmdvartab
 #usr/share/doc/nut
 #usr/share/doc/nut/html-man
 usr/share/driver.list
-#usr/share/external_apis
-#usr/share/external_apis/enphase
-#usr/share/external_apis/enphase/README.adoc
 var/ipfire/backup/addons/includes/nut
 var/state/ups
diff --git a/lfs/nut b/lfs/nut
index a76fe147e..6bc3b9f11 100644
--- a/lfs/nut
+++ b/lfs/nut
@@ -1,7 +1,7 @@ 
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2026  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -26,7 +26,7 @@  include Config
 
 SUMMARY    = Network UPS Tools Core (Uninterruptible Power Supply Monitoring)
 
-VER        = 2.8.4
+VER        = 2.8.5
 
 THISAPP    = nut-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -50,7 +50,7 @@  objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_BLAKE2 = 1a9e86c112055b623811e1747aa420ebb8022189c2e43f38c29cca93171d59b895d1ff5487d8f325c79833c6f6a76bffd849fb179db158bb2a1fbf86952dd797
+$(DL_FILE)_BLAKE2 = adae73a7da603a2364f78d6238b58130f756e33dacc03cae2ed8549189a84e27f9ca49359df1998fb059f862132f01aa80a79a02e71519b02d0acd8ab853edaa
 
 install : $(TARGET)
 
@@ -83,7 +83,9 @@  $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/nut-2.8.5-configure.ac_fix.patch
 	$(UPDATE_AUTOMAKE)
+	cd $(DIR_APP) && ./autogen.sh
 	cd $(DIR_APP) && ./configure \
 				--prefix=/usr \
 				--sysconfdir=/etc/nut \
diff --git a/src/patches/nut-2.8.5-configure.ac_fix.patch b/src/patches/nut-2.8.5-configure.ac_fix.patch
new file mode 100644
index 000000000..d8a23370f
--- /dev/null
+++ b/src/patches/nut-2.8.5-configure.ac_fix.patch
@@ -0,0 +1,119 @@ 
+diff --git a/configure.ac b/configure.ac
+index cdda324ce6..8f99703f3a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -6368,16 +6368,16 @@ NUT_ARG_WITH_CUSTOM_DEFAULT_HELP([user], [USERNAME], [(Unprivileged) user for pr
+ AS_CASE([${nut_with_user}],
+ 	[yes|no], [AC_MSG_ERROR(invalid option --with(out)-user - see docs/configure.txt)],
+ 	["${RUN_AS_USER}"], [
+-		 nut_user_given=no
+-		 AC_MSG_RESULT([default])
++		 AS_IF([test x"${nut_withGiven_user}" = xyes],
++			[AC_MSG_RESULT([specified])],	dnl Just happens to be same as default
++			[AC_MSG_RESULT([default])])
+ 		],
+ 		[RUN_AS_USER="${nut_with_user}"
+-		 nut_user_given=yes
+ 		 AC_MSG_RESULT([specified])
+ 		]
+ )
+ NUT_REPORT_SETTING([User to run as],
+-    RUN_AS_USER, "${RUN_AS_USER}", [User to switch to if started as root])
++	RUN_AS_USER, "${RUN_AS_USER}", [User to switch to if started as root])
+ 
+ dnl Note: Technically daemons "run as" the primary GID of the user they de-levate into;
+ dnl but in simpler setups (stipulated by common packaging) this one is the "run as" GID too
+@@ -6387,21 +6387,21 @@ NUT_ARG_WITH_CUSTOM_DEFAULT_HELP([group], [GROUPNAME], [(Unprivileged) group mem
+ AS_CASE([${nut_with_group}],
+ 	[yes|no], [AC_MSG_ERROR(invalid option --with(out)-group - see docs/configure.txt)],
+ 	["${RUN_AS_GROUP}"], [
+-		 nut_group_given=no
+-		 AC_MSG_RESULT([default])
++		 AS_IF([test x"${nut_withGiven_group}" = xyes],
++			[AC_MSG_RESULT([specified])],	dnl Just happens to be same as default
++			[AC_MSG_RESULT([default])])
+ 		],
+ 		[RUN_AS_GROUP="${nut_with_group}"
+-		 nut_group_given=yes
+ 		 AC_MSG_RESULT([specified])
+ 		]
+ )
+ NUT_REPORT_SETTING([Group of user to own state files],
+-    RUN_AS_GROUP, "${RUN_AS_GROUP}", [Group membership for state files of drivers normally started as root])
++	RUN_AS_GROUP, "${RUN_AS_GROUP}", [Group membership for state files of drivers normally started as root])
+ 
+ dnl check that --with-user is given if --with-group is given.
+-if test "${nut_user_given}" = "yes" -a "${nut_group_given}" = "no"; then
++if test "${nut_withGiven_user}" = "yes" -a "${nut_withGiven_group}" = "no"; then
+ 	AC_MSG_ERROR([If you specify --with-user, you also must specify --with-group])
+-elif test "${nut_user_given}" = "no" -a "${nut_group_given}" = "yes"; then
++elif test "${nut_withGiven_user}" = "no" -a "${nut_withGiven_group}" = "yes"; then
+ 	AC_MSG_ERROR([If you specify --with-group, you also must specify --with-user])
+ fi
+ 
+diff --git a/m4/nut_arg_with.m4 b/m4/nut_arg_with.m4
+index 10f2516c8f..5a1c6b0820 100644
+--- a/m4/nut_arg_with.m4
++++ b/m4/nut_arg_with.m4
+@@ -47,8 +47,12 @@ AC_DEFUN([NUT_ARG_WITH_CUSTOM_DEFAULT_HELP],
+             [m4_ifval([$5],
+                 [AS_HELP_STRING([--with-$1], [$3 (default: $5)])],
+                 [AS_HELP_STRING([--with-$1], [$3 (default: $4)])])]),
+-        [[nut_with_]m4_translit([$1], [-], [_])="${withval}"],
+-        [[nut_with_]m4_translit([$1], [-], [_])="$4"]
++        [[nut_with_]m4_translit([$1], [-], [_])="${withval}"
++         [nut_withGiven_]m4_translit([$1], [-], [_])="yes"
++        ],
++        [[nut_with_]m4_translit([$1], [-], [_])="$4"
++         [nut_withGiven_]m4_translit([$1], [-], [_])="no"
++        ]
+     )
+ ])
+ 
+@@ -85,8 +89,12 @@ AC_DEFUN([NUT_ARG_WITH_LIBOPTS],
+ [
+     AC_ARG_WITH([$1],
+         [AS_HELP_STRING([@<:@--with-$1=$2@:>@], [$3 (default: $4)])],
+-        [[nut_with_]m4_translit([$1], [-], [_])="${withval}"],
+-        [[nut_with_]m4_translit([$1], [-], [_])="$4"]
++        [[nut_with_]m4_translit([$1], [-], [_])="${withval}"
++         [nut_withGiven_]m4_translit([$1], [-], [_])="yes"
++        ],
++        [[nut_with_]m4_translit([$1], [-], [_])="$4"
++         [nut_withGiven_]m4_translit([$1], [-], [_])="no"
++        ]
+     )
+ ])
+ 
+@@ -96,9 +104,13 @@ AC_DEFUN([NUT_ARG_WITH_LIBOPTS_INVALID_YESNO],
+         [AS_HELP_STRING([@<:@--with-$1=$2@:>@], [$3 (default: $4)])],
+         [AS_CASE([${withval}],
+             [yes|no], [AC_MSG_ERROR([invalid option --with(out)-$1 - see docs/configure.txt])],
+-                [[nut_with_]m4_translit([$1], [-], [_])="${withval}"]
++                [[nut_with_]m4_translit([$1], [-], [_])="${withval}"
++                 [nut_withGiven_]m4_translit([$1], [-], [_])="yes"
++                ]
+         )],
+-        [[nut_with_]m4_translit([$1], [-], [_])="$4"]
++        [[nut_with_]m4_translit([$1], [-], [_])="$4"
++         [nut_withGiven_]m4_translit([$1], [-], [_])="no"
++        ]
+     )
+ ])
+ 
+@@ -197,8 +209,12 @@ AC_DEFUN([NUT_ARG_ENABLE_CUSTOM_DEFAULT_HELP],
+             [m4_ifval([$5],
+                 [AS_HELP_STRING([--enable-$1], [$3 (default: $5)])],
+                 [AS_HELP_STRING([--enable-$1], [$3 (default: $4)])])]),
+-        [[nut_enable_]m4_translit([$1], [-], [_])="${enableval}"],
+-        [[nut_enable_]m4_translit([$1], [-], [_])="$4"]
++        [[nut_enable_]m4_translit([$1], [-], [_])="${enableval}"
++         [nut_enableGiven_]m4_translit([$1], [-], [_])="yes"
++        ],
++        [[nut_enable_]m4_translit([$1], [-], [_])="$4"
++         [nut_enableGiven_]m4_translit([$1], [-], [_])="no"
++        ]
+     )
+ ])
+ 
+