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

Track deployment root/inode from prepare root #3164

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Feb 8, 2024

When we added composefs, it broke the logic for detecting the booted
deployment which was previously a direct (device, inode) comparison.
So the code there started looking at etc. However, that in
turns breaks with etc.transient = true enabled.

Fix all of this by tracking the real deployment directory's
(device,inode) that we found in ostree-prepare-root, and inject
it into the extensible metadata we have in /run/ostree-booted
which is designed exactly to pass state between the initramfs
and the real root.


@alexlarsson
Copy link
Member

I tried this, but it didn't seem to work:

$ ostree admin status
  fedora-coreos cb8c90c9c52d6b7cd4a08024435fe7cfa993b90ba445d8959b8ca1da99044b4d.0
    Version: 38.20240208.dev.6
    origin refspec: fedora:fedora/x86_64/coreos/testing-devel

The should have been an asterisk, no?

@alexlarsson
Copy link
Member

I tried it with

 -      const gboolean ostree_booted = booted_state_fd == -1;
+      const gboolean ostree_booted = booted_state_fd != -1;

and it works.

@cgwalters cgwalters changed the title WIP: Track deployment root/inode from prepare root Track deployment root/inode from prepare root Feb 8, 2024
@cgwalters
Copy link
Member Author

OK I've done some more cleanup, and this definitely works with composefs. Enabling transient etc blocks ssh logins in the current cosa qemu bits...fixing that is going to need some reworking of the test suite.

When we added composefs, it broke the logic for detecting the booted
deployment which was previously a direct (device, inode) comparison.
So the code there started looking at `etc`.  However, that in
turns breaks with `etc.transient = true` enabled.

Fix all of this by tracking the real deployment directory's
(device,inode) that we found in `ostree-prepare-root`, and inject
it into the extensible metadata we have in `/run/ostree-booted`
which is designed exactly to pass state between the initramfs
and the real root.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Member Author

OK fixed; we had a green CI though before that at least. Not totally sure about waiting for a full cycle again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prepare-root Issue relates to ostree-prepare-root
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants