-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare-root: Use composefs as root filesystem
This changes ostree-prepare-root to use the .ostree.cfs image as a composefs filesystem, instead of the checkout. Currently composefs is *always* used (if enabled at build time), but long term we want to somehow make this optional while still not lessening trust in the system by allowing an attacker to disable its use. The final layout when this is active is: / ro composefs mount /sysroot "real" root /etc rw bind mount to $deploydir/etc /var rw bind mount to $vardir In order for this to work, we need to change the way prepare-root works. Currently it works with CWD of $deploydir which is a bind mount (so it can be later moved). However, we can't mount the composefs at $deploydir, because then it will cover the etc dir from the underlying deploydir and then we can't bind mount it. Instead we change both codepaths to mount work with the destination /sysroot.tmp, leaving the "real" $deploydir as CWD. I.e. the extra bind mount is in /sysroot.tmp in the !use_composefs case, or the composefs mount in the use_composefs case. This is really not that different from before, as we had to temporarily use /sysroot.tmp at the end before anyway. A further note. I didn't test the overlayfs testcase, but the comment mentions that you can't mount overlayfs on top of a readonly mount. That seems incompatible with composefs.
- Loading branch information
1 parent
60056f3
commit 091ccd2
Showing
2 changed files
with
66 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters