Add an API+CLI to inject metadata for bootable OSTree commits
authorColin Walters <walters@verbum.org>
Thu, 11 Mar 2021 01:36:13 +0000 (01:36 +0000)
committerColin Walters <walters@verbum.org>
Fri, 12 Mar 2021 19:01:42 +0000 (19:01 +0000)
commit857587615dc36d2d99e1a9bd36486f4267298971
treedaa91a2fa072e7a184f8ddf73d0ed86a30db44d0
parent31e19935b509d65c835639b9eaf4ac553aa61655
Add an API+CLI to inject metadata for bootable OSTree commits

I was doing some rpm-ostree work and I wanted to compare two
OSTree commits to see if the kernel has changed.  I think
this should be a lot more natural.

Add `ostree commit --bootable` which calls into a new generic
library API `ostree_commit_metadata_for_bootable()` that
discovers the kernel version and injects it as an `ostree.linux`
metadata key.  And for extra clarity, add an `ostree.bootable`
key.

It's interesting because the "core" OSTree layer is all about
generic files, but this is adding special APIs around bootable
OSTree commits (as opposed to e.g. flatpak as well as
things like rpm-ostree's pkgcache refs).

Eventually, I'd like to ensure everyone is using this and
hard require this metadata key for the `ostree admin deploy`
flow - mainly to prevent accidents.
13 files changed:
Makefile-libostree-defines.am
Makefile-libostree.am
apidoc/ostree-sections.txt
bash/ostree
man/ostree-commit.xml
src/libostree/libostree-devel.sym
src/libostree/ostree-repo-os.c [new file with mode: 0644]
src/libostree/ostree-repo-os.h [new file with mode: 0644]
src/libostree/ostree.h
src/ostree/ot-builtin-commit.c
tests/admin-test.sh
tests/basic-test.sh
tests/libtest.sh