When the gokrazy deployment doesn't have internet access and the network
lacks NTP traffic re-routing to the local time servers, instances may
either have downright wrong clock (e.g. Raspberry Pi with no RTC) or
experience divergence due to drift.
This add the ability to override the default NTP Pool Vendor Zone for
gokrazy with servers supplied as command line arguments.
e.g.
```
"PackageConfig": {
"github.com/gokrazy/gokrazy/cmd/ntp": {
"CommandLineFlags": [
"time1.local",
"time2.local",
"10.1.2.123"
]
}
}
```
It might be more desirable to deploy the static network configuration as
its own JSON file instead of needing to deal with string quoting it to
fit into `config.json`.
- Add a simple heuristic for checking if the flag value is a JSON string.
- If the value is JSON, preserve the original behavior
- If not, treat it value as a file path and load the JSON from there.
- Set lease source string to reflect the source of static configuration.
On systems without an ethernet interface (like the Raspberry Pi Zero)
the `dhcp` program goes into a crash loop because it can't find eth0.
This PR adds an initial loop to wait for the given interface name to
appear before continuing with the rest of the program.
Fixes#144
If the --gus_server command line flag is configured,
this program will periodically check in with GUS (gokrazy Update Service).
related to https://github.com/gokrazy/gokrazy/issues/167
This reverts commit fbb7618c25.
landlock depends on psx. When cgo is enabled, psx uses a cgo
implementation, which is undesired in setups which use cgo
(e.g. scan2drive with turbojpeg), but don’t come with a libc:
the dhcp client doesn’t start, which means the device is no
longer reachable over the network.
This is helpful for dual-homed devices where one interface should be preferred,
for example the WiFi interface that’s connected to the out-of-band mobile uplink.
All existing DHCPv4 packages I looked at were unappealing for one reason or
another, so we’re now using a little helper to glue github.com/google/gopacket
and github.com/mdlayher/raw together, which suffices for our use-case and gives
us more control.
We can do away with a bunch of hacks now, but we’ll keep them around for a
little while to make updates easier (i.e. to boot with old and new gokr-packer
versions, just in case people don’t update both at the same time).
E.g. /etc/kresd/dhcp_host_domain_ng.sh on a turris omnia incorrectly deletes
DHCP hostname mappings when more than one client does not send a client id.