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

Enable systemd-networkd development via build flag #2741

Merged
merged 3 commits into from
Jan 24, 2023

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Jan 18, 2023

Issue number:
Related to: #2449

Description of changes:
This initial set of commits enables development for the project's transition to systemd-networkd, allowing developers to conditionally include systemd-networkd (and exclude wicked) in any variant.

A new subpackage networkd has been added to the systemd package and contains all of the relevant files, excluding them from the broader systemd build. At least for now, it appears we can continue to avoid polkit so those files continue to be excluded.

A new build flag systemd-networkd has been added, which can be tacked on to the image-features of a variant to disable wicked and enable systemd-networkd. Under the hood, the flag conditionally builds systemd-networkd in the os package. Sample variant config snippet:

[package.metadata.build-variant.image-features]
grub-set-private-var = true
systemd-networkd = true

Testing done:

  • Build and boot an aws-dev and aws-k8s-1.22 variant without the build flag to ensure it works as expected and only wicked artifacts are included
  • Build and locally boot an aws-dev variant with the build flag enabled to ensure the os package gets rebuilt and systemd-networkd is added instead of wicked. I added an early dependency on console-getty.service to the preconfigured.target since I knew early services would be broken but I still wanted to be able to poke around and verify the above.
    🎉
bash-5.1# networkctl 
IDX LINK TYPE     OPERATIONAL SETUP    
  1 lo   loopback carrier     unmanaged
  2 eth0 ether    off         unmanaged

2 links listed.

bash-5.1# find / -name "*wicked*"
bash-5.1# 

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

packages/systemd/systemd.spec Show resolved Hide resolved
packages/os/os.spec Show resolved Hide resolved
This change adds a subpackage for `systemd-networkd` and its associated
files, explicitly excluding them from the broader `systemd` package.
This change adds an additional build flag `systemd-networkd` that can be
used to enable the `systemd-networkd` backend in place of `wicked`.  The
flag is translated into a bcond which can be used in RPM spec files.
Copy link
Contributor

@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

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

LGTM!

This change conditionally builds the `wicked` or `systemd-networkd`
network backend into the variant based on the presence of the
`systemd-networkd` build flag.  This conditional logic is now located in
the os package.  The os package is has been changed to be sensitive to
the `systemd-networkd` image feature so it will be rebuilt if the
feature is added/removed.  `wicked` has been removed from the release
package to prevent it from always being built and included.
@zmrow
Copy link
Contributor Author

zmrow commented Jan 20, 2023

^ Adds the missing comment requested by @arnaldo2792

Copy link
Contributor

@arnaldo2792 arnaldo2792 left a comment

Choose a reason for hiding this comment

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

🎉

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.

4 participants