Skip to content

dracut: add network kargs service #44

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

Merged
merged 1 commit into from
May 20, 2022
Merged

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Apr 28, 2022

This service allows to read cmdline to inject network configuration as initrd kargs.

See also: flatcar/mantle#329

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update) (-> coreos-overlay)


[Service]
Environment=AFTERBURN_OPT_PROVIDER=--cmdline
Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='ip=dhcp,dhcp6'
Copy link
Member

@pothos pothos Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@tormath1 tormath1 force-pushed the tormath1/kargs branch 3 times, most recently from 553b8f8 to 74da5a3 Compare May 12, 2022 09:11

[Service]
Environment=AFTERBURN_OPT_PROVIDER=--cmdline
Environment=AFTERBURN_NETWORK_KARGS_DEFAULT='ip=dhcp,dhcp6'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@tormath1 tormath1 self-assigned this May 12, 2022
@tormath1 tormath1 marked this pull request as ready for review May 12, 2022 16:04
@tormath1 tormath1 requested a review from a team May 12, 2022 16:05
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>
@tormath1 tormath1 merged commit 39caefd into flatcar-master May 20, 2022
@tormath1 tormath1 deleted the tormath1/kargs branch May 20, 2022 14:18
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.

3 participants