Fix so that the bonded interface is not appended to host config
When using -b or -B, the bonded interface {"interface_name":"bond0", "mac_address": ""} is appended to the host configuration's "network_interfaces" list. And after a successful configuration, that (invalid) config is committed to EFI NVRAM. Which means it cannot be parsed by stboot, because "" is not a MAC address.
As far as I can tell from a quick look it is caused by this:
- https://git.glasklar.is/system-transparency/core/stboot/-/blob/main/host/network/network.go?ref_type=heads#L84-90
- https://git.glasklar.is/system-transparency/core/stboot/-/blob/main/host/network/network.go?ref_type=heads#L74-79
@nisse and I have discussed that the above stands out before, but we left it as is because we didn't want to change things unless we had to.
I didn't dig in detail exactly where this bug was introduced, but I double-checked that the initial import of stprov did not have this behavior because it populated it's own static/dhcp configs with helpers based on the provided command-line options. And did so separately from the host configuration that was being mutated when configuring the network. I doubt pinning down the exact MR helps anyone, but if I'm wrong please let me know and I'll hunt it down (to be able to say which prior tags are affected -- the reason why I suspect it does not help anyone is because then we would have know about the bug already).
The fix I'd like to explore would be: make stboot not mutate the host configuration in memory, then we can just bump the stboot version here in stprov to get this bug resolved. Will either create an issue about this in stboot, or go straight to an MR.
Credit: spotted by @vistor, thanks!