Use generator to enable ostree-remount.service and ostree-finalize-staged.path
authorColin Walters <walters@verbum.org>
Wed, 16 Jun 2021 13:26:24 +0000 (09:26 -0400)
committerColin Walters <walters@verbum.org>
Wed, 16 Jun 2021 13:40:28 +0000 (09:40 -0400)
commit73e3ccc401829025a9151fddff29d67a0ac2321d
tree5fb1163f57f84ec63b4e6f4f1efd0691ea7993ca
parentf8496098eed306a5f5ccee95e03339e474221f23
Use generator to enable ostree-remount.service and ostree-finalize-staged.path

We struggled for a long time with enablement of our "internal units",
trying to follow the philosophy that units should only be enabled
by explicit preset.

See https://bugzilla.redhat.com/show_bug.cgi?id=1451458
and https://github.com/coreos/rpm-ostree/pull/1482
etc.

And I just saw chat (RH internal on a proprietary system sadly) where
someone hit `ostree-remount.service` not being enabled in CentOS8.

Thinking about this more, I realized we've shipped a systemd generator
for a long time and while its only role until now was to generate `var.mount`,
but by using it to force on our internal units, we don't require
people to deal with presets anymore.

Basically we're inverting things so that "if ostree= is on the kernel
cmdline, then enable our units" and not "enable our units, but have
them use ConditionKernelCmdline=ostree to skip".

Drop the weird gyrations we were doing around `ostree-finalize-staged.path`
too; forking `systemctl start` is just asking for bugs.

So after this, hopefully we won't ever again have to think about
distribution presets and our units.
configure.ac
src/libostree/ostree-impl-system-generator.c
src/libostree/ostree-sysroot-deploy.c
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c
tests/kolainst/destructive/staged-deploy.sh