deploy: Write a .ostree.cfs composefs image in the deploy dir
authorAlexander Larsson <alexl@redhat.com>
Thu, 30 Jun 2022 12:47:44 +0000 (14:47 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 31 May 2023 08:55:14 +0000 (10:55 +0200)
commitc988ff79387b5b61a1134c5f0d91010b0a280fd6
treeb68937d2aae476d31054a70f7cfa467a558e9c1d
parent0c3d9894be1f1fa0a825aa7b16c119b72c4edc7e
deploy: Write a .ostree.cfs composefs image in the deploy dir

This can be used as a composefs source for the root fs instead of
the checkout by pointing the basedir to /ostree/repo/objects.

We only write the file is `composefs` is enabled.

We enable ensure_rootfs_dirs when building the image which adds the
required root dirs to the image. In particular, this includes /etc
which often isn't in ostree commits in use.

We also create an (empty) .ostree.mnt directory, where composefs
will mount the erofs image that will be used as overlayfs lowerdir
for the root overlayfs mount. This way we can find the deploy
dir from the root overlayfs mount options.

If the commit has composefs digests recorded we verify those with the
created file. It also applies the fs-verity signature if it is
recorded, unless this is disabled with the
ex-integrity.composefs-apply-sign=false option.
src/libostree/ostree-sysroot-deploy.c