Skip to content

nut: rewrite scripts#29607

Draft
danielfdickinson wants to merge 7 commits into
openwrt:masterfrom
danielfdickinson:pr-nut-refactor-and-bump-version
Draft

nut: rewrite scripts#29607
danielfdickinson wants to merge 7 commits into
openwrt:masterfrom
danielfdickinson:pr-nut-refactor-and-bump-version

Conversation

@danielfdickinson

@danielfdickinson danielfdickinson commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @@danielfdickinson
Also notify: @rpavlik @systemcrash @BKPepe

Description:

Note: Will need to be rebased once #29592 is merged. #29592 has
all but the last commit (rewrite scripts).

The scripts were a mess. Attempting even a simple update caused many
Copilot complaints. So we rewrite the scripts to be cleaner and
resolve the issues found by automated code review (such as Copilot).
Made extensive use of Qwen3.6-27B, LATE, and llama.cpp for local AI
code reviews during development.

In the process we deduplicate the nut-server and nut-monitor
initscripts and split them into several files, for easier automatic
and human review.

Incorporates and supersedes: #28308
Should supersede #21014

Closes: #28298


🧪 Run Testing Details

To be done (hence draft)
Also need to develop a robust test plan, given the scope of the changes.

'smoke test' only (more comprehensive testing required)

  • OpenWrt Version: OpenWrt SNAPSHOT r34703-aa96b3ad55
  • OpenWrt Target/Subtarget: bcm27xx/bcm2709
  • OpenWrt Device: Raspberry Pi 2 Model B Rev 1.1
  • UPS: Tripp-Lite ECO 550 UPS

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@danielfdickinson danielfdickinson force-pushed the pr-nut-refactor-and-bump-version branch 2 times, most recently from 5c57d79 to f4e379f Compare June 1, 2026 05:40
@BKPepe BKPepe requested a review from Copilot June 1, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@danielfdickinson danielfdickinson force-pushed the pr-nut-refactor-and-bump-version branch 2 times, most recently from ac7f53a to 68f6d99 Compare June 1, 2026 12:14
@BKPepe BKPepe requested a review from Copilot June 1, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@BKPepe

BKPepe commented Jun 2, 2026

Copy link
Copy Markdown
Member

It looks like Copilot does not like me. 😭😭

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 10 comments.

Comment thread net/nut/files/nut-service.sh.functions
Comment thread net/nut/files/nut-serial.hotplug Outdated
Comment thread net/nut/files/nut-monitor.init Outdated
Comment thread net/nut/files/nut-monitor-config.sh.functions
Comment thread net/nut/files/nut-server-service.sh.functions Outdated
Comment thread net/nut/files/nut-sendmail-notify
Comment thread net/nut/files/add_nut_httpd_conf.default
Comment thread net/nut/files/nut-cgi.init Outdated
Comment thread net/nut/files/nut-common.sh.functions
Comment thread net/nut/files/nut-server-config.sh.functions Outdated
@danielfdickinson

Copy link
Copy Markdown
Contributor Author

A few things to fix, a couple of which are more about 'in case some targets behave differently' than actively incorrect (and were tested on a Pi 2, with no issues). Better than I feared, with the size of the changeset.

Bump version to latest stable release. Adjust configure
and drivers as needed.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
They are executables not libraries, so move the UPS drivers
to /usr/libexec/nut.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
For files with an existing OpenWrt copyright notation,
update to include 2026 for scripts which have been
updated this year.

Per openwrt#29390 (comment)

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
Allow CI to pass by skipping the generic version
check where it not appropriate.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
Add previously missed migration script (uci-defaults) for changes
to nut-monitor initscript.

Created with the help of iterative code reviews by
Qwen3.6-27B (LLM model) running on llama.cpp (local LLM server),
controlled by LATE.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
Extra quotes were being interpreted literally, preventing proper
ups driver stop and/or reload.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
The scripts were a mess. Attempting even a simple update caused many
Copilot complaints. So we rewrite the scripts to be cleaner and
resolve the issues found by automated code review (such as Copilot).
Made extensive use of Qwen3.6-27B, LATE, and llama.ccp for local AI
code reviews during development.

In the process we deduplicate the nut-server and nut-monitor
initscripts and split them into several files, for easier automatic
and human review.

Incorporates and supersedes: openwrt#28308
Should supersede openwrt#21014

Closes: openwrt#28298

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson danielfdickinson force-pushed the pr-nut-refactor-and-bump-version branch from 68f6d99 to e761068 Compare June 2, 2026 21:30
@danielfdickinson

Copy link
Copy Markdown
Contributor Author

It looks like Copilot does not like me. 😭😭

You sure it not me it doesn't like? It seems do this a lot with my PRs...

@danielfdickinson

Copy link
Copy Markdown
Contributor Author

Interesting. CI failure due to not being able to pull the test container from the registry. I'm guessing that should be a transient failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nut-server: Drivers not restarted on config change

3 participants