Skip to content

Commit ef66c3c

Browse files
authored
Release NUT v2.8.3
Some recipe fixes for NUT v2.8.3 release fixing what was v2.8.3-rc2
2 parents a8c9b0f + 3d5c36a commit ef66c3c

File tree

7 files changed

+37
-21
lines changed

7 files changed

+37
-21
lines changed

docs/config-prereqs.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ recommended for build agents with immutable system areas, etc.
106106
Build prerequisites to make NUT from scratch on various Operating Systems
107107
-------------------------------------------------------------------------
108108

109-
Debian 10/11/12
110-
~~~~~~~~~~~~~~~
109+
Debian 10/11/12/13
110+
~~~~~~~~~~~~~~~~~~
111111

112112
Being a popular baseline among Linux distributions, Debian is an
113113
important build target. Related common operating systems include
@@ -197,7 +197,11 @@ metadata about recently published package revisions:
197197
# provide an `msgfmt` implementation, e.g.:
198198
# :; apt-get install gettext
199199
#
200-
# To install the Python NUT-Monitor app, you may need some modules:
200+
# To install the Python NUT-Monitor app, you may need some modules.
201+
# Ideally, they would be packaged, named according to major Python version:
202+
# :; apt-get install python3-pyqt5
203+
#
204+
# If not packaged for your distro:
201205
# :; apt-get install pip
202206
# For Python3:
203207
# :; python3 -m pip install PyQt5 configparser
@@ -214,6 +218,12 @@ metadata about recently published package revisions:
214218
:; apt-get install \
215219
libgd-dev
216220

221+
# Debian 13 serves metadata needed for NUT to find where to install the
222+
# service unit files in a separate development package; earlier distro
223+
# releases did not seem to require it explicitly:
224+
:; apt-get install \
225+
systemd-dev
226+
217227
# Optionally for sd_notify integration:
218228
:; apt-get install \
219229
libsystemd-dev
@@ -274,7 +284,7 @@ complete environments):
274284
qemu-user-static
275285
------
276286

277-
NOTE: For Jenkins agents, also need to `apt-get install openjdk-17-jdk-headless`.
287+
NOTE: For Jenkins agents, also need to `apt-get install openjdk-21-jdk-headless`.
278288
You may have to ensure that `/proc` is mounted in the target chroot
279289
(or do this from the running container).
280290

drivers/asem.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#endif
6868

6969
#define DRIVER_NAME "ASEM"
70-
#define DRIVER_VERSION "0.14"
70+
#define DRIVER_VERSION "0.15"
7171

7272
/* Valid on ASEM PB1300 UPS */
7373
#define BQ2060_ADDRESS 0x0B
@@ -80,7 +80,7 @@
8080

8181
#define ACCESS_DEVICE(fd, address) \
8282
if (ioctl(fd, I2C_SLAVE, address) < 0) { \
83-
fatal_with_errno(EXIT_FAILURE, "Failed to acquire bus access and/or talk to i2c slave 0x%02X", address); \
83+
fatal_with_errno(EXIT_FAILURE, "Failed to acquire bus access and/or talk to i2c slave 0x%02X", (unsigned int)address); \
8484
}
8585

8686
static unsigned long lb_threshold = LOW_BATTERY_THRESHOLD;
@@ -202,7 +202,7 @@ void upsdrv_updateinfo(void)
202202
return;
203203
}
204204
online = (i2c_status & 0x8000) != 0;
205-
upsdebugx(3, "Charger status 0x%02X, online %d", i2c_status, online);
205+
upsdebugx(3, "Charger status 0x%02X, online %d", (unsigned int)i2c_status, online);
206206

