dracut: add network kargs service#44
Conversation
|
|
||
| [Service] | ||
| Environment=AFTERBURN_OPT_PROVIDER=--cmdline | ||
| Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='ip=dhcp,dhcp6' |
There was a problem hiding this comment.
Would be good to know if this has an impact if the guestinfo variable is not set or on other platforms because it would take precedence over our default networkd unit. I would rather have no default here.
There was a problem hiding this comment.
I was thinking same but it seems to be mandatory to have a default value:
- https://github.com/coreos/afterburn/blob/50ebbf2482b8c543e89b0117ef4cf8d6068fece4/src/cli/exp.rs#L63-L65 and https://github.com/coreos/afterburn/blob/50ebbf2482b8c543e89b0117ef4cf8d6068fece4/src/cli/exp.rs#L44-L47
- https://github.com/coreos/afterburn/blob/50ebbf2482b8c543e89b0117ef4cf8d6068fece4/dracut/30afterburn/afterburn-network-kargs.service#L17-L19
- I picked the value from FCOS config: https://github.com/coreos/fedora-coreos-config/blob/testing-devel/overlay.d/05core/usr/lib/dracut/modules.d/35coreos-network/50-afterburn-network-kargs-default.conf#L7 (I initially found
dhcp,dhcp6but it seems now to beauto)
This feature is currently only available on vmware: https://github.com/coreos/afterburn/blob/50ebbf2482b8c543e89b0117ef4cf8d6068fece4/src/initrd/mod.rs#L16-L22 so I guess it won't conflict with other providers.
There was a problem hiding this comment.
It still looks like it would write the default value out to the file making the ip=… command line handling be triggered where it previously wasn't, or?
I think we can use an empty default meaning that the fragment file is empty and the dracut network setup would not be triggered (didn't check the details on how the fragment file is processed).
553b8f8 to
74da5a3
Compare
|
|
||
| [Service] | ||
| Environment=AFTERBURN_OPT_PROVIDER=--cmdline | ||
| Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='ip=dhcp,dhcp6' |
There was a problem hiding this comment.
| Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='ip=dhcp,dhcp6' | |
| Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='' |
If that works we can avoid that the /etc/systemd/network/10-dracut-cmdline-….network file takes precedence over our default config file.
There was a problem hiding this comment.
yeah - will try that once the feature stabilized. I'm a bit afraid of hitting this: https://github.com/coreos/afterburn/blob/main/src/cli/exp.rs#L46
There was a problem hiding this comment.
Reading the code it looks like an empty string is ok. The question it maybe more about how the quoting in the systemd unit here is done, which I think is correct already (cf. https://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines).
this service allows supported provider to configure network stack in initramfs. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com> Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
This service allows to read cmdline to inject network configuration as initrd kargs.
See also: flatcar/mantle#329
changelog/directory (user-facing change, bug fix, security fix, update) (-> coreos-overlay)