Skip to content

Etherwake: simplify the init script and better document its configuration#29800

Open
kontaxis wants to merge 6 commits into
openwrt:masterfrom
kontaxis:etherwake-simplify-and-document
Open

Etherwake: simplify the init script and better document its configuration#29800
kontaxis wants to merge 6 commits into
openwrt:masterfrom
kontaxis:etherwake-simplify-and-document

Conversation

@kontaxis

@kontaxis kontaxis commented Jun 21, 2026

Copy link
Copy Markdown

📦 Package Details

Maintainer: Peter Wagner (@tripolar)

Description:
The Etherwake package offers Wake-on-LAN functionality. This change simplifies the init script logic and improves documentation in the example configuration file.

Specifically:

  1. Removes the use of sudo by the init script and the relevant configuration option. OpenWrt defaults to using root to run init scripts so there is no need to elevate privileges. A non-privileged user that wants to invoke the init script can do sudo /etc/init.d/etherwake instead. This change could be breaking but unlikely given the lack of sudo in releases by default.

  2. Removes the use of the pathes option by the init script to locate the etherwake binary at runtime. The Makefile installs the binary at /usr/bin/etherwake so the location is fixed and known ahead of time. If the user wants to use a different location they can edit the PROGRAM variable inside the init script. This change is unlikely to be breaking.

  3. Simplifies how the init script handles WOL SecureOn passwords. Currently the script expects the password option to be in hex format but without colon delimiters and then adds the colon delimiters itself before passing the value to the binary. This seems unnecessary. Also, the script's logic doesn't support 4-byte passwords that must be in a different format that's using dots not colons. This change introduces a new secureon option which the script simply passes to the underlying binary. This way we eliminate the handling logic from the script and support both 6-byte and 4-byte passwords. The password option is still honored by the script but removed from the example configuration. If both options are configured then the new option takes effect. This change is unlikely to be breaking.

  4. Adds clarity and detail to the example configuration.

    1. Makes sure the default interface value promised in the configuration is enforced by the init script, not the underlying binary.
    2. Removes unnecessary content from the documentation. E.g., how each option translates to a specific command-line argument for the underlying binary.
    3. Rephrases comments to improve clarity.

🧪 Run Testing Details

  • OpenWrt Version:
  • OpenWrt Target/Subtarget:
  • OpenWrt Device:

Tested multiple combinations of new and old options locally. Did not notice any regressions in functionality.

Read through the code of luci-app-wol and confirmed this change is compatible with that package.


✅ Formalities

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

If your PR contains a patch:

  • Not applicable, this PR does not add or modify an upstream source patch.

P.S.: After this change gets merged the relevant Wiki page should be updated.

@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch from 41892e7 to 95addc9 Compare June 21, 2026 22:18
@kontaxis

Copy link
Copy Markdown
Author

@jow- Can you review this?

@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch 7 times, most recently from bd4b4d8 to fa16612 Compare June 25, 2026 00:37
Comment thread net/etherwake/files/etherwake.config
@BKPepe BKPepe force-pushed the etherwake-simplify-and-document branch from fa16612 to 907b75a Compare June 29, 2026 13:08
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch 3 times, most recently from 931134b to 2abaa09 Compare June 30, 2026 18:06
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch from 2abaa09 to c3617ee Compare July 1, 2026 05:26
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch from 91e4302 to ec0ac65 Compare July 1, 2026 05:40
@BKPepe BKPepe requested a review from Copilot July 1, 2026 06:53

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

This PR updates the net/etherwake OpenWrt package to simplify the init script (removing sudo and runtime binary path searching) and to improve/clarify the example UCI configuration for Wake-on-LAN targets, including SecureOn password usage.

Changes:

  • Bump PKG_RELEASE to reflect init/config behavior changes.
  • Simplify etherwake.init by hardcoding /usr/bin/etherwake, enforcing a default interface, and adding a new secureon option path.
  • Rewrite etherwake.config comments/examples to better document typical usage and SecureOn formats.

Reviewed changes

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

File Description
net/etherwake/Makefile Bumps package release to ship the init/config changes.
net/etherwake/files/etherwake.init Removes sudo/path-search logic; adds secureon handling and simplifies interface defaults.
net/etherwake/files/etherwake.config Updates example configuration and documentation, including SecureOn formats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/etherwake/files/etherwake.init
Comment thread net/etherwake/files/etherwake.init
Comment thread net/etherwake/files/etherwake.init
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch from ec0ac65 to 9653486 Compare July 1, 2026 12:35
@kontaxis

kontaxis commented Jul 1, 2026

Copy link
Copy Markdown
Author

I would be interested in getting commit access. This is my second code change in OpenWrt. @BKPepe can you facilitate?

@BKPepe

BKPepe commented Jul 1, 2026

Copy link
Copy Markdown
Member

Sorry, but requesting commit access after just two changes seems a bit premature. If we did that, we'd be handing out commit access to just anyone, which definitely isn't ideal.

@BKPepe BKPepe force-pushed the etherwake-simplify-and-document branch from 9653486 to 12722b9 Compare July 1, 2026 12:45
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch 2 times, most recently from 8e06c86 to 12e2353 Compare July 1, 2026 21:27
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch 3 times, most recently from c2ed4a1 to 04bf45e Compare July 5, 2026 08:53
kontaxis added 6 commits July 6, 2026 14:56
OpenWrt defaults to using root to run init scripts
so there is no need to elevate privileges.
A non-privileged user can prefix the script's
execution command with 'sudo'.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
Installation places the 'etherwake' binary at a
known, fixed location.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
- Unnecessary transformation of the 'password'
  option when configuration can use the proper
  format.
- Support for 4-byte passwords.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
- Make sure the default interface value promised
  in the configuration is enforced by the init
  script, not the underlying binary.
- Remove comments on how each option translates
  to a specific command-line argument for the
  underlying 'etherwake' binary.
- Rephrase comments to improve clarity.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
Log 'name' when referring to a configuration 'target'.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
Reworking of the init script internals and changes to the ways
it can be configured warrant a new release version.

Signed-off-by: Georgios Kontaxis <geko1702+commits@99rst.org>
@kontaxis kontaxis force-pushed the etherwake-simplify-and-document branch from 04bf45e to c6dae96 Compare July 6, 2026 14:56
@kontaxis

kontaxis commented Jul 6, 2026

Copy link
Copy Markdown
Author

Gentle ping @tripolar, Cc @BKPepe, can this review move forward?

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.

5 participants