Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add headless_nm module #230

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

KwadFan
Copy link
Contributor

@KwadFan KwadFan commented Oct 7, 2024

* Since RPI nor Armbian have a possibility to change (WiFi) networks
  after initial flash, adding a solution that it makes it possible to
  generate a new 'preconfigured.nmconnection' (this one is generated by
  rpi-imager)

* As discussed here guysoft#219

Signed-off-by: Stephan Wendel <me@stephanwe.de>
@guysoft
Copy link
Owner

guysoft commented Oct 15, 2024

Thanks so much for doing that! It really helps me get it in. I was looking at a mountain of work and this reduces it drastically.

What is blocking me from merging:

  1. (not really a blocker, just more work on my end).
    I am not sure how to handle both headless_nm and network together.
    I think we can have all three options in the network module (wpa-supplicant, nm raw like I did, someone said it helped them, and headless_nm as the default). I can make the network module automatically import it in CustomPiOS v2 when you select it in the network module.

  2. (might need rework on your end)
    powersave is both in network and headless_nm.

This is the one in the network module:
https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/network/filesystem/usr/local/bin/pwrsave

This is the one in this PR:
https://github.com/KwadFan/CustomPiOS/blob/upstream/headless_nm/src/modules/headless_nm/filesystem/usr/local/bin/pwrsave

I guess it makes more sense to have that in the network module.

@KwadFan
Copy link
Contributor Author

KwadFan commented Oct 21, 2024

Moving from #219

Todo:

  • Build in backwards compatibility for bullseye (have to be tested! possibly also works on *buntu variants?!?)
  • Convert file with dos2unix to avoid the Texteditor problematic
  • Seperate simple configuration and setup for advanced users
  • Allow setups using a networmanager.d in /boot for expert mode setups
    ( This will allow replace/adding new connections)
  • Allow to setup REGDOMAINvia file instead of variable if advanced or expert setups are used.

@KwadFan
Copy link
Contributor Author

KwadFan commented Oct 21, 2024

  1. (not really a blocker, just more work on my end).
    I am not sure how to handle both headless_nm and network together.
    I think we can have all three options in the network module (wpa-supplicant, nm raw like I did, someone said it helped them, and headless_nm as the default). I can make the network module automatically import it in CustomPiOS v2 when you select it in the network module.

Imho, having to much options is confusing endusers, if you want to keep all options it has to be decided beforehand by the developer of an image, so it needs to be extendend to set the option that has to be used.

  1. (might need rework on your end)
    powersave is both in network and headless_nm.

This is the one in the network module: https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/network/filesystem/usr/local/bin/pwrsave

This is the one in this PR: https://github.com/KwadFan/CustomPiOS/blob/upstream/headless_nm/src/modules/headless_nm/filesystem/usr/local/bin/pwrsave

I guess it makes more sense to have that in the network module.

In this case, I think you misinterpreted how it should work. its either not both! So either you use headless_nm or network module. They are not dependent of each other.

@KwadFan
Copy link
Contributor Author

KwadFan commented Oct 21, 2024

@guysoft @foosel
The only third option that comes to my mind would be fusing them together, which probably will break things that exist.
So, in pov as a dev not a good choice, but maybe not avoidable in the longrun.
As I mentioned earlier on discord, in the longrun we need to talk about netplan.io or something like that.
Infrastructure as Code isnt only a buzzword its the future even in pi image if you ask me, therefor that what exists is more or less a hacky custom made solution. Even it works fine, its not based on common tools...

Regards Kwad

@guysoft
Copy link
Owner

guysoft commented Oct 21, 2024

I am working on it. You should have a PR to your PR soon

@guysoft
Copy link
Owner

guysoft commented Oct 22, 2024

@KwadFan
Ok, I have a PR that removes powersave.
KwadFan#1

I also have code that turns headless_nm in to part of network module (via sub-submodule, network references it).
If you incorporate my PR I can merge this.

@guysoft
Copy link
Owner

guysoft commented Oct 27, 2024

@KwadFan ok I have it working here:
KwadFan#1

Does this work for you?

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.

2 participants