-
Notifications
You must be signed in to change notification settings - Fork 290
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
prepare-root: Move sysroot.tmp creation earlier #2864
prepare-root: Move sysroot.tmp creation earlier #2864
Conversation
54372ac
to
8907f42
Compare
src/switchroot/ostree-prepare-root.c
Outdated
err (EXIT_FAILURE, "failed to MS_MOVE %s to %s", deploy_path, root_mountpoint); | ||
err (EXIT_FAILURE, "failed to MS_MOVE %s to %s", TMP_SYSROOT, root_mountpoint); | ||
|
||
if (chdir ("/sysroot") < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be using root_mountpoint
, not "/sysroot"
. They will mostly be the same, but all the other places use root_mountpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That said, I had to re-read and re-re-read this code and think through things because I realized this change overall was sufficiently large that it had removed my confidence in knowing how things work.
I added some more comments, and updated.
Minor comment, but otherwise LGTM |
8907f42
to
1fab85e
Compare
I find myself wondering though if we shouldn't instead create But bigger picture also, I think with composefs we should stop doing the hardlinked checkouts at all. And that also leads into the discussions around having Also related to this, I'm thinking that instead of parsing options from the target repo, we should inject a config file into the initramfs (e.g. |
For the config, the current PR uses a ot-composefs kernel cmdline options for similar reasons, i.e. in a secureboot system it will be part of a trusted set of info. But yes, the initrd is also a trusted place for such info. As for ostree-prepare-composefs. What would decide to run this instead of ostree-prepare-root? |
The current PR setup is kinda incrementally adding composefs. It deploys both styles, and the code picks up whichever works. I agree that a more opinionated version may be better where we just do the composefs during the deploy if that is configured. Don't we still need a partial checkout for the etc merging to work though? |
Hmm, also it feels like we shouldn't embedd details about how the image is deployed in the initrd, because you may want to have a commit that works in both kinds of deployment. |
Main motivation is prep for composefs in ostreedev#2640 In the interest of that, we add a `bool using_composefs` but it's currently always `false`. Co-authored-by: Alexander Larsson <alexl@redhat.com>
1fab85e
to
c22576c
Compare
With systemd in the initramfs, there's an immense amount of flexibilty. In the general case we can install a generator which parses an injected config file and chooses whether to activate I think what seems simplest though is having one binary with two source files, and very early on in |
@alexlarsson mind adding an official "approve" on this PR? Branch protection here requires it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
Main motivation is prep for composefs in
#2640
In the interest of that, we add a
bool using_composefs
but it's currently alwaysfalse
.