diff options
author | Colin Walters <walters@verbum.org> | 2019-10-14 19:22:19 +0000 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2019-10-16 14:22:02 +0000 |
commit | c61234a428ee5daa75eea6524c50b7f11c7788ca (patch) | |
tree | 83b789145f6f8081c8dd23418cb1e38369953842 /src/libostree/ostree-bootloader.h | |
parent | f203a4fc74581183e259bcd8ac515529d65abae8 (diff) | |
download | ostree-c61234a428ee5daa75eea6524c50b7f11c7788ca.tar.gz |
bootloader: Add a zipl bootloader backend
zipl is a bit special in that it parses the BLS config files
directly *but* we need to run the command to update the "boot block".
Hence, we're not generating a separate config file like the other
backends. Instead, extend the bootloader interface with a `post_bls_sync`
method that is run in the same place we swap the `boot/loader` symlink.
We write a "stamp file" in `/boot` that says we need to run this command.
The reason we use stamp file is to prevent the case where the system is
interrupted after BLS file is updated, but before zipl is triggered,
then zipl boot records are not updated.
This opens the door to making things eventually-consistent/reconcilable
by later adding a systemd unit to run `zipl` if we're interrupted via
a systemd unit - I think we should eventually take this approach
everywhere rather than requiring `/boot/loader` to be a symlink.
Author: Colin Walters <walters@verbum.org>
Tested-by: Tuan Hoang <tmhoang@linux.ibm.com>
Co-Authored-By: Tuan Hoang <tmhoang@linux.ibm.com>
Diffstat (limited to 'src/libostree/ostree-bootloader.h')
-rw-r--r-- | src/libostree/ostree-bootloader.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libostree/ostree-bootloader.h b/src/libostree/ostree-bootloader.h index 5af2dcc8..48a7a9cd 100644 --- a/src/libostree/ostree-bootloader.h +++ b/src/libostree/ostree-bootloader.h @@ -47,6 +47,9 @@ struct _OstreeBootloaderInterface GPtrArray *new_deployments, GCancellable *cancellable, GError **error); + gboolean (* post_bls_sync) (OstreeBootloader *self, + GCancellable *cancellable, + GError **error); gboolean (* is_atomic) (OstreeBootloader *self); }; G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeBootloader, g_object_unref) @@ -66,6 +69,10 @@ gboolean _ostree_bootloader_write_config (OstreeBootloader *self, GCancellable *cancellable, GError **error); +gboolean _ostree_bootloader_post_bls_sync (OstreeBootloader *self, + GCancellable *cancellable, + GError **error); + gboolean _ostree_bootloader_is_atomic (OstreeBootloader *self); G_END_DECLS |