207207
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_EXTRA_SEMI_STMT)
208208
# pragma GCC diagnostic push
@@ -222,7 +222,7 @@ void upsdrv_updateinfo(void)
222222
upslogx(LOG_ERR, "Could not read bq2060 status word at address 0x16");
223223
return;
224224
}
225-
upsdebugx(3, "bq2060 status 0x04%X", i2c_status);
225+
upsdebugx(3, "bq2060 status 0x04%X", (unsigned int)i2c_status);
226226
/* Busy, leave data as stale, try next time */
227227
if (i2c_status & 0x0001) {
228228
dstate_datastale();
@@ -232,7 +232,7 @@ void upsdrv_updateinfo(void)
232232
/* Error, leave data as stale, try next time */
233233
if (i2c_status & 0x000F) {
234234
dstate_datastale();
235-
upslogx(LOG_WARNING, "bq2060 returned error code 0x%02X", i2c_status & 0x000F);
235+
upslogx(LOG_WARNING, "bq2060 returned error code 0x%02X", (unsigned int)i2c_status & 0x000F);
236236
return;
237237
}
238238

drivers/generic_gpio_libgpiod.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#endif
3232

3333
#define DRIVER_NAME "GPIO UPS driver (API " WITH_LIBGPIO_VERSION_STR ")"
34-
#define DRIVER_VERSION "1.03"
34+
#define DRIVER_VERSION "1.04"
3535

3636
/* driver description structure */
3737
upsdrv_info_t upsdrv_info = {
@@ -78,7 +78,8 @@ static void reserve_lines_libgpiod(struct gpioups_t *gpioupsfd, int inner);
7878
*/
7979
static void reserve_lines_libgpiod(struct gpioups_t *gpioupsfdlocal, int inner) {
8080
struct libgpiod_data_t *libgpiod_data = (struct libgpiod_data_t *)(gpioupsfdlocal->lib_data);
81-
upsdebugx(5, "reserve_lines_libgpiod runOptions 0x%x, inner %d", gpioupsfdlocal->runOptions, inner);
81+
upsdebugx(5, "reserve_lines_libgpiod runOptions 0x%x, inner %d",
82+
(unsigned int)gpioupsfdlocal->runOptions, inner);
8283

8384
if(((gpioupsfdlocal->runOptions&ROPT_REQRES) != 0) == inner) {
8485
#if WITH_LIBGPIO_VERSION < 0x00020000
@@ -150,8 +151,11 @@ void gpio_open(struct gpioups_t *gpioupsfdlocal) {
150151
upslogx(LOG_NOTICE, "GPIO chip [%s] opened", gpioupsfdlocal->chipName);
151152
gpioupsfdlocal->chipLinesCount = gpiod_chip_num_lines(libgpiod_data->gpioChipHandle);
152153
#else /* #if WITH_LIBGPIO_VERSION >= 0x00020000 */
154+
struct gpiod_chip_info *chipInfo;
155+
struct gpiod_line_settings *lineSettings;
156+
153157
upslogx(LOG_NOTICE, "GPIO chip [%s] opened, api version 2", gpioupsfdlocal->chipName);
154-
struct gpiod_chip_info *chipInfo = gpiod_chip_get_info(libgpiod_data->gpioChipHandle);
158+
chipInfo = gpiod_chip_get_info(libgpiod_data->gpioChipHandle);
155159
gpioupsfdlocal->chipLinesCount = gpiod_chip_info_get_num_lines(chipInfo);
156160
gpiod_chip_info_free(chipInfo);
157161
#endif /* WITH_LIBGPIO_VERSION */
@@ -178,7 +182,7 @@ void gpio_open(struct gpioups_t *gpioupsfdlocal) {
178182
);
179183
#else /* #if WITH_LIBGPIO_VERSION >= 0x00020000 */
180184
libgpiod_data->values = xcalloc(gpioupsfdlocal->upsLinesCount, sizeof(*libgpiod_data->values));
181-
struct gpiod_line_settings *lineSettings = gpiod_line_settings_new();
185+
lineSettings = gpiod_line_settings_new();
182186
libgpiod_data->lineConfig = gpiod_line_config_new();
183187
libgpiod_data->config = gpiod_request_config_new();
184188
if(!lineSettings || !libgpiod_data->lineConfig || !libgpiod_data->config) {
@@ -212,7 +216,8 @@ void gpio_open(struct gpioups_t *gpioupsfdlocal) {
212216
#if WITH_LIBGPIO_VERSION >= 0x00020000
213217
gpioRc=gpiod_line_request_get_values(libgpiod_data->request, gpioupsfdlocal->upsLinesStates);
214218
if(gpioRc==0) {
215-
for(int i=0; i < gpioupsfdlocal->upsLinesCount; i++) {
219+
int i;
220+
for(i=0; i < gpioupsfdlocal->upsLinesCount; i++) {
216221
gpioupsfdlocal->upsLinesStates[i] = libgpiod_data->values[i];
217222
}
218223
}

drivers/hwmon_ina219.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define BATTERY_CHARGE_LOW 15
3838

3939
#define DRIVER_NAME "hwmon-INA219 UPS driver"
40-
#define DRIVER_VERSION "0.02"
40+
#define DRIVER_VERSION "0.03"
4141

4242
upsdrv_info_t upsdrv_info = {
4343
DRIVER_NAME,
@@ -394,7 +394,7 @@ void upsdrv_initinfo(void)
394394
dstate_setinfo("device.description", "%s",
395395
"Bidirectional Current/Power Monitor With I2C Interface");
396396

397-
dstate_setinfo("battery.charge.low", "%d", battery_charge_low);
397+
dstate_setinfo("battery.charge.low", "%u", battery_charge_low);
398398
}
399399

400400
static unsigned int battery_charge_compute(void)
@@ -452,7 +452,7 @@ void upsdrv_updateinfo(void)
452452

453453
dstate_setinfo("battery.voltage", "%.3f", voltage / 1000.0);
454454
dstate_setinfo("battery.current", "%.3f", current / 1000.0);
455-
dstate_setinfo("battery.charge", "%d", charge);
455+
dstate_setinfo("battery.charge", "%u", charge);
456456

457457
if (charge <= battery_charge_low && current > 0)
458458
dstate_setinfo("battery.runtime", "%d", 60); // 1 minute

tests/generic_gpio_liblocal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ void gpiod_request_config_set_consumer(struct gpiod_request_config *config,
229229

230230
int gpiod_line_request_get_values(struct gpiod_line_request *request,
231231
enum gpiod_line_value *values) {
232-
NUT_UNUSED_VARIABLE(request);
233232
unsigned int i;
234233
int pinPos = 1;
234+
NUT_UNUSED_VARIABLE(request);
235235

236236
if(errReqFor_line_get_value_bulk) {
237237
errReqFor_line_get_value_bulk=0;

tests/generic_gpio_utest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ int main(int argc, char **argv) {
331331
* because scanf() does not support asterisk for
332332
* width specifier; have to create it on the fly.
333333
*/
334-
snprintf(fmt, sizeof(fmt), "%%%us", NUT_GPIO_CHIPNAMEBUF-1);
334+
snprintf(fmt, sizeof(fmt), "%%%us", (unsigned int)NUT_GPIO_CHIPNAMEBUF-1);
335335
fEof=fscanf(testData, fmt, chipNameLocal);
336-
snprintf(fmt, sizeof(fmt), "%%%us", NUT_GPIO_SUBTYPEBUF-1);
336+
snprintf(fmt, sizeof(fmt), "%%%us", (unsigned int)NUT_GPIO_SUBTYPEBUF-1);
337337
fEof=fscanf(testData, fmt, subType);
338338
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
339339
#pragma GCC diagnostic pop

tools/nutconf/nutconf-cli.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,8 @@ void Options::dump(std::ostream & stream) const {
590590

591591

592592
Options::Options(char * const argv[], int argc): m_last(nullptr) {
593-
for (int i = 1; i < argc; ++i) {
593+
int i;
594+
for (i = 1; i < argc; ++i) {
594595
const std::string arg(argv[i]);
595596

596597
// Empty string is the current option argument, too

0 commit comments

Comments
 (0)