deploy: Bump the mtime on ostree/deploy after deployments finish
This allows other processes (e.g. rpm-ostreed) to monitor for external changes (e.g. if someone does `ostree admin undeploy`) in a relatively sane fashion. Specifically, I'm trying to fix: https://github.com/projectatomic/rpm-ostree/issues/220
This commit is contained in:
parent
d25212f04a
commit
d49718a619
|
|
@ -1855,6 +1855,13 @@ ostree_sysroot_write_deployments (OstreeSysroot *self,
|
||||||
requires_new_bootversion ? "yes" : "no",
|
requires_new_bootversion ? "yes" : "no",
|
||||||
new_deployments->len - self->deployments->len);
|
new_deployments->len - self->deployments->len);
|
||||||
|
|
||||||
|
/* Allow other systems to monitor for changes */
|
||||||
|
if (utimensat (self->sysroot_fd, "ostree/deploy", NULL, 0) < 0)
|
||||||
|
{
|
||||||
|
glnx_set_prefix_error_from_errno (error, "%s", "futimens");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now reload from disk */
|
/* Now reload from disk */
|
||||||
if (!ostree_sysroot_load (self, cancellable, error))
|
if (!ostree_sysroot_load (self, cancellable, error))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,14 @@ function validate_bootloader() {
|
||||||
fi)
|
fi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
|
||||||
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime
|
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime
|
||||||
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
|
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
|
||||||
export rev
|
export rev
|
||||||
# This initial deployment gets kicked off with some kernel arguments
|
# This initial deployment gets kicked off with some kernel arguments
|
||||||
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
|
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
|
||||||
|
new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
|
||||||
|
assert_not_streq "${orig_mtime}" "${new_mtime}"
|
||||||
${CMD_PREFIX} ostree admin status | tee status.txt
|
${CMD_PREFIX} ostree admin status | tee status.txt
|
||||||
validate_bootloader
|
validate_bootloader
|
||||||
|
|
||||||
|
|
@ -56,7 +59,10 @@ ${CMD_PREFIX} ostree admin status
|
||||||
|
|
||||||
echo "ok layout"
|
echo "ok layout"
|
||||||
|
|
||||||
|
orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
|
||||||
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
|
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
|
||||||
|
new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
|
||||||
|
assert_not_streq "${orig_mtime}" "${new_mtime}"
|
||||||
# Need a new bootversion, sine we now have two deployments
|
# Need a new bootversion, sine we now have two deployments
|
||||||
assert_has_dir sysroot/boot/loader.0
|
assert_has_dir sysroot/boot/loader.0
|
||||||
assert_not_has_dir sysroot/boot/loader.1
|
assert_not_has_dir sysroot/boot/loader.1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue