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

Support arbitrary custom mountpoints #216

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

thozza
Copy link
Member

@thozza thozza commented Oct 20, 2023

  • Add unit test to test specific mountpoint paths against the mountpoint policy. Replace distro-specific unit tests which were testing basically the same thing, but in which distro. This makes little sense, since all distros use the same mountpoint policy.
  • Explicitly disallow mountpoints which can't / shouldn't be on a separate partition.
  • Relax the mountpoint policy to allow arbitrary custom mountpoints and adjust the unit test accordingly.

Related to https://issues.redhat.com/browse/COMPOSER-2030

@thozza thozza marked this pull request as draft October 20, 2023 14:11
@thozza thozza force-pushed the custom-mountpoints branch from a44f926 to 319aded Compare October 20, 2023 14:26
Add a simple unit test for the current definition of
`MountpointPolicies` to capture various scenarios of what is currently
allowed and what is not.

This will be helpful in the next steps when the policy gets relaxed and
reworked.

Delete distro unit-tests which were responsible for checking that some
specific mountpoints are not allowed by the mountpoint policy. The
newly added policy unit test tests the same thing, but on a single
place.

Signed-off-by: Tomáš Hozza <[email protected]>
Any mountpoints under `/usr` are not supported by systemd fstab
generator in initram before the switch-root, so we don't allow them.

Until now, a user could create a custom mountpoint in e.g. `/usr/lib`,
which would make the system unbootable.

Signed-off-by: Tomáš Hozza <[email protected]>
Before relaxing the mountpoints policy, let's first disallow paths
which can't or should not be backed by a separate partition. This
has no effect on the current mountpoint policy, because all of these
paths are already disallowed.

Signed-off-by: Tomáš Hozza <[email protected]>
Any path, which is not explicitly disallowed, can now be specified as a
separate mountpoint.

Signed-off-by: Tomáš Hozza <[email protected]>
@thozza thozza force-pushed the custom-mountpoints branch from 319aded to 8425d31 Compare October 20, 2023 14:28
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

Nice work and I really like the merged testing. Is there more work to be done here (draft)?

@thozza
Copy link
Member Author

thozza commented Oct 20, 2023

Nice work and I really like the merged testing. Is there more work to be done here (draft)?

Not that I know of. I was just not sure if I didn't forget to fix some tests. 😇 But in general, this should be sufficient for this repo.

@thozza thozza marked this pull request as ready for review October 20, 2023 14:37
@achilleas-k achilleas-k enabled auto-merge October 20, 2023 17:14
@achilleas-k achilleas-k added this pull request to the merge queue Oct 20, 2023
Merged via the queue into osbuild:main with commit de779f3 Oct 20, 2023
7 checks passed
@thozza thozza deleted the custom-mountpoints branch October 23, 2023 07:02
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.

2 participants