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.
This commit is contained in:
1 parent
f8496098ee
commit
73e3ccc401
6 files changed
+56
-35
No files matched your search
@@ -8,6 +8,10 @@ prepare_tmpdir
|
||||
|
||||
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
|
||||
"")
|
||||
# Test our generator
|
||||
test -f /run/systemd/generator/multi-user.target.wants/ostree-finalize-staged.path
|
||||
test -f /run/systemd/generator/local-fs.target.requires/ostree-remount.service
|
||||
|
||||
# Initial cleanup to handle the cosa fast-build case
|
||||
## TODO remove workaround for https://github.com/coreos/rpm-ostree/pull/2021
|
||||
mkdir -p /var/lib/rpm-ostree/history
|
||||
@@ -19,7 +23,6 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
|
||||
# Start up path unit
|
||||
systemctl enable --now ostree-finalize-staged.path
|
||||
# Write staged-deploy commit
|
||||
export OSTREE_SYSROOT_DEBUG="test-staged-path"
|
||||
cd /ostree/repo/tmp
|
||||
# https://github.com/ostreedev/ostree/issues/1569
|
||||
ostree checkout -H ${commit} t
|
||||
@@ -29,8 +32,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
|
||||
systemctl show -p SubState ostree-finalize-staged.path | grep -q waiting
|
||||
systemctl show -p ActiveState ostree-finalize-staged.service | grep -q inactive
|
||||
systemctl show -p TriggeredBy ostree-finalize-staged.service | grep -q path
|
||||
ostree admin deploy --stage staged-deploy | tee out.txt
|
||||
assert_file_has_content out.txt 'test-staged-path: Not running'
|
||||
ostree admin deploy --stage staged-deploy
|
||||
systemctl show -p SubState ostree-finalize-staged.path | grep running
|
||||
systemctl show -p ActiveState ostree-finalize-staged.service | grep active
|
||||
new_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
|
||||
|
||||
Reference in new issue
Block a user