summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-sysroot.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-03-18 15:32:58 -0400
committerColin Walters <walters@verbum.org>2016-03-23 11:09:09 -0400
commit09238da065e8a442dcffdd1f8d906f4330a6e032 (patch)
tree417acc768c5364d286f02f18a9da6ca0aa1680a4 /src/libostree/ostree-sysroot.h
parent0b1d301d81a36c010b4b56f3e6320420b8344305 (diff)
downloadostree-09238da065e8a442dcffdd1f8d906f4330a6e032.tar.gz
admin: Add an `unlock` command, and libostree API
I'm trying to improve the developer experience on OSTree-managed systems, and I had an epiphany the other day - there's no reason we have to be absolutely against mutating the current rootfs live. The key should be making it easy to rollback/reset to a known good state. I see this command as useful for two related but distinct workflows: - `ostree admin unlock` will assume you're doing "development". The semantics hare are that we mount an overlayfs on `/usr`, but the overlay data is in `/var/tmp`, and is thus discarded on reboot. - `ostree admin unlock --hotfix` first clones your current deployment, then creates an overlayfs over `/usr` persistent to this deployment. Persistent in that now the initramfs switchroot tool knows how to mount it as well. In this model, if you want to discard the hotfix, at the moment you roll back/reboot into the clone. Note originally, I tried using `rofiles-fuse` over `/usr` for this, but then everything immediately explodes because the default (at least CentOS 7) SELinux policy denies tons of things (including `sshd_t` access to `fusefs_t`). Sigh. So the switch to `overlayfs` came after experimentation. It still seems to have some issues...specifically `unix_chkpwd` is broken, possibly because it's setuid? Basically I can't ssh in anymore. But I *can* `rpm -Uvh strace.rpm` which is handy. NOTE: I haven't tested the hotfix path fully yet, specifically the initramfs bits.
Diffstat (limited to 'src/libostree/ostree-sysroot.h')
-rw-r--r--src/libostree/ostree-sysroot.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h
index 077862aa..1e60ddbe 100644
--- a/src/libostree/ostree-sysroot.h
+++ b/src/libostree/ostree-sysroot.h
@@ -164,6 +164,13 @@ gboolean ostree_sysroot_deployment_set_mutable (OstreeSysroot *self,
GError **error);
_OSTREE_PUBLIC
+gboolean ostree_sysroot_deployment_unlock (OstreeSysroot *self,
+ OstreeDeployment *deployment,
+ OstreeDeploymentUnlockedState unlocked_state,
+ GCancellable *cancellable,
+ GError **error);
+
+_OSTREE_PUBLIC
OstreeDeployment *ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
const char *osname);
@@ -174,7 +181,8 @@ GKeyFile *ostree_sysroot_origin_new_from_refspec (OstreeSysroot *self,
typedef enum {
OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE = 0,
- OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN = (1 << 0)
+ OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN = (1 << 0),
+ OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT = (1 << 1)
} OstreeSysrootSimpleWriteDeploymentFlags;
_OSTREE_PUBLIC