Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement build overlay mounting with mkosi-sandbox #3556

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

DaanDeMeyer
Copy link
Contributor

Now that we have Context.rootoptions(), we can switch out how we set
up the root mount without having to modify code all over the place.

Let's use this to get rid of mount_build_overlay() and instead replace
it with setup_build_overlay(), which simply configures a bunch of
fields on Context that make rootoptions() set up the root mount as an
overlay instead of a bind mount.

Now that we have Context.rootoptions(), we can switch out how we set
up the root mount without having to modify code all over the place.

Let's use this to get rid of mount_build_overlay() and instead replace
it with setup_build_overlay(), which simply configures a bunch of
fields on Context that make rootoptions() set up the root mount as an
overlay instead of a bind mount.
Copy link
Contributor

@behrmann behrmann left a comment

Choose a reason for hiding this comment

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

That's some nice cleanup, I like it!

@@ -637,14 +637,14 @@ def chroot_options() -> list[PathString]:
@contextlib.contextmanager
def chroot_cmd(
*,
root: Path,
root: Callable[[PathString], list[str]],
Copy link
Contributor

@behrmann behrmann Feb 26, 2025

Choose a reason for hiding this comment

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

This might trip us up in the future, since the function we pass in here only fits this because we don't use the keyword arguments. In the future this might be a good use for a Protocol.

@DaanDeMeyer DaanDeMeyer merged commit ee3b71b into systemd:main Feb 26, 2025
35 checks passed
@DaanDeMeyer DaanDeMeyer deleted the build-overlay branch February 26, 2025 14:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants