-
Notifications
You must be signed in to change notification settings - Fork 62
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 custom mountpoints #579
Comments
Aside but an important one for me: It'd be really, really, really, really nice if we can share code with Anaconda too. All of these things need to be supported there too. For toplevel mountpoints, the expectation is that the directory is part of the container image; we should simply fail if a target mountpoint does not exist in the container image.
The immutable flag isn't used with composefs, there's currently no "hack" to mutate the rootfs at runtime (without making it globally writable). See also https://gitlab.com/fedora/bootc/tracker/-/issues/26 which is tracking some support for that. But I don't think we want that for disk image defaults, again I think it's basically that the directory should be owned in the container.
It has never been supported to "split" ostree/bootc content across multiple filesystems, I think if you try you'll get Tools like dpkg/rpm/etc support splitting their content in this way, but they only have one copy of content. As ostree/bootc wants to support multiple versions (and are based around a shared/deduplicating backing store) it's a lot harder. containers/composefs#125 touched on some of this, but basically not going to happen anytime soon. So what we should do (to combine these two things) is:
|
I think this simplifies the initial implementation enough to make it work quickly. It does sort of tie the base image to the configuration (mountpoint in base image + bib build config), but that's probably fine. Does it make sense though to relax the first rule for some paths? IIUC, there's no harm in creating a |
I'm sorry if I'm failing to see something obvious but this keeps coming up and I'm still not clear what code we could share. Anaconda operates in a very different environment than osbuild. Also, osbuild stages are (usually) thin wrappers around system utilities. We're currently talking about adding 2-3 stages that essentially do: mkdir <mountpoint> # or maybe we wont do this
sfdisk <device> <long sequence of partitioning commands> and then write a line in fstab for mounting the filesystem to the mountpoint. What is there to share? Are we talking about importing python modules shared with anaconda for shelling out to binaries in a consistent way? The fstab stage a 50 line python script. The disk partitioning is very different in the two cases. While the osbuild sfdisk stage is quite large, most of that is transforming the partition table description to an sfdisk script to run against the disk, because we need a precomputed description of the partition table before we start building. |
Yeah; this is one reason why I was arguing to support embedding partitioning information in the image itself (it's also what systemd-repart is aiming for, though we have use cases beyond what that tool does).
Yep, subdirectories of |
We should get back on this. The idea was good, but I think we kept getting lost in some details. Partitioning descriptions and configurations aren't simple (they can be, but people quickly want to do more when you give them a little), so I don't think we should start adding config keys to a file arbitrarily without thinking about what it might look like when it grows.
Are we thinking about standardising on something like this? This seems similar to the user creation issues, where we would love for
|
Opening this issue to track support for custom mountpoints.
@mvo5 described the issue with custom mountpoints in 06e1b2a.
Short version:
bootc
needs an empty root tree to install to when runningbootc install to-filesystem
. With our current pipelines, when we build an image, we format the disk with all the partitions, mount every mountpoint to its location under a root tree, and callbootc install
to put its files in the fully mounted root tree, which will be non-empty if it contains directories for custom mountpoints.I tested the idea in the commit message
and it works as expected, with some caveats:
/
(the deployed root, not the physical disk root), since afterbootc install
, it is marked immutable.Important note: Some of my tests were "simulated", meaning I scripted or manually intervened to do what osbuild would be doing without actually using a stage, but the behaviour should be the same.
For example, I'm considering the following scenario:
With our proposed solution, bootc will create a filesystem that contains
/opt/myapplication/log/build-time
, but on boot the path/opt/myapplication/log
will be shadowed by the new mountpoint. If there's no way to support this scenario, we should probably inspect the image (which we already do when preparing the manifest) and error out.Questions (cc @cgwalters):
/
. Can we do this? If we flip the immutable flag, create a directory for the mountpoint under/
, and flip it back on, will that be enough or will there be unwanted side effects?/data
, and the disk image is meant to have a separate partition for it. Is this even possible?The text was updated successfully, but these errors were encountered: