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

Networking config file #515

Open
hugusmaximus opened this issue Dec 28, 2023 · 4 comments
Open

Networking config file #515

hugusmaximus opened this issue Dec 28, 2023 · 4 comments

Comments

@hugusmaximus
Copy link

hugusmaximus commented Dec 28, 2023

I wonder if it would be possible to have some compile-time config file (not source code) so some critical parameters of networking (static IP address, DNS servers, dhcp on/off,...) could be setup there before compiling and without having to change source code.

@stlankes
Copy link
Contributor

Yeah, we have to describe it better. It exists sone environment variables to define the static network configuration. See https://github.com/hermit-os/kernel/blob/main/src/executor/device.rs#L95

@hugusmaximus
Copy link
Author

Sure, this is what I'm doing (and also disabling the dhcpv4 feature) but just wondered if this could be in a separated config file... It's fine, I can go ahead by modifying those variables you mention.

@stlankes
Copy link
Contributor

Yes, we should do it. I will talk @mkroening about it.

@mkroening
Copy link
Member

I'm not sure how easy that would be.

Where would we search for that file?

  • We could do it like Cargo does for .config/cargo.toml, but that depends on the current directory and I am not sure how well that composes with our build scripts.
  • We could put it into the kernel's source root, but that is not easily accessible when not developing the kernel locally.
  • We might want to put it next to the application being built, but that directory is not exposed to build scripts by cargo. Then, we could parse the file in the build script and set corresponding environment variables. This approach would translate very poorly to C applications, too.
  • We might want to put it in some Hermitfile describing the image, similar to a Dockerfile. That would be ideal, I think, but we don't have such a thing yet.

I think for the mean time, it would be easiest to work around this by setting up some shell script (maybe even a local alias for cargo), which would represent a self-built version of such a configuration file.

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

No branches or pull requests

3 participants