diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-10-16 17:21:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-16 17:21:10 +0200 |
commit | 38729a4f90220578604744ae65b614596604038f (patch) | |
tree | 1dc343ba7cb45ec9f6493085c3b7611cd8265305 /src/libostree/ostree-sysroot-deploy.c | |
parent | 1139ea39db1bc5c78a5f4e902b35825d458fbeb3 (diff) | |
parent | c61234a428ee5daa75eea6524c50b7f11c7788ca (diff) | |
download | ostree-38729a4f90220578604744ae65b614596604038f.tar.gz |
Merge pull request #1937 from cgwalters/zipl-backend
bootloader: Add a zipl bootloader backend
Diffstat (limited to 'src/libostree/ostree-sysroot-deploy.c')
-rw-r--r-- | src/libostree/ostree-sysroot-deploy.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 6507b2c5..15db0bf1 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -43,6 +43,7 @@ #include "ostree.h" #include "ostree-sysroot-private.h" #include "ostree-sepolicy-private.h" +#include "ostree-bootloader-zipl.h" #include "ostree-deployment-private.h" #include "ostree-core-private.h" #include "ostree-linuxfsutil.h" @@ -1829,6 +1830,7 @@ prepare_new_bootloader_link (OstreeSysroot *sysroot, /* Update the /boot/loader symlink to point to /boot/loader.$new_bootversion */ static gboolean swap_bootloader (OstreeSysroot *sysroot, + OstreeBootloader *bootloader, int current_bootversion, int new_bootversion, GCancellable *cancellable, @@ -1862,6 +1864,15 @@ swap_bootloader (OstreeSysroot *sysroot, if (fsync (boot_dfd) != 0) return glnx_throw_errno_prefix (error, "fsync(boot)"); + /* TODO: In the future also execute this automatically via a systemd unit + * if we detect it's necessary. + **/ + if (bootloader) + { + if (!_ostree_bootloader_post_bls_sync (bootloader, cancellable, error)) + return FALSE; + } + return TRUE; } @@ -2128,7 +2139,7 @@ write_deployments_bootswap (OstreeSysroot *self, if (!full_system_sync (self, out_syncstats, cancellable, error)) return FALSE; - if (!swap_bootloader (self, self->bootversion, new_bootversion, + if (!swap_bootloader (self, bootloader, self->bootversion, new_bootversion, cancellable, error)) return FALSE; @@ -2355,6 +2366,14 @@ ostree_sysroot_write_deployments_with_options (OstreeSysroot *self, { /* No bootloader specified; do not query bootloaders to run. */ } + else if (g_str_equal (bootloader_config, "zipl")) + { + /* Because we do not mark zipl as active by default, lets creating one here, + * which is basically the same what _ostree_sysroot_query_bootloader() does + * for other bootloaders if being activated. + * */ + bootloader = (OstreeBootloader*) _ostree_bootloader_zipl_new (self); + } bootloader_is_atomic = bootloader != NULL && _ostree_bootloader_is_atomic (bootloader); |