Track deployment root/inode from prepare root
authorColin Walters <walters@verbum.org>
Thu, 8 Feb 2024 15:13:57 +0000 (10:13 -0500)
committerColin Walters <walters@verbum.org>
Thu, 8 Feb 2024 17:57:53 +0000 (12:57 -0500)
commit525a57d21d7c2a3fca011d88b22f461607ab8c25
tree59fe0a00801876bbf9ecb0224fb600f19c35a685
parentda892140657bfb67d475f80395af97af96b1b6af
Track deployment root/inode from prepare root

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>
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c
src/libotcore/otcore.h
src/switchroot/ostree-prepare-root.c